ffprobe – ffmpeg concat demuxer merge two videos, output contain frozen frames per second

SE community

Since yesterday I have been experiencing a problem using ffmpeg concat.
I was merging two videos and I noticed frozen frames over my video where videos are merged. I don’t know what am I doing wrong. Why do I have a frozen frame in my video? Then I did a test. First I split my single video into 2 parts and tried to merge them together again and I still noticed a frozen frame around the merged second. Test video name “clip24.mp4”, duration = 40 seconds. Those commands I used on my test.

ffmpeg -i clip24.mp4 -ss 00:00:00 -t 00:00:07 -c copy -avoid_negative_ts 1 part1.mp4
ffmpeg -i clip24.mp4 -ss 00:00:07 -t 00:00:40 -c copy -avoid_negative_ts 1 part2.mp4
echo -e "file part1.mp4\nfile part2.mp4" > input.txt
ffmpeg -f concat -safe 0 -i input.txt -c copy output25.mp4

PS: I have tried also this one. And this just gives more than one second of freezing time.

ffmpeg -i part1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts 
ffmpeg -i part2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output26.mp4

Gives 6 second frozen frame on second 7 up to second 13 and extends the video size for 6 second on the end so duration = 46 istead of 40

Read more here: Source link