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.

touch files.txt
vi files.txt

List the videos to combine.

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

Credit: cover photo by Tim Mossholder on Unsplash.