Log in

View Full Version : Avisynth stackHorizontal Help


XPecto
10th May 2009, 21:01
How can i Stack a clip horizontally two or three times with other clips starting at a different Frame.

i used some thing like this but..

a = DirectShowSource("video.avi", audio=false, video=true)
b = a
b.Trim(15, 0)


StackHorizontal(a,b)

Keiyakusha
10th May 2009, 21:21
a=source1.Trim()
b=source2.Trim()
c=source3.Trim()
StackHorizontal(a,b,c)

Edit
Or if you want stack one clip:

DirectShowSource("video.avi", audio=false)
StackHorizontal(last,last.Trim(15,0),last.Trim(25,0))

IanB
10th May 2009, 22:25
b.Trim(...) really is Last=b.Trim(...) so what you wanted wasa = DirectShowSource("video.avi", audio=false, video=true)
b = a
b=b.Trim(15, 0)

StackHorizontal(a,b)

or more generallya = DirectShowSource("video.avi", audio=false, video=true)
b=a.Trim(15, 0)

StackHorizontal(a,b)

Also note DirectShow (an API for media players) does not like doing random disjoint frame access and the access pattern caused by the above script will fail for a fair few formats.

Gavino
10th May 2009, 22:58
Also note DirectShow (an API for media players) does not like doing random disjoint frame access and the access pattern caused by the above script will fail for a fair few formats.
Could this be avoided (at the expense of an extra source filter) by sourcing the video file twice (not usually a good idea)?
a = DirectShowSource("video.avi", audio=false, video=true)
b=DirectShowSource("video.avi", audio=false, video=true).Trim(15, 0)
StackHorizontal(a,b)

XPecto
11th May 2009, 04:33
Thanks!

i used this:

DirectShowSource("video.avi", audio=false)
Stackvertical(StackHorizontal(a,last.Trim(),last.Trim(),last.Trim()),\
StackHorizontal(last.Trim(),last.Trim(),last.Trim(),last.Trim()),\
StackHorizontal(last.Trim(),last.Trim(),last.Trim(),last),StackHorizontal(last.Trim(),last.Trim(),last.Trim(),last))


This is also very helpful
DirectShowSource("video.flv",audio= false)

VHRepeat(last,5,4)

function HRepeat(clip c, int n) {
n <= 1 ? c : StackHorizontal(c, HRepeat(c.Trim(1,0), n-1))
}

function VHRepeat(clip c, int h, int v) {
HR = HRepeat(c, h)
v <= 1 ? HR : StackVertical(HR, YTuuube(c.Trim(h, 0), h, v-1))
}

Gavino
11th May 2009, 09:03
This is also very helpful ...
function VHRepeat(...)
I see you have copied this from my post in a related thread, changing the function name. No problem with that, but you also need to change the name in the recursive call inside the function. So it should be
function VHRepeat(clip c, int h, int v) {
HR = HRepeat(c, h)
v <= 1 ? HR : StackVertical(HR, VHRepeat(c.Trim(h, 0), h, v-1))
}

XPecto
12th May 2009, 02:05
Sorry about that Gavino,
Well i realized the error after i posted here.

Thanks again Gavino!