sdm wrote:Cavalicious wrote:I wouldn't lower the percentage, but I would add vbv to cap off the bitrate.
Cavalicious, I've been looking into VBV and browsed this:
http://trac.handbrake.fr/wiki/VBVRateControl,
A non-discriminatory capping of bitrate would lead to serious image degradation in highly complex scenes - right?
The alternative might well be stuttering or even video corruptions which isn't nice either. Hardware decoders tends to be less powerful so it tends to affects them a lot more more but at higher levels this can actually overwhelm almost any hardware pretty quickly if it
really goes all-out. The hope is that the level and profile you've selected will allow enough buffer and bitrate for this not to be a serious problem.
sdm wrote:I get the impression VBV isn't blindly 'capping' the bitrate, rather using some sort of buffer and intelligently distributing bits to cap bitrate spikes? Is that true?
If so, without becoming an expert, how do I know what settings are appropriate?
From what I can understand if you're coding to a specific h.264 level and profile this gives you the VBV parameters that hardware should support, so perhaps x264 should set these for you when you set level (it doesn't).
There's conflicting claims on what is allowed but both MeGUI and x.264 seems to limit vbv-buffersize to "maximum bitrate in kbps for Profile/Level" and vbv-maxrate to "maximum bitrate in kbps for Main/Level". However, most of the MeGUI DXVA profiles that use VBV is slightly more conservative and defaults to the lower value for both (except the DXVA-SD which uses it all). Also, while Blu-ray is "mostly" Level 4.1 and quite a bit of the existing hardware devices are really "Level 4 or Level 4.1 for Blu-ray", with a variety of restrictions on bitrate, VBV, max keyframe interval and so on.
Given that a significant number of people seems uses MeGUI with these settings (and x.264 doesn't warn about them, it does if you exceed them) I think at they should be reasonable safe. If your hardware lists a maximum bitrate you can likely do the same calculation using that value instead.
sdm wrote:On an extremely bit-hungry encode of a music video (66% crf, uncapped resulted in 9.88 mbits/s), I tried this:
Code: Select all
:vbv-maxrate=4900:vbv-bufsize=3500
at the end of my advanced x264 options. ( I just copied that from somewhere else in this thread)
Those VBV values looks low even for a Level 3 encode (max 40500 macroblocks, corresponds to 720×480@30). If this really is a SD/L3 encode I suspect that using 10000/10000 should at least stop the underflow warnings but may still limit the bitrate slightly in some scenes.
However, if all the playback devices support a higher level you could declare that and use the higher allowed max bitrate. Some examples extrapolated from MeGUI:
L3 (480p30): level=3:vbv-maxrate=10000:vbv-bufsize=10000
L3.1 (720p30): level=31:vbv-maxrate=14000:vbv-bufsize=14000 (really 14k/17.5k)
L3.1/AppleTV: level=31:vbv-maxrate=12000:vbv-bufsize=5000
L3.2 (720p60): level=32:vbv-maxrate=20000:vbv-bufsize=20000
L4 (1080p30): level=4:vbv-maxrate=20000:vbv-bufsize=20000
L4.1 (1080p30): level=41:vbv-maxrate=50000:vbv-bufsize=50000 (actual)
L4.1/PS3+XBox360: level=41:vbv-maxrate=24000:vbv-bufsize=24000 (actual)
L4.1/Blu-ray: level=41:vbv-maxrate=40000:vbv-bufsize=30000:keyint=24:min-keyint=2 (actual)
L4.1/AVC-HD: level=41:vbv-maxrate=16500:vbv-bufsize=16500:keyint=24:min-keyint=2 (actual)
L4.2 (1080p60): level=42:vbv-maxrate=50000:vbv-bufsize=50000
L5 (1080p72/1920p30): level=5:vbv-maxrate=135000:vbv-bufsize=135000
L5.1 (1080p120/2048p30): level=5:vbv-maxrate=240000:vbv-bufsize=240000
Actual means I cribbed it directly from the settings, the rest was derived from Wikipedia but several was confirmed in MeGUI settings windows (it complains if you set VBV values too high).
I suspect the AppleTV and PS3+XBox360 has been empirically derived, they may handle more on newer x.264 if it's better at following the VBV settings you've give.
http://en.wikipedia.org/wiki/H.264#Levels
Note that if you want hardware accelerated playback on modern graphics cards (and you definitely do!) there's some additional restrictions on the number of Reference Frames. However, most seems to indicate that using large number of refs isn't that useful anyway and recommends a maximum of 3 which is safe even at 1080p (max 4, on lower resolutions it's higher). But if it's true that some players only activates DXVA on L3.1 and L4.1 files that sucks but perhaps I should use 3.1 on SD content instead of L3.
http://www.avsforum.com/avs-vb/showpost ... ostcount=1
Damn, perhaps I should sit down and see if I can add a Level/Profile setting to the Advanced settings page in the Windows GUI
It should default to None to start with, hopefully switching to Auto later after debugging, this would find Main/High and Level from the other settings then set VBV based on that (possibly allow manual overrides).