View Full Version : B-frames in x264 or H.264 video encoding
LeoKac
11th May 2012, 18:23
Hello everyone, I have some questions about B-frames in x264 and H.264 encoding.
1) Does "B-Frame as Reference Frames" feature improve output video quality? (I mean, should I enable or disable it?)
2) In "Sorenson Squeeze" software, there is "Number of B-frames" range of 0 to 100 (in x264 codec), so I can adjust any value of B-frames from 0 to 100. So, please tell me should I adjust the value 100 to result better quality? (Or, which value should be optimal for me? because I realy don't care about encoding speed, I just need HIGHEST QUALITY)
3) Should "pyramid B-frame" feature work, if "Number of B-frames" value is more than 3 ?
thanks.........
SeeMoreDigital
11th May 2012, 21:25
Does "B-Frame as Reference Frames" feature improve output video quality? (I mean, should I enable or disable it?)
B-frames only improve "compressibility"...
LoRd_MuldeR
11th May 2012, 22:00
"B-Frame as Reference Frames" and "B-Pyramid" are two names for the same thing. AFAIK, it works with with two B-Frames or higher.
Moreover I think the "Number of B-frames" can not be set higher than 16 for x264. And even if it could be done, then it wouldn't make much sense to do so ;)
Keep in mind that you only set the maximum number of consecutive B-Frames. x264 will still decide how many B-Frame to use. In other words: You only control the upper limit.
(It's "safe" to set the maximum to 16, although x264 will rarely actually go that high. That's also why setting it even higher than 16 would probably change nothing)
Dark Shikari
12th May 2012, 03:33
A 0-100 option sounds more like B-bias...
It's best not to mess with these options. Just use the presets.
Bloax
12th May 2012, 07:48
I really don't care about encoding speed, I just need HIGHEST QUALITY.
Are you absolutely sure you don't mind encoding speed?
If so, then just pick the "placebo" preset. :rolleyes:
[/whyhaven'tyouguyspostedthisyet]
B-frames only improve "compressibility"...
Improved compressibility = More bitrate available at the size =~ Better quality
suciR
7th June 2012, 14:33
(It's "safe" to set the maximum to 16, although x264 will rarely actually go that high. That's also why setting it even higher than 16 would probably change nothing)
i use this commnd
x264 -I 7 -B 1024 --fps 30 -o a03.264 --input-res 352x288 akiyo_cif.yuv
, and i've got only 2 b-frame
Improved compressibility = More bitrate available at the size =~ Better quality
is't bad for using 1024kbps? what number did u get better for the bitrate?
Bloax
7th June 2012, 18:44
Any specific reason you want to set keyframes every 7th frame? (Even for a super-rapid-motion video I set it to 35, which worked alright)
Oh, and unless you're encoding for streaming something (in which case you lack quite a lot of options, and why would you stream a 352x288 video), it's best to use --crf instead of a bitrate. :-)
You may also want to set those B-frames down to 16 (not that it matters, however), and for optimal B-frame goodness you should add --b-adapt 2
If you want a good crf value, then I'd say around 15 for pretty much invisible lossyness, and 24 if you actually want to get into the lossy battlefield.
Of course I'm just trying to be a :helpful:
suciR
8th June 2012, 07:14
i use this reference (http://webcache.googleusercontent.com/search?q=cache:http://140.116.164.80/~smallko/ns2/crosslayer_video.htm)
At his site, the keyframes 7th frmes and used 352x288 because my final prjct is a biggner :D
What is crf value?
Bloax
8th June 2012, 10:45
Whoah, that's some deep stuff. What are you using x264 for?
As for crf, I don't really know in-depth, but it's basically a quality knob. (The lower, the higher the quality.)
suciR
8th June 2012, 11:07
Whoah, that's some deep stuff. What are you using x264 for?
As for crf, I don't really know in-depth, but it's basically a quality knob. (The lower, the higher the quality.)
i meant, what is crf stand for?
I used x264 for get H.264/avc file format.
Guest
8th June 2012, 13:58
i meant, what is crf stand for?
I used x264 for get H.264/avc file format. The second link in a simple Google search finds this:
http://blog.wuphonsreach.org/2010/03/x264-and-crf-settings.html
Please obey our forum rule 1 which requires you to search on your own for simple information like this.
http://forum.doom9.org/forum-rules.htm
john_z
15th January 2013, 10:37
Moreover I think the "Number of B-frames" can not be set higher than 16 for x264. And even if it could be done, then it wouldn't make much sense to do so ;)
Keep in mind that you only set the maximum number of consecutive B-Frames. x264 will still decide how many B-Frame to use. In other words: You only control the upper limit.
(It's "safe" to set the maximum to 16, although x264 will rarely actually go that high. That's also why setting it even higher than 16 would probably change nothing)
When I saw the prompt from Megui, they recommend that number of b should be 2-3, and ref 5, so I encode with Placebo and changed these two settings, please tell me if this is right or worthy the time consumption.
LoRd_MuldeR
15th January 2013, 15:03
Using a higher limit for the max number of consecutive B-Frames (--bframe) or using more reference frames (--ref) should never hurt quality. It only gives the encoders more possibilities to choose from. The encoder will still pick the "best" one, according to the encoder's metrics. However more possibilities also means that more possibilities need to be evaluated, which makes encoding slower! Also at some point adding even more B-Frames or more Ref-Frames simply doesn't improve things any further (in a noteworthy way), but it still makes the encoding slower. In other words: You spend a lot of extra time for a negligible improvement. For B-Frames that point usually is around 2-3 and for Ref-Frames around 5. But that of course depends on the individual source! Anyway, when you are using "Placebo" preset you already have officially confirmed that encoding speed is the very last thing you care about. In that case I don't see why you would limit the number of B-Frames or Ref-Frames to a "reasonable" value. Just keep the maximum (16), as "Placebo" does.
(If in fact you actually do care about encoding speed, simply don't use "Placebo" preset ^^)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.