Combining 2 MP4 movies in to a split view movie

May 8, 2017 - Reading time: ~1 minute

I installed a set of cameras on my bike and the streams are saved separately on the SD card. There is some kind of Windows tool included but I wanted to combine them on Linux, since I don't use Windows at home.


This ffmpeg command will take 2 streams and put them together side to side in a new MP4 file. Make sure both streams have the same resolution!

ffmpeg \
-i CAM1.MP4 \
-i CAM2.MP4 \
-filter_complex '[0:v]pad=iw*2:ih[int];[int][1:v]overlay=W/2:0[vid]' \
-map [vid] \
-c:v libx264 \
-crf 23 \
-preset veryfast \


Koen Diels

I'm a freelance system and network engineer from Mechelen (BE) and I'm available for ad-hoc and long term projects.

>>my resume<<