2

With ffmpeg is possible to convert an input 24 fps video/audio to a 25 fps one while keeping the same exact duration, and also keeping as much as possible the original audio pitch ?

I was thinking about the -r option and also a sound filter but I don't know what to add to my command line:

ffmpeg -i input.mov -r 25 -c:v libx264 -crf 18 -c:a libfdk_aac -global_quality 3 output.mov
2
  • Audio and video are processed independently. Changing video framerate won't affect the audio.
    – Gyan
    Jun 20, 2017 at 3:43
  • @Mulvya Oh so my problem is to make audio match the video perfectly and also correct the pitch, can you add a solution for that? Jun 20, 2017 at 9:11

1 Answer 1

2

Your command already achieves that. When specifying -r as an output option, ffmpeg will change the framerate of the video, duplicating or dropping frames as necessary to achieve the same overall duration. The audio stream will be processed independently, thus not affecting the pitch (since the overall duration is not changed) or sync (since the timestamps of both streams stay aligned).

-global_quality is not valid. For libfdk_aac you should use the -vbr option as mentioned in the AAC encoding guide.

5
  • Thanks but I need a solution that allows me to have audio matching perfectly the video rather thank be kept untouched, and I also need an audio filter applied to lower the pitch accordingly. Jun 20, 2017 at 9:12
  • The audio will perfectly match the video, since both streams are synchronized based on their frame/sample timestamps. And the pitch will not be changed in any way if you're just re-encoding. Again, you're asking for keeping the same duration and pitch, and that's exactly what your command does. (If you think it does not, please show an example of that.)
    – slhck
    Jun 20, 2017 at 11:59
  • Ah i see, ffmpeg provides duplicating the frames, nice :) Jun 20, 2017 at 22:06
  • Hello, isn't the -vbr tag for Variable Bit Rate mode? What's the purpose of using this tag, if we want to end up with a fixed fps with the -r tag?
    – ocramot
    Dec 1, 2017 at 10:18
  • @ocramot Video frames per second do not have anything to do with a variable bit rate in an audio stream. -vbr applies to the AAC encoder only.
    – slhck
    Dec 1, 2017 at 11:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.