Answer the question
In order to leave comments, you need to log in
How to combine 2 videos of different frame sizes via ffmpeg?
Tell me how to glue 2 horizontal videos like in the image?
ffmpeg -i input1.mp4 -i input2.mp4 -filter_complex "[0:v][1:v]vstack[v];[0:a][1:a]amerge=inputs=2[a]" -map "[v]" -map "[a]" -ac 2 output.mp4
Answer the question
In order to leave comments, you need to log in
You can use the overlay
filter , which will overlay the first source on the empty video of the final frame size and then the second one with an offset of y=280.
ffmpeg \
-f lavfi -i testsrc=size=640x280 \
-f lavfi -i color=c=#ff9900:size=640x360 \
-t 5 \
-filter_complex "
nullsrc=size=640x640 [background];
[0:v] setpts=PTS-STARTPTS [top];
[1:v] setpts=PTS-STARTPTS [bottom];
[background][top] overlay=shortest=1 [background+top];
[background+top][bottom] overlay=shortest=1:y=280
" \
-y -t 5 test.avi
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question