View Full Version : B-frames use are becoming confusing to me!
dihelson
19th May 2003, 14:19
Hello, Friends,
After seeing so many threads about B-frames, I'm getting more and more confused about it's use.
Since I just use ONLY 2 to 3 CDs for my Xvid projects, I really would like some advice on what configuration for B-frames fits best on 2 to 3 CDs.
My actual B-frames settings are so:
3, 100, 200, 0
Some people recommend 2, 150, 100, 255 (But I read that for 2 CDs, it's better a threshold not to be 255)
I don't know if this is good or bad. My films are good, but if I can improve it turning them more sharp, less blocky, more color bright with some other settings recommendations, I would really appreciate.
Thank you so much.
Dihelson
Personally I usually use 2/150/100/0 (which is default I think), sometimes if I want some more compresability I do something like 2/150/100/10-20. For normal movies I don't like to use 255 threshold because syskin mentioned in a thread that he tried to make it the most intelligent around 0. A threshold at 255 makes it "non-intelligent" as far as I've understood.
If I (like you) was in the habit of using 2 or 3 CDs I'd probably use something like 2/~130/~50/0. This should give a nice number of B-frames at a bit lower quant than default settings.
This is just what I'd probably do, I can make no guarante it will work well for you.
Acaila
19th May 2003, 15:22
The only movie that I put on 2 CD's that I felt required B-frames was LotR, and that's a 3+ hour movie. In other words, if you're targetting for 2-3 CD's it is my opinion that you shouldn't use B-frames at all.
B-frames are a way to get higher compressibility (higher quality in low filesize) which you don't need for such a high filesize as 2-3 CD's will give you.
But when I do use B-frames I use either 1/150/100/0 or 2/150/100/0 depending on the amount of space reduction I need.
snowbeach
19th May 2003, 21:00
ok. let's sum up:
encode your movie or just a scene with following settings, regarding b-frames...
1. 1/150/100/0
2. 2/150/100/0 (I use it for 2 CD rips)
3. 2/130/50/0
and last but not least disable B-frames
4. -1/.../.../... (-1 disables B-frames, the rest is unimportant then)
decide, what looks for you best?
@Acaila
Wow. LOTR SpecialExtendedEdition I put on 4 CD's. But I think 2 will be nice too.
But what about movies like Forrest Gump, the well known Saving Private Ryan, etc., movies that last min 2h20min and are really hard to compress. will they look good on 1 CD? i never got a satisfying result! the picture quality was ok, when watching on TV. please share with us your secret settings... :D
Acaila
19th May 2003, 21:24
I didn't say I wouldn't put those kind of movies on 2 CD's, just that you don't always require B-frame to get great quality, even for 2 CD's. And I've never encoded SPR so...
Btw, LotR Extended I put on 2 800 MB CD's with the 2 channel AC3 track and B-frames 1/150/100/0. Looked perfect to me.
snowbeach
19th May 2003, 22:39
i will check it out. ;)
spyder
19th May 2003, 22:51
I made LOTR:Ext on 1 CD :)
It's alright... could be better but it is watchable ;)
I also have it on 3 CDs :)
Spyder
Sigmatador
20th May 2003, 02:08
"watchable" yeah :D
"I also have it on 3 CDs" --> me too ;)
sysKin
21st May 2003, 14:42
Originally posted by Acaila
In other words, if you're targetting for 2-3 CD's it is my opinion that you shouldn't use B-frames at all.
B-frames are a way to get higher compressibility (higher quality in low filesize) which you don't need for such a high filesize as 2-3 CD's will give you. Allow me to say that I have completely different opinion: Whenever you have bitrate or not, there is no reason to artificially decrease quality by not using bframes. If you have problems with actually filling the disks, you can always improve quality by increasing resolution, and if that's no longer possible - by using high-bitrate quant matrix.
I don't think you should be worried that the movie will be "too good" and kick it until it's just "enough".
Regards,
Radek
Acaila
21st May 2003, 18:50
OK, let me clarify why I wrote that. In my experience almost all the rips I make are of such quality that for normal viewing purposes I can't see any compression artifacts. Usually this means an average quant of < 2.80. Where 2.80 is about the threshold of where visible compression artifacts start appearing for me (that's just personal, everyone has a different threshold).
Now without B-frames the quality will look like this (very very simplified):
quality threshold: --------------------------------------------
video quality: --------| |---------| |--------
|---| |---|
Here all frames fall below the artifact threshold thus giving a great quality overal.
Adding B-frames this would become:
|-------| |----------|
quality threshold: -------------|-------|------|----------|----
| | | |
| | | |
video quality: -----| | | | |
|------| |------| |-----
The P-frames will become higher quality (=lower) while the B-frames become lower quality (=higher). So while the P-frames will drop far below the artifact threshold (=great quality) the B-frames will exceed this threshold and visible artifacts will appear. Although the average quality might be better I don't want to run the risk of frames appearing with artifacts when the original version (without B-frames) was good enough already.
This is a very simplified story though, but the moral of this story is, don't fix something if it ain't broken.
There are some videos where I agree that the benefit of B-frames outweigh the side effects, but in general I don't believe B-frames are needed to get a high quality encode (we've done without them just fine for years). They're nice as an option, just don't use them by default. But anyway, that's just my opinion though, you can agree or disagree.
B-Frames ratio is there because B-frames at higher quant than P-frames look the same as those P-frames (more motion data, less compensation data). So you nice little theory doesn't work in practice :).
Some questions and thoughts to everyone:
1) Could PSNR tests change your mind about b-frames?
I ask this because SysKin has created this threshold for some reason. Yet Koepi uses threshold 255 (which was the old method) and everyone thought it was great. I personally have no problem with it. Can we have some measurement more objective than our own eyes? :rolleyes:
2) Do you trust PSNR tests?
3) Since B-frames are based in I and P frames, and P frames can get better if we use B-frames, wouldn't in theory B-frames allow more compression and still look better than just using P-frames?
Best regards,
Bilu
Originally posted by mf
So you nice little theory doesn't work in practice :).
Let's not make this a flamewar... please? ;)
Bilu
Acaila
21st May 2003, 19:42
@mf: you're correct in theory, that's why B-frames exist, however in practice I still find B-frames more blocky than P-frames and that's what I base my encoding methods on.
@Acaila
Can you actually notice the compression difference when using 1 B-frame?
Did you noticed it when watching the movie or frame-by-frame in Vdub?
B-frames are supposed to be more blocky but not actually noticed
:confused:
Bilu
Originally posted by bilu
Let's not make this a flamewar... please? ;)
Bilu
My wording was indeed a little teasing, but I do not intend to start a flamewar. :)
Asmodian
22nd May 2003, 20:37
I have definitely noticed B-frame compression artifacts even when max B-frames was set to 1 with a quant ratio of 200%. This is with anime (Cowboy Bebop) done at very high quality (average quant just under 3) and no post-processing for maximum sharpness. Every once in a while I could see little ‘blips’ on smooth backgrounds when actually watching the anime (almost like scratches on old film – a very lightly scratched old film). When paused they looked like blocks (not surprising). At much lower quant ratios the effects were less but still there and the average quants dropped by very little, relative to no B-frames (I re-encoded the first episode of cowboy bebop ~15 times).
This lead me to compress without B-frames when doing very high quality encodes, though with ‘real’ movies the negative effect of B-frames is very hard to notice, if possible at all. With anything destined for TV viewing B-frames are great.
This was ~5 months ago though so maybe B-frames have improved?
It allways seemed to me that the general opinion was that B-frames do look crappy on anime, but great on real movies. But I'm not the best to tell you that since I've never encoded anime in my life :)
Best regards,
Bilu
Defiler
22nd May 2003, 21:44
I suspect things have improved since then, because I just (the other day) encoded an Osamu Tezuka animated film using B-Frames 2/150/100/255, and it definitely improved the output. 90 minutes onto one CD, H.263, Trellis, Chroma Optimizer, etc.
My recent experiences with B-Frames have been much better than with earlier builds.
Originally posted by Asmodian
I have definitely noticed B-frame compression artifacts even when max B-frames was set to 1 with a quant ratio of 200%.
Sorry to say it this way; but DUH! Quant ratio of 200% will encode something that would normally be quant 2 at 4, and somehting thing that would be quant 4 at 8. That will cause artifacts yeah.
sh0dan
23rd May 2003, 13:14
B-frames are seldom good in anime, unless it is "fullframerate" material. The only cases where Bframes will help in anime is background pans and movements that are animated in post.
Therefore a very conservative B-frame setting should be used on such material, if any at all.
The reason for this is that B-frames are "interpolate always", so bframes are actually quite bad to describe no-movement. For example:
a sequence like:
P - B - P
where B is a duplicate of the first P, and the second P is a new frame. In this case B will be predicted to be something between the two P frames, which then has to be compensated at a lower quant, without any reason at all. The best solution here, both quality and bitwise would be for this sequence to be all P-frames.
sh0dan: this is what B-frame threshold is for. Still, B-Frames are great for noise on anime. I remember testing the first buggy B-frames in xvid (I was sysKin's personal bugtester ;)) and they actually worked great for detecting what was irrelevant (noise) and thus helped compression greatly on anime, without spoiling quality. This SHOULD still be true, afaik.
sysKin
24th May 2003, 15:30
Hi,
If anyone is interested, I made the following PSNR test today:
bframes 3/100/0/0 VS. bframes -1, all at fixed quant 3.
The b-frame file was smaller (by 3%) and had higher PSNR (by 0.3 dB). :D
So - if you're afraid that b-frames will have lower quality, use this setting :) B-frames will have higher quality than p-frames, while p-frames will have almost the same quality (almost == 2% more bitrate).
Nice, isn't it?
Radek
PS. Ah I just remembered, there was no VHQ for p-frames but there was VHQ for b-frames... but the test is not flawed too much
@sysKin
I remembered this tests for libavcodec:
http://rguyom.ath.cx/
And I wonder what would be the actual PSNR results for XVID using b-frames on anime. I don't do anime but I'm curious.
Bilu
sysKin
24th May 2003, 17:49
Originally posted by bilu
And I wonder what would be the actual PSNR results for XVID using b-frames on anime. I don't do anime but I'm curious. I actually don't believe in PSNR gain using B-frames. At same quant yes, but not at lower quants.
However, let's do it in this order: 1. I'll make VHQ for bframes working :) 2. I'll do some tests ^^ ok? :D
Sigmatador
24th May 2003, 19:04
Originally posted by sysKin
I'll make VHQ for bframes working :)
can't wait ^^
(and what about GMC+VHQ ?)
Originally posted by Sigmatador
(and what about GMC+VHQ ?)
First we'd need a GMC that improves things, which it doesn't in its current state. (That's what I heard from sysKin a few months ago)
Sigmatador
24th May 2003, 23:10
yes i heard this too, but there's a new 3points-gmc on the dev api-4 right ?
Originally posted by Sigmatador
yes i heard this too, but there's a new 3points-gmc on the dev api-4 right ?
Hmmm, haven't tested it yet.
sysKin
25th May 2003, 14:37
Originally posted by Sigmatador
yes i heard this too, but there's a new 3points-gmc on the dev api-4 right ? No, not yet. We're waiting :)
BoNz1
25th May 2003, 15:22
Originally posted by Sigmatador
(and what about GMC+VHQ ?)
I always thought that making GMC and VHQ work together might be somewhat fruitless. I remember someone saying I think on the xvid mailing list (although I can't find it now, I think it may have been one of the ffmpeg guys) that probably the reason why gmc was included in mpeg4 was to compensate for a bad ME, since VHQ does an additional search the idea was that it may be difficult to make the two work together with positive results. The ffmpeg guys basically said gmc wasn't needed if your ME is already really good. This is how I understood though so maybe I am wrong. But it would surprise me either if they got VHQ and GMC working together either with positive results, I certianly don't doubt them.
sysKin
25th May 2003, 17:07
Originally posted by BoNz1
[BI remember someone saying I think on the xvid mailing list (although I can't find it now, I think it may have been one of the ffmpeg guys) that probably the reason why gmc was included in mpeg4 was to compensate for a bad MEWasn't that "to compensate for a bad SKIP-mode"? 'Cause that would be true.
I'm reasonably sure that you're wrong. VHQ is not only an extra ME search, but also an advanced mode decision. As GMC is nothing more than additional macroblock mode, if it will work, it will only work with VHQ.
VHQ does not counter GMC in any case.
BoNz1
26th May 2003, 02:16
Originally posted by sysKin
Wasn't that "to compensate for a bad SKIP-mode"? 'Cause that would be true.
Ok, I probably am wrong but nevertheless, I will try to find it in the mailing list just to make sure, ;). Yup found it in the mailing list, http://list.xvid.org/pipermail/xvid-devel/2003-April/002768.html sorry about that I should have found it before I posted. You are right of course. And thanks for the explanation as well.
Lobuz
31st May 2003, 18:44
Originally posted by sysKin
I actually don't believe in PSNR gain using B-frames. At same quant yes, but not at lower quants.
However, let's do it in this order: 1. I'll make VHQ for bframes working :) 2. I'll do some tests ^^ ok? :D
Any progress with VHQ in B-frames? :rolleyes:
Regards
Lobuz
Originally posted by sysKin
I actually don't believe in PSNR gain using B-frames. At same quant yes, but not at lower quants.
However, let's do it in this order: 1. I'll make VHQ for bframes working :) 2. I'll do some tests ^^ ok? :D
Just to mention that on the libavcodec PSNR tests they had PSNR gain on normal movies and PSNR loss over anime. Do you think there is a reason for that, that could affect XVID also?
Bilu
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.