[FFmpeg-user] framerate conversion with sync audio

Steve Boyer steveboyer85 at gmail.com
Wed Oct 12 01:00:50 EEST 2016


On Tue, Oct 11, 2016 at 4:25 PM, Carles Vila <cvilad at gmail.com> wrote:

> Hi, I'm trying to perform framerate conversion of a video, from 24fps to
> 25fps to be precise.
> The source is  mov, ProRes with multichannel audio at 48kHz.
> It is mandatory for my application to preserve the integrity of all frames,
> i.e. no frame-interpolation or duplication should occur.
> In other words, just the playback speed should be increased from 24 to 25,
> resulting in a video of slightly shorter duration.
> I've been partially successful so far using the command
>
> ffmpeg -r 25 -i <inputfile24fps.mov> -r 25 -c:v prores -profile:v 3 -c:a
> pcm_s24le <output_25fps.mov>
>
> This comand produces a good video, shorter than the original, but the
> problem is with audio. As you can imagine, the audio drifts out of sync
> because it has no knowledge of the video framerate conversion.
> My solution now is to process the audio externally, in an audio editor. I
> must apply a sample rate conversion, first forcing the sample rate metadata
> to 50.000 Hz (48.000 *(25/24)) and then resampling at 48.000 Hz
> This shortens the audio by the same amount as the video and can be merged
> to it.
> Is there any way to perform this audio processing within ffmpeg?
> Thanks!


Have you tried experimenting with the audio filter "atempo"? I'm guessing
here, but try:

ffmpeg -i ...<your options here> -af atempo=0.96 <outfile>

(24/25 = 0.96)

~Steve


More information about the ffmpeg-user mailing list