I want to combine four videos into a grid. Currently I'm using vstack
to combine the rows and then hstack
to combine the two outputs, as well as adding the audio.
ffmpeg -ss 0 -i 1.mp4 -ss 8 -i 3.mp4 -filter_complex vstack left.mp4
ffmpeg -ss 0 -i 2.mp4 -ss 0 -i 4.mp4 -filter_complex vstack right.mp4
ffmpeg -i left.mp4 -i right.mp4 -filter_complex hstack -i audio.mp4 output.mp4
It seams possible to do this in one operation using overlay
and pad
. However, the documentation states that using vstack
and hstack
is faster. Can those two filters be combined to one single operation?