#TIL 30 - Merge to videos from CLI with ffmpeg

Sep 6, 2022 · Dung Huynh

What

Merge multiple video files into one using ffmpeg.

Why

Quick way to combine videos without re-encoding (preserves quality).

How

Create list.txt:

file 'video1.mp4'
file 'video2.mp4'

Run:

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

The -c copy flag streams without re-encoding for fast merging.