Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th September 2013, 03:34   #1  |  Link
xxxyyyzzzz
Registered User
 
Join Date: Mar 2011
Posts: 5
x264 rate control modes

Recently I am reading the x264 source codes. Mostly, I concern the RC part. And I am confused about the parameters --bitrate and --vbv-maxrate. When bitrate is set, the CBR mode is used in frame level. If you want to start the MB level RC, the parameters bitrate, vbv-maxrate and vbv-bufsize should be set. But I don't know the relationship between bitrate and vbv-maxrate.
What is the criterion of the real encoding result when bitrate and vbv-maxrate are both set?
And what is the recommended value for bitrate? Equals to vbv-maxrate?
Also what is the recommended value for vbv-bufsize? Half of vbv-maxrate? Please give me some advice.
xxxyyyzzzz is offline   Reply With Quote
Old 4th September 2013, 07:48   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,569
--bitrate sets the average bitrate of the complete encode
--vbv-bufsize sets the size of the decoding buffer
--vbv-maxrate sets the maximum bitrate at which said buffer can be filled
If --bitrate is equal to --vbv-maxrate, CBR encoding will be used. (if --bitrate is greater than --vbv-maxrate, x264 will automatically reduce --bitrate to equal --vbv-maxrate)

You set --bitrate according to the final filesize/average bitrate you want to achieve. (Or use the constant quality mode, i.e. --crf)
You set --vbv-maxrate according to the hardware capabilities of your device (e.g. the CPU/decoder of the player or the speed of your internet connection)
You set --vbv-bufsize according to the hardware capabilities of your device (the memory of the player) and the maximum time you want to spend on buffering. (--vbv-bufsize/--vbv-maxrate = maximum time in seconds it takes to buffer the video before starting to play *)

H.264 has predefined levels to help choosing the correct --vbv-maxrate and --vbv-bufsize values:

Last edited by sneaker_ger; 4th September 2013 at 07:53.
sneaker_ger is offline   Reply With Quote
Old 4th September 2013, 13:25   #3  |  Link
xxxyyyzzzz
Registered User
 
Join Date: Mar 2011
Posts: 5
Thanks for your reply.
I test some sequences using x264. When --bitrate and --vbv-maxrate are both set, the fininal real bitrate is close to the value of vbv-maxrate and may exceed --bitrate? If bitrate sets the size of the final size, how can you explain this?
xxxyyyzzzz is offline   Reply With Quote
Old 4th September 2013, 13:34   #4  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,569
Are you using x264 revision 2340 or older?
sneaker_ger is offline   Reply With Quote
Old 5th September 2013, 01:56   #5  |  Link
xxxyyyzzzz
Registered User
 
Join Date: Mar 2011
Posts: 5
I am using the x264-snapshot-20060316-2245. Are there too many changes between different versions?
xxxyyyzzzz is offline   Reply With Quote
Old 5th September 2013, 06:22   #6  |  Link
nhakobian
Registered User
 
Join Date: Oct 2009
Location: San Francisco, CA
Posts: 101
Quote:
Originally Posted by xxxyyyzzzz View Post
I am using the x264-snapshot-20060316-2245. Are there too many changes between different versions?
Yes.

You are using a version that is almost 7.5 years old. That would be somewhere around revision 468. Thats close to 2000 (!) revisions out of date, with some revisions being extremely complex.

Why are you using something ridiculously out of date? For future note, its usually good form to try the latest version before reporting a bug. It saves time on your end and other people's end, and saves developers a huge headache.

Now, if you have a specific reason for using that old version, you might want to also state that. You may also want to take a look at guides at how to write a bug report. They usually have instructions on performing good first order checks that'll save you time and headaches overall.
nhakobian is offline   Reply With Quote
Old 5th September 2013, 08:27   #7  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,569
The master git: http://git.videolan.org/gitweb.cgi?p=x264.git;a=summary
Up-to-date binaries: http://download.videolan.org/pub/x264/binaries/

This is a recent change you are missing:
http://git.videolan.org/gitweb.cgi?p...69dac6ac57975a
sneaker_ger is offline   Reply With Quote
Old 5th September 2013, 08:31   #8  |  Link
xxxyyyzzzz
Registered User
 
Join Date: Mar 2011
Posts: 5
Haha, thanks. I think the RC source codes of the new versions may be too complex to understand for me.
Thanks for you advice. I will find some new versions.
xxxyyyzzzz is offline   Reply With Quote
Reply

Tags
rate control, x264

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:53.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.