View Full Version : High bitrate without very high peaks?
latet
20th February 2011, 21:46
Hello,
I have some full-HD movies that I made myself, they are quite difficult to encode (lots of dynamic, grainy scenes mixed with various gradient effects). What I need form AVC/x.264 is high bitrate (20-30 Mbps) but without bitrate peaks higher than Blu-ray standards allow (that is 40 Mbps, although I also heard about 48 Mbps and I measured much more on some original BD movies).
I tried: Handbrake, meGUI, MediaCoder and direct AVC output form Sony Vegas. In all cases - the video quality is perfect, the bitrate is what I want it to be (high) but I can't find no way to prevent high peaks, and to make the bitrate graph look more flat. They play fine in the computer but I'm worried it won't be the case with stand-alone players and PS3.
What do you recommend and advise?
Thanks,
Latet
LoRd_MuldeR
20th February 2011, 21:52
Set the VBV parameters (--vbv-bufsize plus --vbv-maxrate) appropriately and that's it.
latet
20th February 2011, 22:08
Set the VBV parameters (--vbv-bufsize plus --vbv-maxrate) appropriately and that's it.
Thank you.
Is it possible to do it (set these parameters) in HandBrake? I usually use the "Constant quality mode, RF=10".
Should I set them both (--vbv-bufsize AND --vbv-maxrate) to the same value, that is the maximum hight of the peaks I want to allow? For example:
--vbv-40000 --vbv-40000
Thank you very much,
Latet
MokrySedeS
20th February 2011, 22:25
http://mewiki.project357.com/wiki/X264_Encoding_Suggestions#VBV_Encoding
LoRd_MuldeR
20th February 2011, 22:52
Should I set them both (--vbv-bufsize AND --vbv-maxrate) to the same value, that is the maximum hight of the peaks I want to allow?
You must set them both, but not necessarily to the same value. Setting only one of them has no effect!
Also VBV Maxrate is not the maximum ("peak") video bitrate, but the maximum rate at which data arrives at the VBV Buffer. There can be short bitrate peaks above that rate. And that's no problem at all!
The purpose of VBV is to make sure that there will be no buffer underruns. Or in other words: It makes sure that at any time there will be enough data left in the buffer to decode the next frame.
See the BluRay Authoring guide for the recommended parameters:
http://sites.google.com/site/x264bluray/home/1080i-p
Blue_MiSfit
20th February 2011, 23:05
Hi Latet,
I think you need to "go back to the drawing board" in terms of how you think of bitrate - peaks specifically. Take all of this with a grain of salt, since I didn't design the encoder or its VBV model, but here's how I see things.
1) Setting maxrate doesn't directly define the maximum instantaneous bitrate (frame size), though it does certainly influence this.
2) This doesn't matter though, because the whole point of the vbv buffer is to absorb fluctuations in bitrate, particularly from I-frames since they're utterly enormous compared to P or B frames.
So, consider the following: We set --crf 10 --vbv-maxrate 40000 --vbv-bufsize 30000. This means a few things
a) Encode using CRF rate control
b) A bufsize of 30000 means that the vbv buffer is 30 megabits in size.
c) A maxrate of 40000 means that data enters the buffer at a maximum rate of 40 megabits per second. If we're assuming 23.976fps, this means that the average frame size will be 1666.7 megabits (or ~213 kilobytes).
d) Thankfully, we have a decently sized buffer to absorb fluctuations, so instantaneous bitrate (individual frame size) will vary quite a bit.
e) However, provided the VBV model is followed properly (which x264 WILL do), your stream will never exceed 40 megabits in a given second, assuming a 30 megabit buffer.
f) Note that 30 is 3/4 of 40, so your buffer is said to be "750ms in duration". Combined with the default --vbv-init value of 90%, you will require 675 ms of buffering time before starting playback.
I get a little fuzzy on the details of how to think about this, but... if bufsize was set to ~1667, we would be using "single frame VBV", or in effect limiting the size of every frame to 1667 kilobits. This is horrible. Increasing bufsize to 30000 gives x264 much more flexibility in regards to bit allocation on a frame by frame basis. I asked a few questions, and the maximum instantaneous bitrate (frame size) seems to be 30 megabits in this case, though thats oversimplifying things somewhat.
In short, don't worry about bitrate peaks. Specify a VBV model that works for your application, and x264 will respect it.
Derek
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.