[Libav-user] encoding bitrate wrong

mattes effemm at mykmk.com
Fri Mar 16 21:10:03 CET 2012

>> 2012/3/1 mattes <effemm at mykmk.com>:
>>> I ported an older mp4 encoder application (using ffmpeg 0.4.9 libs)  over to the ffmpeg 0.7.11 (on
> Fedora15).
>>> Encoding is working, but there is one minor glitch.
>>>   Bitrate is set via AVContext->bit_rate = bitrate.
>> Which video codec do you use?
>> Do you have audio tracks? Did you try encoding without audio tracks? How much bitrate differs from
> desired, without audio tracks?
>> 1. Ensure that frames you feed to encoder have timestamps in that AVCodecContext's time_base. 2. If
> that doesn't help, try setting also AVCodecContext.rc_max_rate to bitrate, and .rc_buffer_size (try
also bitrate value, as trial value). This possibly makes sense only if libx264 encoder is used. Andrey
> The video codec used is CODEC_ID_MPEG4
> with one audio track and codec  AAC - FAAC
>   video bitrate   audio bitrate  resulting bitrate
>    500            128            12614
>   1500            128            237
>   2500            128            13355

I tried many different setting (max_rate, min_rate, ...) but none of them really resulted
in addressing the problem. or created other side effects.

I then dug out the old lib, re-compiled ffmpeg-0.4.9  on FC15 and build against that (instead of 0.7.11)
Now the problem with varying bitrate is gone. and the encoder app becomes usable again.

Though I am still curious, what it takes to make 0.7.11 work?
Is 0.7.11 broken?

More information about the Libav-user mailing list