Skip to content

Instantly share code, notes, and snippets.

@edsu
Last active January 28, 2024 17:10
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edsu/6be2d12042ac7bd7a3c0dff6582414e8 to your computer and use it in GitHub Desktop.
Save edsu/6be2d12042ac7bd7a3c0dff6582414e8 to your computer and use it in GitHub Desktop.
Concat two mp4 files with different resolutions.
# concatenate two videos with different resolution
ffmpeg -i part1.mp4 -i part2.mp4 -filter_complex "[0]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[v0];[1]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[v1];[v0][0:a:0][v1][1:a:0]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment