Concatenate videos from a file list
// what it does
Uses the concat demuxer to join the files listed in filelist.txt (one `file '...'` line per clip) into a single output. Because -c copy stream-copies the packets, there's no re-encoding — it's near-instant and lossless, making this the fastest way to stitch clips that were produced with identical settings (same codec, resolution, and framerate). -safe 0 disables the security check that otherwise rejects absolute paths, `..` components, or protocol prefixes in the list file.
// shell
$ ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.mp4// gotcha
Every input must share the same codec, resolution, timebase, and pixel format; any mismatch yields corrupted output, frozen frames, or A/V desync rather than a clean error. The list file also needs the exact `file 'name.mp4'` syntax, and single quotes inside filenames must be escaped as '\''.