Stitch two video files side by side

0
60
ffmpeg -y -i yoga.mp4 -i sharks.mp4 -filter_complex "[0:v]pad=iw+iw:ih[v1];[v1][1:v]overlay=overlay_w:0[vid]" -an -map "[vid]" -c:v libx264 -crf 23 -preset veryfast output.mp4

2 comments
Anonymous
Markdown is supported
@g-l-i-t-c-h-o-r-s-e
g-l-i-t-c-h-o-r-s-ecommentedabout 3 years ago

This can also be achieved with:
ffmpeg -i input1.mp4 -i input2.mp4 -lavfi "[0:v]scale=1280x720[1];[1:v]scale=1280x720[2];[1][2]hstack" output.mp4

@eladg
eladgcommentedabout 3 years ago

indeed @g-l-i-t-c-h-o-r-s-e, hstack is a great way to do it. However, Simply's solution is more general and not limited to 720p or 16:9 videos.