How to combine 2 video frame sizes using ffmpeg?

Prompt how to stitch 2 videos horizontal like in the image?

spoiler
5b50da3644d01005234185.png
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

This option glues video just same size
June 3rd 19 at 19:21
1 answer
June 3rd 19 at 19:23
Solution
You can use a filter overlay, which lay upon the empty end of a video frame size of the first source and then the second shift of y=280.

Working example
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
The result
5b50e49134f23765570400.png
if this solution helped – there is a button "Mark a solution" ; ) - Lorena commented on June 3rd 19 at 19:26
Yes, thank you - Lacy44 commented on June 3rd 19 at 19:29

Find more questions by tags FFmpeg