View Full Version : Calculating B-frame ratios
malkion
28th October 2004, 02:37
Dear Sirs,
Is there any tool or formula to calculate b-vop settings in XviD to produce a file with a certain percentage of b-frames used?
For example, encoding a movie (90min) to acheive 30% b-frames.
The closest I have come is using b-vop settings of 1/1.50/1.00 with b-frame sensitivity of -23.
Warm gratitude and best wishes.
akupenguin
28th October 2004, 03:18
Why exactly do you care what fraction of the frames are B? Meeting some arbitrary quota isn't going to improve quality or speed.
Blue_MiSfit
28th October 2004, 03:47
i second akupenguin.
XviD understands frametype decisions much better than you or I do.
Don't worry about hitting a certain ratio, the codec will figure out which is best for the source.
I would reccommend setting bvop settings to their defaults, maybe setting max consec. to 3. These settings seem to work very well for the vast majority of people. Any more than 3 seems to produce diminishing bit returns.
stick to defaults bottom line :)
~misfit
movmasty
28th October 2004, 06:51
Originally posted by malkion
Dear Sirs,
Is there any tool or formula to calculate b-vop settings in XviD to produce a file with a certain percentage of b-frames used?
For example, encoding a movie (90min) to acheive 30% b-frames.
The closest I have come is using b-vop settings of 1/1.50/1.00 with b-frame sensitivity of -23.
Warm gratitude and best wishes.
b % depends from the movie that you are encoding, on average i think that with bmax 1 and 2 xvid puts 45% and 60% of b, so you should set sensytivity to -15/20 and -30/35,
or, you run the 2nd pass and then a 3rd adjusting b sensytivity
this is another argument to have the 1st pass with a given bitrate and not with fixed quantizer.
Koepi
28th October 2004, 10:42
Don't touch bvop sensitivity unless you are certain about _you know_ what you're doing there.
During 2nd pass there is no mode-decision anymore, the mode-decision (thus the I/P/B-frame structure) is fixed in the statsfile.
If you're not satisfied with the amount of bframes, do a proper 2 pass encode again with changed values for max. bframes (and, only in case you know what you're doing, b-vop sensitivity).
Doing a first pass based upon constant bitrate makes absolutely no sense in the terms of constant quality. That's the only valid argument and the reason why that's not going to be implemented into xvid.
Regards
Koepi
Blue_MiSfit
28th October 2004, 22:32
well said kopei!! :)
malkion
29th October 2004, 07:35
Hmm, would this mean the answer is no one knows for certain?
Teegedeck
29th October 2004, 07:44
No, it means it is too complicated and partially unpredictable. How many b-frames and which sensitivity would be 'ideal' would vary from source to source. There is no indication that trying to reach a certain percentage of b-frames for your encode will help quality in any way BTW:
More b-frames and higher sensitivity can quickly and quite unexpectedly lead to an increase in filesize while at the same time to a decrease in quality. The defaults are good, you probably won't gain anything by deviating from them. The only thing you're likely to get out of changing the defaults is a lot of work in comparing different settings before returning to the defaults. ;)
malkion
29th October 2004, 19:52
Dear sirs,
I have more time today to respond. :D
@akupenguin
It is precisely because I care about the quality of the encode that prompts me to adjust b-frame controls. Speed is of no consequence of course, once quality is attained.
@Blue_MiSfit
I totally trust XviD to respond and encode the video at the settings I provide it. :) I'm positive XviD will hit whatever mark I ask of it, and well.
@movmasty
Thanks for the sharing of your knowledge, I can only confirm the same findings myself.
@Koepi
You are absolutely correct. Given what the laymen or XviD enthusiast is provided with by FAQs and other infomartion shared on this nice forum, that is how I set the encoding options for encoding, adjusted by personal experience and visual preferences. :p I've strictly followed the 2-pass procedure you documented as it seems only logical.
@Teegedeck
Sadly, I do wish there was an easier way or a tool invented just for this purpose. It isn't necessary of course, the old trial and error method does work, afterall. I simply submitted the query in hope of a suitable response. The defaults are very nice indeed, however, I believe none of us really use the default settings do we? ;)
In closing, I sincerely thank all you gents for sharing your philosophy on XviD usage. It is gratifying to be able to share with developers and enthusiasts alike.
Best wishes.
unmei
29th October 2004, 23:36
The defaults are very nice indeed, however, I believe none of us really use the default settings do we?
Excuse me when i have to LOL
The defaults are good, you probably won't gain anything by deviating from them. The only thing you're likely to get out of changing the defaults is a lot of work in comparing different settings before returning to the defaults.
I went out for that quest some time ago. And Teegedeck, points out the essence.
Therefore your believe is easily proven wrong by the fact that i returned to the default values (even one single person is not exactly none :p ). True, sometimes when i feel like it, i set the max consecutive to 3 or 4, but then i do it "out of the womb" and don't know if it really does any good. The other Bframe controls i always leave at default now. IMO they are really just a waste of time.
But of course, feel free to experiment and find better values. But if you do, take them with a gain of salt. You could find better values that turn out being not so better on the long run. What i mean is, once you have a "secret recipe" you run danger of not seeing it's disadvantages if you don't do tests over and over - because no one else will know then and be there to tell you how borked they are.
malkion
30th October 2004, 00:10
Dear unmei,
Are we speaking of b-frame defaults, or XviD codec defaults? Visually I've always enjoyed none, or 1 b-frame much more than 2 b-frames. As for the rest of the default options, I've never used pack bitstream in my life. If you enjoy the actual defaults of XviD, I congradulate you. I was enjoying a mood of humour with Teegedeck about the XviD defaults, since he so highly values AQ, Q-pel, GMC and custom matrices, none of which are defaults for XviD. I suppose every one likes to interpret language as they wish. :rolleyes:
Best wishes.
unmei
30th October 2004, 06:31
No i was strictly referring to the Bframe related settings only, because i thought this thread was about them. If you were talking about all the settings in general i'm sorry for the misunderstanding :D
Teegedeck
30th October 2004, 08:39
I was referring to the b-frame defaults. Any yes, I use them.
movmasty
30th October 2004, 14:21
Excuse me koepi for this little o.t.,
but,
why do when you reinstall xvid it deletes ALL custom file in its directory?????
i had in xvid folder all my custom matrices, hours and ours....days and days of working and testing...
my heart had a break....
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.