Merge Multiple Videos into One with FFmpeg

Concatenate several video clips end-to-end into a single file using FFmpeg's concat demuxer, with no re-encoding and no quality loss when formats match.

LinuxvideoconcatcliffmpegLow risk
Write the clip paths into a text list and run ffmpeg -f concat -safe 0 -i list.txt -c copy merged.mp4 to join them into one file.

01Command

Command
$ printf "file '%s'\n" clip1.mp4 clip2.mp4 clip3.mp4 > list.txt && ffmpeg -f concat -safe 0 -i list.txt -c copy merged.mp4

02What it does

FFmpeg's concat demuxer reads a plain text file listing your clips in order and stitches the streams together. Using -c copy means the video and audio are copied bit-for-bit, so merging is fast and lossless — but it only works cleanly when all clips share the same codec, resolution, and audio settings. If your clips differ, re-encode the output (drop -c copy and add -c:v libx264 -crf 23) so FFmpeg converts everything to a common format.

03Risk

RiskLow risk
Requirementsffmpeg (sudo apt install ffmpeg / sudo dnf install ffmpeg)
!Warning: Merging files with different codecs or resolutions using -c copy produces a broken or glitchy output; re-encode instead when sources don't match.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • FFmpeg Formats Documentation (concat demuxer)
    FFmpeg · vendor-doc · 2026-09-17
    Evidence: Documents the concat demuxer: it reads a list of files and concatenates them sequentially, with -safe 0 required for absolute paths.
  • ffmpeg(1) — Linux manual page
    Arch Linux · community · 2026-09-17
    Evidence: Official ffmpeg manual describing -f concat, -i input list handling, and -c copy for stream copying without re-encoding.

Last verified: 2026-09-18 · Category: Media