[Libav-user] encoding bitrate wrong

Andrey Utkin andrey.krieger.utkin at gmail.com
Thu Mar 1 10:41:25 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 Utkin


More information about the Libav-user mailing list