3/17/2026

Join video clips together. Covers concat protocol, filter method, and handling different formats.

How to Merge Multiple Videos

Need to join video clips? Here's the best methods for different situations.

Method 1: Same Format (Fastest)

Create list.txt:

file 'clip1.mp4'
file 'clip2.mp4'
file 'clip3.mp4'

Then run:

ffmpeg -f concat -safe 0 -i list.txt -c copy merged.mp4
  • -safe 0: Allows relative paths
  • -c copy: No re-encoding (instant)

Method 2: Different Formats

ffmpeg -i video1.mp4 -i video2.avi -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[outv][outa]" -map "[outv]" -map "[outa]" merged.mp4

This re-encodes for compatibility.

Method 3: Different Resolutions

First normalize resolution:

ffmpeg -i input.mp4 -vf "scale=1920:1080" -c:a copy scaled.mp4

Then merge using Method 1.

Auto-generate List

ls *.mp4 | sed "s/^/file '/" | sed "s/$/'/" > list.txt

Troubleshooting

No audio after merge? Use Method 2 which handles multiple audio tracks properly.

"Unsafe file name" error? Add -safe 0 or use absolute paths.

Quick Reference

# Same format
ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4

# Different formats
ffmpeg -i a.mp4 -i b.mp4 -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" output.mp4

Merge videos effortlessly!