I am trying to merge 5 parts of a continuous video using ffmpeg.

For some reason, the 1st part is encoded at 29.97 FPS, while all the others are at 30 FPS.

  • part #1 : 29.97 fps, 29.97 tbr, 19200 tbn, 38400 tbc
  • part #2 : 30 fps, 30 tbr, 15360 tbn, 60 tbc

So before the concat operation, I tried converting Part #1 to 30 FPS, two different ways :

Both operations passed and I was able to verify the new FPS just by doing ffmpeg -i output.mp4

However, after the concat operation I realised that the video is now shorter than the audio in Part #1, resulting in a short blackout at the end of the Part, while the audio continues uninterrupted.

Why is that, and how to fix it ?

  • You don't need to change framerate. Just make the tbn equal. ffmpeg -i 1.mp4 -c copy -video_track_timescale 15360 output.mp4
    – Gyan
    May 27, 2020 at 4:10
  • Tried your suggestion. Concat with ffmpeg -f concat -safe 0 -i list.txt -codec copy output.mp4, I get the following message Non-monotonous DTS in output stream 0:1; previous: 660480, current: 660114; changing to 660481. This may result in incorrect timestamps in the output file. and there's still a blank at the end of the video stream of Part 1.
    – mach128x
    May 27, 2020 at 15:44


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.