PDA

View Full Version : x264: How important are B-frames? (comparative examples)


nhope
23rd April 2008, 20:23
Take a look at this comparison of files encoded in x264 at 512x288, 400kbps.

With B frames (http://www.bubblevision.com/underwater-video/x264-512x288-400kbps-hybrid.htm)

Without B frames (http://www.bubblevision.com/underwater-video/x264-512x288-400kbps-no-b-frames.htm)

There are differences in the command line options used as explained on the pages. The most important difference (I assume) is that the 2nd example has no B-frames at all to allow it to playback on Sony Vegas.

I'm no encoding expert but I'm really struggling to see a difference in quality between the 2 videos, which makes me wonder how important B-frames are at all to the quality-vs-filesize.

Can anyone see a difference in quality between these two?

Would value any experienced advice on refining my command line while maintaining general computer playback compatibility.

Dark Shikari
23rd April 2008, 20:26
Demonstrating no difference in quality between two options does not mean that the option is useless; rather it means more likely you are using far too high a bitrate to visually see a difference between them.

The effectiveness of B-frames is extremely important; without them you might as well be using Xvid.

nhope
23rd April 2008, 20:50
Thanks. Well if I can match the quality of my old Xvid encodes using x264 then I'll be more than happy, but of course Xvid can't be delivered in Flash.

By the way if anyone is interested the source was HDV and this was the AVS:

AviSource("d:\fs.avi")
ConvertToYV12()
TDeint(order=1)
LanczosResize(512,288)

Dark Shikari
23rd April 2008, 20:56
Okay, I just looked at a few sample frames and the encode with B-frames looks drastically better.

nhope
23rd April 2008, 21:15
Oh OK. Seen that video so many times now at so many different settings that I can't trust my judgement on it any more. Thanks for taking a look.

nhope
23rd April 2008, 21:33
Another thing while I have your attention...

If an x264 file is encoded with no audio then I8x8 is OK but b-frames cause only the audio stream to open in Sony Vegas Pro and no video. However if it's encoded without audio then b-frames are OK but I8x8 causes the file to crash Vegas.

So how important is I8x8 to this sort of video? As important as b-frames?

(behind all this is whether to sacrifice Vegas compatibility for quality or not)

poisondeathray
23rd April 2008, 21:33
I'm with Dark S. on this one - Look at the detail differences in the coral

Cool videos by the way. I love underwater scenery

http://i30.tinypic.com/iymvsx.png

http://i25.tinypic.com/15yuhb7.png

Dark Shikari
23rd April 2008, 21:36
Another thing while I have your attention...

If an x264 file is encoded with no audio then I8x8 is OK but b-frames cause the file not to open in Vegas. However if it's encoded without audio then b-frames are OK but I8x8 causes the file to crash Vegas.

So how important is I8x8 to this sort of video? As important as b-frames?

(behind all this is whether or not to sacrifice Vegas compatibility for quality or not)Sounds like Vegas doesn't support High Profile, which is odd.

8x8dct + i8x8 gives a benefit less than B-frames but still considerable; 3-6% for lower res sources and much more of a visual boost for high-def and grainy sources.

SeeMoreDigital
23rd April 2008, 21:41
I've just played both samples in my hardware player and I agree, the encode with 3B-VOP's does look better in most scenes.

Personally, I would have generated the samples at a higher resolution (say 1024x576 or 720x576 with a PAR of 64:45) and with no more than 2B-VOP's.


Cheers

EDIT: Oh... and the 0B-VOP encode has a profile of "High@5.1" and not "High@3.1"

nhope
23rd April 2008, 22:47
Thanks for the feedback. I'm learning a lot here.

Personally, I would have generated the samples at a higher resolution (say 1024x576 or 720x576 with a PAR of 64:45) and with no more than 2B-VOP's.
I could have done that but I have thousands of these to encode for a stock footage website and download speed/bandwidth cost are very important. I wanted to judge them at the actual delivered size and (probable) bitrate.

EDIT: Oh... and the 0B-VOP encode has a profile of "High@5.1" and not "High@3.1"
I'm not quite sure what you're getting at. Is there a mistake/inconsistency in my command line?

poisondeathray
23rd April 2008, 23:08
Avinaptic reported a few other differences besides the AVC Level Profile; I think the deblocking difference could account for a big part of the visual sharpness.

B-frames
User data: ref=3
User data: deblock=1:-2:-1

vs

No B-frames
User data: ref=5
User data: deblock=1:0:0

nhope
23rd April 2008, 23:17
OK. Some of those differences came from the fact that they were originally based on different MeGUI profiles. The B-frames one originated in DXVA-SD-HQ while the non-B-frames one originated in CE-Quicktime.

Really I'm looking for a profile that gives the highest quality while still allowing the file to play smoothly in WMP, Quicktime, VLC, Final Cut Pro, Premiere Pro etc.. I think I will ignore the Vegas incompatibility for now. Quicktime is an important one for me and it does have trouble with b-pyramid, which is why that is in neither.

poisondeathray
23rd April 2008, 23:29
I'm just pointing out that the differences in your sample are probably more from the deblocking settings, rather than b-frame settings.

"Highest quality" is going to be very subjective. I prefer sharper images, others prefer smoother images. You can't satisfy everyone. I think Sharktooth's profiles are set at -2,-1 when you download them.

I would just use the QT profile for maximum compatibility.

SeeMoreDigital
24th April 2008, 10:01
I would just use the QT profile for maximum compatibility.If you require smooth playback in QuickTime player, then you are limited to generating AVC encodes with just 1B-VOP!

Shinigami-Sama
24th April 2008, 10:25
If you require smooth playback in QuickTime player, then you are limited to not useing QT player
fixed

I have *never* gotten any smooth playback on QT since the '90s when pretty much everything was horrible and buggy...

nhope
24th April 2008, 10:38
If you require smooth playback in QuickTime player, then you are limited to generating AVC encodes with just 1B-VOP!

So I've read but the first of my 2 examples has 3 B-frames and plays fine in Quicktime Player 7.4.1 on my 3 XP machines. Do you mean on older hardware?

I do know that B-pyramid screws up Quicktime playback on these machines.

SeeMoreDigital
24th April 2008, 15:37
Really..... With your 3B-VOP encode I see this: -

http://i31.tinypic.com/20hsmll.png


Cheers

nhope
24th April 2008, 15:56
haha, actually that's quite arty. May I use it as my avatar? :)

thanks for putting me straight

I've decided to use the CE-Quicktime profile where I want to give a download link as well as Flash and I really want it to work on the majority of players and NLEs (e.g. for my stock footage previews)

Where I'm not providing a download link (only Flash) or where it's not so essential that it's so compatible I think I'm going to stick with that hybrid profile from my first example and accept that Sony Vegas, Premiere Pro, Edius and in some cases Quicktime etc. won't play it.

Shinigami-Sama
24th April 2008, 21:38
haha, actually that's quite arty. May I use it as my avatar? :)

thanks for putting me straight

I've decided to use the CE-Quicktime profile where I want to give a download link as well as Flash and I really want it to work on the majority of players and NLEs (e.g. for my stock footage previews)

Where I'm not providing a download link (only Flash) or where it's not so essential that it's so compatible I think I'm going to stick with that hybrid profile from my first example and accept that Sony Vegas, Premiere Pro, Edius and in some cases Quicktime etc. won't play it.
should put a warning about the files telling them this too; and instructing them to complain to their NLE maker for not fully supporting the specs!