Log in

View Full Version : Avisynth Display multiple Videos At the same time


XPecto
10th May 2009, 19:40
Can i do some thing like this using Avisynth?

http://www.yooouuutuuube.com/v/?rows=18&cols=18&id=pAwR6w2TgxY&startZoom=1

Keiyakusha
10th May 2009, 22:03
Well, maybe someone will make a better script, but this should work.

a=DirectShowSource("sample.avi").Spline36resize(160,120)
z=StackHorizontal(a,a.Trim(1,0),a.Trim(2,0),a.Trim(3,0),a.Trim(4,0),a.Trim(5,0),a.Trim(6,0),a.Trim(7,0))
x=StackHorizontal(a.Trim(8,0),a.Trim(9,0),a.Trim(10,0),a.Trim(11,0),a.Trim(12,0),a.Trim(13,0),a.Trim(14,0),a.Trim(15,0))
c=StackHorizontal(a.Trim(16,0),a.Trim(17,0),a.Trim(18,0),a.Trim(19,0),a.Trim(20,0),a.Trim(21,0),a.Trim(22,0),a.Trim(23,0))
v=StackHorizontal(a.Trim(24,0),a.Trim(25,0),a.Trim(26,0),a.Trim(27,0),a.Trim(28,0),a.Trim(29,0),a.Trim(30,0),a.Trim(31,0))
b=StackHorizontal(a.Trim(32,0),a.Trim(33,0),a.Trim(34,0),a.Trim(35,0),a.Trim(36,0),a.Trim(37,0),a.Trim(38,0),a.Trim(39,0))
Stackvertical(z,x,c,v,b)

Edit: script corrected.

Gavino
11th May 2009, 00:46
Here's a way to do it with recursive functions, which has the advantage of allowing you to specify the number of horizontal and vertical repeats.
function HRepeat(clip c, int n) {
n <= 1 ? c : StackHorizontal(c, HRepeat(c.Trim(1,0), n-1))
}

function YTuuube(clip c, int h, int v) {
HR = HRepeat(c, h)
v <= 1 ? HR : StackVertical(HR, YTuuube(c.Trim(h, 0), h, v-1))
}
So Keiyakusha's example could be written simply as: a.YTuuube(8,5) :cool:

XPecto
11th May 2009, 04:25
Thank you!
i trying to do this for a while,but..
thanks again.

shoopdabloop
11th May 2009, 06:48
Didn't know it was that easy to do that, but after all, it is AviSynth...