Skip to content

Instantly share code, notes, and snippets.

@devnano
Last active April 8, 2019 18:51
Show Gist options
  • Save devnano/3313ac0ca633d5097c0b26e62b361778 to your computer and use it in GitHub Desktop.
Save devnano/3313ac0ca633d5097c0b26e62b361778 to your computer and use it in GitHub Desktop.
Compose two videos into a single – top/bottom – video with a oneliner ffmpeg command
ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "nullsrc=size=720x1280 [base]; [0:v] setpts=PTS-STARTPTS, scale=720x640 [top]; [1:v] setpts=PTS-STARTPTS, scale=720x640 [bottom]; [base][top] overlay=shortest=1 [tmp]; [tmp][bottom] overlay=shortest=1:y=640" -c:v libx264 output.mkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment