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

pehache pehache.7 at gmail.com
Tue Oct 11 14:52:14 EEST 2022


Le 08/10/2022 à 10:31, Bo Berglund a écrit :
> 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?
> 
> 

First I advice reading this: https://trac.ffmpeg.org/wiki/Concatenate

Second, when you have commands that do not give the expected results, it 
can often help to show the messages they print in the terminal.



More information about the ffmpeg-user mailing list