[FFmpeg-devel] Ratecontrol problem

Joseph Artsimovich joseph at mirriad.com
Tue Nov 20 17:23:25 CET 2012


I found another problem with ratecontrol. Encoding a single IMX30 frame 
like this:

ffmpeg -i uncompressable.png -y -vcodec mpeg2video -r 25 -pix_fmt 
yuv422p -minrate 30000k -maxrate 30000k -b:v 30000k -intra -flags 
+ildct+low_delay -dc 10 -intra_vlc 1 -non_linear_quant 1 -ps 1 -qmin 1 
-qmax 12 -top 1 -bufsize 1200000 -rc_init_occupancy 1200000 
-rc_buf_aggressivity 0.25 -vtag mx3p -an out.mov

produces a "rc buffer underflow". I uploaded the image I was encoding 
here (it wont reproduce with just any image):

The settings I used correspond to the ones from FFMpeg howto, except I 
raised qmax to the maximum possible value non_linear_quant supports. 
Yet, it fails to fit ratecontrol restrictions even then. That's actually 
a big deal when working with MXFs.

Using git bisect I found the offending commit:
commit ce7876cbf4cd3e6f07a36e2fe1e28ca825dd5141
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Tue Sep 11 17:38:31 2012 +0200

     ratecontrol: Dynamically choose a default for rc_max_available_vbv_use

     This improves handling of small buffer sizes

Adding "-rc_max_vbv_use 1" fixed the problem, yet I tend to think the 
commit in question didn't intend to change pre-existing behaviour when 
that option isn't specified.

Joseph Artsimovich
Senior C++ Applications Developer
MirriAd Ltd

More information about the ffmpeg-devel mailing list