[FFmpeg-user] How to concat two videos with same size but different source?

Bo Berglund bo.berglund at gmail.com
Sat Oct 8 11:31:06 EEST 2022

I have two mp4 videos both at 480p resolution, which I want to concat.
They are together about 80 minutes long.

When I do this using the common way with this command:

ffmpeg -f concat -safe 0 -i join.txt -c copy joinedfile.mp4

using a file specifying the video sections to concatenate the result plays very
poorly and has many artifacts.

And at the border between the two videos the output video becomes unplayable.

So I tried to re-encode using this command instead:

ffmpeg -hide_banner -i video.1.mp4 -i video.2.mp4 \
-filter_complex "[0:v] [0:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" \
-map "[v]" -map "[a]" video.mp4

This command was started before bedtime yesterday and had not finished this
morning 8 hours later...

The video output file size was about 1.5 GB when I interrupted the process.
The two videos are 101 and 238 MB in size respectively. They are downloaded
videos from the Internet.

What ffmpeg command can I use to concatenate these two files in a safe way?

Bo Berglund
Developer in Sweden

More information about the ffmpeg-user mailing list