Skip to content

Instantly share code, notes, and snippets.

@edsu
Last active July 26, 2024 16:55
Show Gist options
  • 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