Join 2 videos to play at the same time Let's say that I have a file1.avi and a file2.avi. Each one of these files is the same size, for instance 300x100.

How could I join them, so that both of them would play the first 10 seconds of each video at the same time, one on top of the other, in a 300x200 video?
Use

ffmpeg -i file1.avi -i file2.avi -filter_complex "[0][1]vstack" -t 10 joined.avi


This will stack the videos vertically and play the first 10 seconds of each. Remove the -t option if the videos are longer and you wish to extend the output. This command also uses the default parameters to encode the video i.e. codec will be MPEG4 Part 2 (Xvid..). If there's any audio, the track from the first video will be used and encoded as MP3.