Journal: Combine Multiple Videos Using ffmpeg

As seen on ma.ttias.be. I’m just documenting this in my own way for future reference. This method is only applicable to videos of the same dimensions and encoding. Tested on FFmpeg 4.3. I use this method to download and concatenate youtube-dl outputs.

Step 1: Create a text file and make a list of video files.

touch files.txt
vi files.txt

Example content to save:

file 'p1.mp4'
file 'p2.mp4'
file 'p3.mp4'
file 'p4.mp4'

Step 2: Run the command below

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