Log in

View Full Version : b-frames


Wolferous
24th April 2004, 01:41
B-VOPs
Max consecutive BVOPs:

Say for instance I use a value of 10 or so for this setting, would that be particularly bad? For what reason would I want to keep it around 1-3?

TorgoGuy
24th April 2004, 03:44
Originally posted by Wolferous
Max consecutive BVOPs: Say for instance I use a value of 10 or so for this setting, would that be particularly bad? For what reason would I want to keep it around 1-3?
According to Syskin (?), a good reason to keep it fairly low is to keep XviD from making a stupid decision--using too many b-frames in a row when it shouldn't. In theory if the code was perfect in deciding when to use them, you wouldn't need this setting (other than playback compatibility).

Syskin/Koepi: Correct me if I'm wrong.

Teegedeck
24th April 2004, 08:33
Also if you do some compressiblity tests you'll see that you gain very little from using more than 2 b-frames.

Audionut
24th April 2004, 11:36
However, setting the value to 8-10 max b-frames.
Then applying a b-frame sensitivity of 99 in zones delegated to credits works nice.:)
As far as I'm aware, max b-frames value is nothing more than a limit.
So setting a limit of 8 b-frames won't make xvid insert more b-frames.

Adjusting b-frame sensitivity is the key.

Selur
24th April 2004, 12:13
for some clips one also get's really nice results if one sets max b-frames to 250 (!memory consuming!), sets b-Frame sensitivity to 70+ and than sets offset to 0 and ratio to 1.


and Audionut is right unless one boosts the sensitivity xvid shouldn't insert any 'stupid' b-frames. ;)

Cu Selur

Undead
24th April 2004, 18:00
I use 20 max B-frames. Usually, even with sensitivity 20 I don't get more than 3 B-frames in a row. The reason I use 20 is that I want to allow the codec to use many B-frames for credit zones [or whatever zone I want to be highly compressed]. In credits I get more than 10 B-frames [with sensitivity around 50-80] and it's fine. But normally the codec doesn't use too many B-frames, so I think it's OK.

Just one possible problem. If I use 20 max B's, the encode usually has 19 frames less than it should [although DRF-analyzer says NO DROPS]. I suppose these are at the end of the movie, so no big deal. I wonder if anyone can tell me what exactly happens in this case.

crusty
24th April 2004, 18:30
That might have something to do with the order the frames are stored in.
Try this and tell us the results:

Using 20 max consec. B-frames, encode a small, 2000 frame clip in two-pass in the following ways:

-Packed bitstream ON and encode to an avi.
-Packed bitstream OFF and encode to an avi.
-Packed bitstream ON and encode directly to ogm (using a vdubmod that can do that).
-Packed bitstream OFF and encode directly to ogm (using a vdubmod that can do that).
-Packed bitstream ON and encode directly to matroska.
-Packed bitstream OFF and encode directly to matroska.

Tell us about the number of frames in each.

Do you have 'Closed GOV' on (as you should)?

mikeX
24th April 2004, 18:53
Undead, maybe this is your problem:
http://forum.doom9.org/showthread.php?threadid=73882&perpage=20&pagenumber=4

Andrey
24th April 2004, 20:36
>>I use 20 max B-frames. Usually, even with sensitivity 20 I don't get more than 3 B-frames in a row.
Confirmed :)
Personally, I use 4 max B frames when encoding to 1CD (and 5 - 6 for credits) and without tweaking B frame sensivity I saw 4 b frames in a row only once... (investigated this question for one movie)
So, usually, XviD select frame type rather wisely :D

TorgoGuy
25th April 2004, 19:26
Originally posted by Selur
and Audionut is right unless one boosts the sensitivity xvid shouldn't insert any 'stupid' b-frames. ;)
Well, to backup what I said here is a quote I just dug up from sysKin in the RC1 thread. Not too much (if anything) regarding frame type decisions has changed since then so it should still be relevant:
Originally posted by sysKin
The decision is smart but not smart enough, you sometimes have to prevent stupid decisions by setting max to 2.

BTW if you want to have more b-frames, use b-frame sensitivity in zone settings. Try 10 or 20 and you'll get more b-frames (great for end credits).
So my "stupid decision" comment is basically what sysKin said. Personally, I go with 3 max, but have been meaning to experiment with more.

Selur
26th April 2004, 08:15
experimenting is the point and since a lot of high_qaulity b-frames in a row provided me with good results I just wanted to mention it might be not such a bad idea for some others to test these settings. ;)

syskin refers here to the normal b-frame settings, personally I don't think the sttement is valid as soon as one changes the default b-frame sensitivity/boost/...

I think syskin just wants to share some experience that he gathered, which settings work fine, but he didn't want to say that other settings do not work fine. :)

Cu Selur

TorgoGuy
26th April 2004, 14:17
Originally posted by Selur
experimenting is the point and since a lot of high_qaulity b-frames in a row provided me with good results I just wanted to mention it might be not such a bad idea for some others to test these settings. ;)
Agreed. XviD's settings may be (appropriately) on the conservative side. The original question asked why one might *not* want to use higher settings, and I gave them sysKin's reason that the defaults are where they are at.

I haven't had any adverse effects with my slightly higher setting, and as I said, I've been meaning to experiment with even higher settings.

I don't anticipate major problems going higher, but sysKin points out that Xvid *can* make stupid decisions of when to use b-frames, I imagine that you should check your results when going higher (which obviously you've done).

Undead
26th April 2004, 21:01
@Crusty

I have done all the tests with avi, ogm & mkv, with & without packed bitstream. The sample was 585 frames. With ALL these settings the resulting video had 583 frames for both passes. Tests were done with max B-VOPS 20 & sensitivity 20.

File format & packed bitstream had obviously no impact, so I tried to change the sensitivity [this time only with avi].
With sensitivity 0 I got 584 frames.
With sensitivity 50 it was 581 frames.
I also tried a 2000-frame sample & got 1993 frames [b-sens. 20].

The drop varies with maximum being one less than the max B settings. The higher the sensitivity, the more frames MAY be dropped. In these tests it was not many, in films it is often 19 because of the credit settings [sometimes I use sensitivity 80].
Frames are dropped at the end, I checked that.

BTW, I do have 'Closed GOV' on [as your FAQ told me to =)].

So what do you think?


@mikeX

Well I had read that thread before. So the solution [or suggestion] was to use avs2avi instead of VDMod? Well as the drop is at the end of the movie I don't really mind, so I'll probably stick with VDMod which I know. Anyway, shouldn't VDMod be able to handle it somehow?


@all

As for B-settings, using high max settings is OK except the problem now discussed. I've had no problems with "stupid decisions" so far.
Different thing is the sensitivity. I think you shouldn't go much higher than 20 for movies. With 30-50 you may notice that the motion is kind of jumpy.

Pen-Pen
26th April 2004, 22:58
Originally posted by Undead
I use 20 max B-frames. Usually, even with sensitivity 20 I don't get more than 3 B-frames in a row. The reason I use 20 is that I want to allow the codec to use many B-frames for credit zones [or whatever zone I want to be highly compressed]. In credits I get more than 10 B-frames [with sensitivity around 50-80] and it's fine. But normally the codec doesn't use too many B-frames, so I think it's OK.


I never thought that way... Maybe a more "proper" approach would be to encode the movie and the credits separately ;) So you would be *sure* that :
1. your movie is clean as it's meant to be
2. your credits are crap (as they're too meant to be ^^)

I (personaly) go for:

* Movie : I/P : Q2 - B :*1.5+1.0 / sensitivity 0 - (when it fits on 1cd) or a bit less with 2 pass
* Credits : Fixed I/P : Q20 - B :*1.5+1.0 / sensitivity 100 - with a dedicated zone

it works too :)

SeeMoreDigital
27th April 2004, 01:40
Originally posted by Pen-Pen
I never thought that way... Maybe a more "proper" approach would be to encode the movie and the credits separately ;) So you would be *sure* that :
1. your movie is clean as it's meant to be
2. your credits are crap (as they're too meant to be ^^) It also begs the question... why bother encoding the credits at all?

Cheers

Andrey
27th April 2004, 12:34
>>BTW, I do have 'Closed GOV' on [as your FAQ told me to =)].
That is not neccessary if you are not planing edit it afterwards.
So, for example, for 1CD encode you can save some space by not selecting this...

mikeX
27th April 2004, 13:25
With max 20/sens 20 I've seen even 10 b-frames in a row, so I guess it depends on the source, etc...

Jerky video makes sense when too many b-frames in a row come into play, an average system can only decode that many frames ahead...

Undead:
Well from what I understand the problem is in the way VirtualDub(Mod) hacks around the whole 'b-frames into avi' issue: It was originally designed to hack around DivX b-frames (which uses max 1 b-frame), then extended (?) to handle the same for XviD, but it's NOT YET capable of hacking around XviD's multiple b-frames in a row.
I may be wrong(/inaccurate) though.

sysKin
27th April 2004, 13:32
Originally posted by Andrey
>>BTW, I do have 'Closed GOV' on [as your FAQ told me to =)].
That is not neccessary if you are not planing edit it afterwards.
So, for example, for 1CD encode you can save some space by not selecting this... No, closed GOV improves compression.

Radek

Andrey
27th April 2004, 16:30
>>No, closed GOV improves compression.
Hmm ?
Closed group of picture means that B frame must be predicted from P, not I frame, right ?
So, usually it's effect is that it changes last B frame to P to have a closed GOV ?
Am I right ?