[Ffmpeg-devel] [RFC] ratecontrol buffer size magic

Baptiste Coudurier baptiste.coudurier
Thu Apr 5 18:51:00 CEST 2007


Hi,

I stumbed accross a weird behaviour of the CBR ratecontrol lately,
basically doing:

 ffmpeg -i file.mpg -vcodec mpeg2video -minrate 30000k -maxrate 30000k
-b 30000k -intra -flags +ildct+low_delay -dc 10 -flags2
+ivlc+non_linear_q -ps 1 -qmin 1 -qmax 12 -top 1 -vglobal 4 -acodec
pcm_s16be -f mov -bufsize 1200000 -rc_init_occupancy 1200000 cbr.mov

Constraints are so in order to achieve vbv delay as 3600.
Now ffmpeg will only give me qp as 24. While tweaking I changed some
magic in ratecontrol.c (see patch attached) and now qp have decent/good
values.

I dig into svn history and found out that r2601 bumped */2 to */3 to
improve CBR ratecontrol. Can anyone explain in detail why that magic
does improve behaviour ?

Can that parameter be user setable ? Or is it really hardcoded
everywhere ? Am I doing something terribly wrong ?

Thanks for comments.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ratecontrol.patch
Type: text/x-diff
Size: 1666 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070405/cf6e509a/attachment.patch>



More information about the ffmpeg-devel mailing list