28 March, 2013

Generate Side-by-Side Video Using FFMpeg

Seems I've been doing things the hard way for quite some time.  Occasionally, I've found it useful to generate mosaic'ish videos.  'til now, I've done so by extracting frames from the video into a series of png or jpg files, using ImageMagick to generate the source images, then reassemble the input frames into a video.  Seems an easier way is to extend one of the source video files into the destination dimensions, then overlay the other video over the extended space.

$ ffmpeg -y -i ./Downloads/big_buck_bunny_1080p_surround.avi -s 640x480 -an -sameq /var/tmp/left.avi
$ ffmpeg -y -i /var/tmp/left.avi -vf "pad=1280:480:0:0:black" -sameq /var/tmp/wide.avi
$ ffmpeg -y -i /var/tmp/wide.avi -vf "movie=/var/tmp/left.avi[mv]; [in][mv] overlay=640:0" -sameq /var/tmp/side.avi


No comments: