Combine videofiles without re-encoding

Sometimes you have two or more videofiles, you want to combine into one file. I use ffmpeg and use the concat demuxer instructions:

First create a text file named vidlist.txt in the following format:


file '/path/to/clip1'

file '/path/to/clip2'

file '/path/to/clip3'

The best is to place it in the same directory as the videofiles are. Note that these can be either relative or absolute paths.

Then issue in the same direcory from a terminal the command:

ffmpeg -f concat -safe 0 -i vidlist.txt -c copy outputfilename.avi

In case it's not abundantly clear, replace outputfilename.avi with the video filename you wish to produce (whether that be outputfilename.mp4, outputfilename.mkv, outputfilename.avi) ffmpeg will utilize the container indicated by the extension.

The files will be stream copied in the order they appear in the vidlist.txt into the output container. because no re-encoding takes place, the command is relatively fast.