PDA

View Full Version : Combining two videos in one (side-by-side)


Funkdafied
14th October 2006, 01:24
I've got two WMV files of close to the same length.. One has audio and one doesn't. They have different resolutions and I think different framerates. I'd like to combine them into a single video as you see in the attached picture (basically, one video in the top left of the image, slightly overlapping the other one in the bottom right). Is this possible with AviSyth? How would I do it?

IanB
14th October 2006, 11:04
Red=DirectShowSource('Red.wmv", FPS=25, ConvertFPS=True)
DirectShowSource("Blue.wmv", FPS=25, ConvertFPS=True)
AddBorders(123, 456, 0, 0, $ffffff) # White
Layer(Red, "Add")Choose more suitable border offsets than 123 & 456. And choose a more suitable master framerate than 25 :)

Overlay could also be used instead of Layer

Funkdafied
14th October 2006, 14:16
Thank you.. I got it working :)

Only problem now is the slight difference in length.. one video is a fraction of a second longer than the other.. How can I trim the longer one so it stops at exactly the same time as the shorter one?

krieger2005
14th October 2006, 14:42
To trim use the function "trim" ;)
trim(<start-frame>,<end-frame>)

IanB
14th October 2006, 16:17
Or you could skew the DSS frame rate conversion slightly, i.e....
DirectShowSource("Blue.wmv", FPS=25.025, ConvertFPS=True) # Run 0.1% fast
AssumeFPS(Red, False) # Copy FPS from Red clip, 2.5.7 Feature
...Again pick numbers to match your clips.

The choice between this and Trim()'ing depends apon whether you simply want to discard dross at the clip edges or tweak the alignment of a scene change near the end of the clip.

The DSS ConvertFPS function was designed to undo WMV temporal compression, for best effect the FPS value should match the rate of the original input source (which of course you have to guess; 23.976, 25.0 and 29.97 are usually good guesses) Wrong values may cause motion judder in the output.