PDA

View Full Version : B-Frame Setting for XviD


ookzDVD
11th November 2002, 05:23
@Forum,

I think it's time to use B-Frame, since the result is good
and increase a lots of the compressibility ;) (no QPel and no GMC, just B-Frame).

SO, ne1 would share your experience about B-Frame setting,
someone suggest max:2/200%, 3/150%, and 4/200%, which one is "save" ?

Thank you. :)

kastro68
11th November 2002, 08:09
Depends on length of movie. max of 5bf @200% for 3 hour movie to 1cd is pretty good.

You might also want to try fewer B-frames but higher B-frame compresion. Or more B-frames but lower bf compression.

Acaila
11th November 2002, 08:37
From my tests I have seen that anything over 3 B-frames results in no extra compression, well negligible anyway. And anything over 200% ratio starts to look ugly, which is to be expected I guess. But also I have found that the effect of B-frames on compression is different for every source, so the best thing would be to test a movie with several settings before making the final encode (if you have the patience that is :)).

UGAthecat
12th November 2002, 02:43
is it possible to use no b-frames in the first pass, then b-frames in a second pass?
if not, would everyone agree this would be a nice feature to request (if not too dificult) as this would make it a lot easer to que up a first pass, then a second pass without bframes, then a second second pass using b-frames. This way you get 2 'final' encodes and you can just directly compare the quality, and don't have to waste time doing the 1st pass twice (3 encodes instead of 4 for 2 final videos).

Koepi
12th November 2002, 10:23
UGA,

you misunderstood the principles of 2pass encoding with asking this.

Start over with a google-search on "2 pass encoding", maybe you find some papers that deal with that.

Koepi

kilg0r3
12th November 2002, 10:24
@Acaila

Have you found any correlation regarding the effectiveness of b-frames for different types of films?

sierrafoxtrot
12th November 2002, 10:38
tried encoding the contender (2h00m) a fairly long movie for 1CD using b-frames. the avs script used was

LoadPlugin("C:\DivX\YV12\MPEG2DEC3.dll")
mpeg2source("F:\DivxVOBS\The Contender.d2v")
Crop(12,18,-12,-18)
BicubicResize(576,320,0.3333,0.3333)

there's not a whole lot of motion so i tried:

b-frames 2-125
b-frames 3-150
b-frames 4-200

i found that (compared with a seperate encode without bframes) b-frames 3-150 gave the best results and i got lots of large I-frames followed by much smaller p- and b-frames. 4-200 looked okay, but the b-frames looked a bit ugly ...

the visual result was really pleasing ... i'm going to try and get my matrix R2 back off my mate and have a go with that as a reference for hi motion/complexity.

rgds

sF

Acaila
12th November 2002, 10:55
@kilg0r3:

No correlation so far, just that they're different.

cult
12th November 2002, 13:04
stupid question alert
I installed the new koepis build 9/11.new vdmod for yv12,avisynth aplha 2.5.Everything ready for yv12.Run 2-pass with bframes 3/150 and chroma motion and c3d(preset movieHQ).The result was good.Compared with same 2pass encode with koepis last stable build.I noticed some details were missing.So I took out c3d.As long as I can see with bframes I can go easily to 50 with compcheck when checked with gknot for 3.11,and the result is good.My question is:Is it safe?I used to go for 70.Does chroma motion works like an internal noise remover?How can I do a comp check for xvid with these features?(bframes and the rest)
tia

Dark-Cracker
12th November 2002, 14:09
hi,

normaly in a compressibility check u don't need to use bframe or qpel (normaly during the divx5 compressibility test, Gknot desactive the divx5 pro option) because in a compressibility test the bframes will not be distributed like in the movie and this risk to disturb and false the result of the comp test. it's my opinion but perhaps i am wrong.

Didée
12th November 2002, 16:45
Dark-Cracker,

if you take it down to the letter, you can't use B-frames for 2-pass-encoding at all ;) Because the distribution of B's in the 2nd pass is different from the distribution in the 1st pass.

For a comp-check, it doesn't *really* matter if you use B-frames, or not.
It only depends on what %age you get the quality that satisfies you. If this is 50% (comp-check w/o B's) or 70% (comp-check w/ B's) or whatever - it all depends.
But, after all, every movie "reacts" different on B-frames (low-or-high-motion, noise, and all that stuff). Therefore, if I'm going to use B-frames in the final encoding, I would settle down to use B-frames in the comp-check also. This way, I may get a much better idea on what will happen.

Regards

Didée


[edit]

Sidenote: I always had some difficulties in Gknot's standard settings for the comp-check. With a snipsize of 16 (or what is it actual?), my comp-check gets waaayyyy too much I-frames, and so the percentage in the end is to take with care.
But again, there are no "rights" or "wrongs"... one gets simply used to some range of numbers by experience, and that's it.

Dark-Cracker
12th November 2002, 17:57
@ Didée

i know it's was more logical to think u need use bframe for compressibility check because u will use it on the full encoding, but keyframe and bframes use more space (=> and more bitrate) and they will not be redistribued in the compressibility test like in the full movie. (try to make a little .log with the divx5 and u will see the frame intra=1 (KF) intra=2(BF) are around 2X bigger tjan a normal frame.).

actually Gknot don't activate the Bframe in the compressibility test (i don't have see some intra=2 in the log file) and use a snipe size of 14. (and Gknot 0.21 use sipsize 13) .
the compressibility test will only give u a %age general of the compressibility of the movie , not a %age of the compressibility of the movie using a specified codec.)

i think it perhaps time to make some tests to find a better way to make a compressibilty test.

Alestrix
13th November 2002, 00:55
Originally posted by sierrafoxtrot
tried encoding the contender (2h00m) a fairly long movie for 1CD using b-frames.
I hope this is not a stupid question, but how do you get the right filesize when using b-frames? 'cause unless I missed something important about b-frames in this forum (and I read here very regularly), two-pass and b-frames don't work correctly together, yet, so filesize prediction won't work either...

Hope I won't get ticked for this... :)

- aL

sierrafoxtrot
13th November 2002, 02:28
@alestrix

i think the b-frame filesize issue has been resolved for quite a while. i haven't had any unpredictability, but then again, the compressibility i'm going for is normally between 40-70%, so i'm not maxing out the codec. not sure what'll happen if i lower the resolution ... but so far so good.

Koepi
13th November 2002, 02:53
The filesize wasn't the problem.
It's the quantization/curve compression.

As long as it isn't bframe aware it'll produce really bad encodings (compared to: with bframe-awareness).

Koepi

UGAthecat
13th November 2002, 03:32
Originally posted by Koepi
UGA,

you misunderstood the principles of 2pass encoding with asking this.

Koepi
Actually, I thoroughly understand the principles of 2pass encoding.
The problem is that I think I rambled where I should have been more clear.
Originally posted by UGAthecat

3 encodes instead of 4 for 2 final videos

This is probably the part that caused the confusion, I guess you thought I meant using the first pass of one video to do 2nd pass for 2 different videos, which isn't what I mean. If you read the entire post and not just that last line, you would probably be much less confused about what I said. anyway...

I'm really just talking about reusing the stats file to redo the 2nd pass, but with different settings in the encoder (in this case changing b-frames options)
basically making 3+ 'passes' (actually jobs) for the SAME video to generate 2+ copies of the SAME video.
This is something I have done dozens of times when testing Divx5 to compare videos with a feature enabled, or disabled. It saves tons of time because you re-use your 1st pass instead of having to redo it, and you get a better idea of how the feature will affect your final encode. All you have to do is give every file after the second job a different file name so that you don't overwrite anything.
Because there are certain settings that if changed in divx 5 would break one thing or another if changed between jobs, I wanted to know if anyone knows if this can be done in xvid, or if it would just give broken encodes if you change bframe options between jobs.
I will be able to answer my own question in a couple of days, I just figured I'd ask if anyone already knew if it could be done successfully.
If anyone would like to do this but needs a more clear explaination on how to do it, I'd be glad to give one, and I'll even be able to keep it short and detailed.

ookzDVD
13th November 2002, 04:00
@sierrafoxtrot,

Thank you for your test.

Btw, it will better if you note the first pass size of the each
b-frame setting in your test, imho.

But it's ok, I really apreciate that.

ffroms
15th November 2002, 17:22
Hi to all!
Here some of my thoughts/tests. I've used Koepi build 141102-1 .
For 2CD movie B-frame is better to set to 2B 125% for high action movie and 150%(or more) for low action moive. For 1CD and movie 120min+ use 4B 200% or 120min- use 4B 150%.
4B 200% is very strong settings so you'll get to much blocknes. I've just made 2CD rip of stargate movie with 4B 200% and there is to much blocks in action part.
I didn't use Q-Pel or GMC.

Koepi
15th November 2002, 18:29
UGA,

everything that changes compressability of a movie (different filter settings, different bframe-settings) require a complete first pass.

Koepi

iago
15th November 2002, 20:59
@ffroms

I'd actually prefer not to use b-frames at all for a 2CD rip, unless the source is extremely incompressible.

However, I agree that it's greatly useful for 1CD encodes, though we still don't have (but I'm sure we'll have that soon too ;)) a proper two-pass treatment with b-frames.

regards,
iago

ffroms
16th November 2002, 10:40
@iago
I had no problems with 4B 200%(1st and 2nd pass) but didn't try to mix it with sound. I did it in YV12 with new alpha AVISynth. I agree with you not to use B frame for 2CD or use it only when compressiblity is low.

ookzDVD
16th November 2002, 11:22
@iago & ffroms,

I prefer to use the B-Frame if:
the desired size / the 1-pass size (No B-Frame) is below the 0.4 :)