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 :
ffmpeg -i 1.mp4 -filter:v fps=fps=30 output.mp4(based on the example at https://trac.ffmpeg.org/wiki/ChangingFrameRate)
ffmpeg -i 1.mp4 -framerate 29.97 -r 30 output.mp4
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 ?