View Full Version : glue 2 inputs side by side
BlackSharkfr
3rd April 2008, 16:28
Hi
I'm rendering a stereoscopic 3D video with the two video channels recorded on different files.
So before encoding, i need to glue the two videos channels side by side. I'd like to do this with an avisynth script on the fly when encoding (x264 in Megui).
but i don't know avisynth scripting, so i need your help.
My two input files are mjpegs in .avi 1280x720 30p each, which open well with my directshow filters.
for example :
video-left.avi
video-right.avi
and i need to glue them side by side in order to get one 2560x720 30p output.
Thanks in advance for your help.
unskinnyboy
3rd April 2008, 16:48
Just use StackHorizontal() (http://avisynth.org/mediawiki/StackHorizontal) or look here (http://forum.doom9.org/showthread.php?t=136375) for some more advanced functions.
BlackSharkfr
3rd April 2008, 18:14
works very well, thanks !
Starduster
3rd April 2008, 19:08
How crazy is that!!
I wanted to do side-by-side videos so I thought there might be something in this forum... This was the very top of the list!!
Thanks, this worked perfectly for me too!... 'Cept for the different sized video part.
Is there any way to resize the second video to match the first on the fly or does it need to be re-encoded before stackHorizontal will work?
Thanks again!
Southstorm
3rd April 2008, 19:12
You can apply a resize to the video in the script with LancosResize() or something similar. Its all in the AVISynth manual.
Starduster
5th April 2008, 01:52
Yeah, that did the trick. I used the width and height of the first video as input to the LanzosResize function and it works perfectly. Thanks a ton.
Blue_MiSfit
5th April 2008, 04:18
If you want to avoid aspect ratio error, then resize to the closest mod16 size (respecting AR), and AddBorders(...) the rest.
~MiSfit
Terka
5th April 2008, 11:30
is it possible to add subtitle with clip names
CompareClips (myclip1, myclip2)
function CompareClips (clip c1, clip c2) {##################################################################
l=[<"left", 0, 720, 240>]
r=[<"right", 0, 720, 3>]
t=[<"top", 0, 576, 48>]
b=[<"bottom", 0, 576, 177>]
cl1=c1.crop(l*2,t*2,-r*2,-b*2)
cl2=c2.crop(l*2,t*2,-r*2,-b*2)
stackhorizontal(cl1,cl2)
} #
so on them will be text myclip1 respective myclip2
Terka
5th April 2008, 11:36
without havig to pass another 2 variables to function
function CompareClips (clip c1, clip c2, string c1name, string c2name) {##################################################################
l=[<"left", 0, 720, 240>]
r=[<"right", 0, 720, 3>]
t=[<"top", 0, 576, 48>]
b=[<"bottom", 0, 576, 177>]
cl1=c1.crop(l*2,t*2,-r*2,-b*2).subtitle(c1name)
cl2=c2.crop(l*2,t*2,-r*2,-b*2).subtitle(c2name)
stackhorizontal(cl1,cl2)
}
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.