How do I set strict Pyramidal B-Frames in the option string?

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
L255J
Novice
Posts: 63
Joined: Sun Feb 10, 2008 10:25 pm

How do I set strict Pyramidal B-Frames in the option string?

Post by L255J »

When I select Pyramidal B-Frames in Handbrake, it becomes "b-pyramid=1" in the advanced option string.
Dark Shikari, when he made B-Pyramid spec-compliant, said that...

Code: Select all

Two modes are now available:
1) strict b-pyramid, while worse for compression, follows the rule mandated by Blu-ray (no P-frames can reference B-frames)
2) normal b-pyramid, which is like the old mode except fully compliant.
So does that mean when I select Pyramidal B-Frames in Handbrake, that "b-pyramid=1" is strict mode Dark Shikari was talking about?
Deleted User 11865

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by Deleted User 11865 »

Right now, HandBrake parses the x264 options and when it finds "b-pyramid=1", changes it to "b-pyramid=normal" before sending to libx264 (that was done as a quick way to support normal b-pyramid without changing the interface).

To select b-pyramid strict, just add "b-pyramid=strict" to the x264 options string.
L255J
Novice
Posts: 63
Joined: Sun Feb 10, 2008 10:25 pm

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by L255J »

Thank you so much!
k209
Posts: 14
Joined: Mon Dec 14, 2009 6:48 pm

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by k209 »

Hi,

I was under the impression that b-pyramid wasn't functional in 0.9.4 because of compatibility issues with MB-tree, which provided more quality/size ratio.

http://forum.handbrake.fr/viewtopic.php ... 06&start=0
Deleted User 11865

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by Deleted User 11865 »

k209 wrote:Hi,

I was under the impression that b-pyramid wasn't functional in 0.9.4 because of compatibility issues with MB-tree, which provided more quality/size ratio.

http://forum.handbrake.fr/viewtopic.php ... 06&start=0
The latest svn3036 snapshot now supports mbtree + b-ypramid.
k209
Posts: 14
Joined: Mon Dec 14, 2009 6:48 pm

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by k209 »

Thank you Rodeao,

Is svn3036 the lastest HandBrake or a alpha/beta release of HandBrake 0.9.5 ?

I'm using 0.9.4 (2009112300) - MinGW i386.

Wonder where I can find svn3036.

Regards,
Deleted User 11865

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by Deleted User 11865 »

There's an announcement at the top of the General subforum.
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by TedJ »

k209 wrote:Is svn3036 the lastest HandBrake or a alpha/beta release of HandBrake 0.9.5 ?
Technically, it's neither. ;)

It was noticed shortly after the 0.9.4 release that there were several issues affecting stability and performance, particularly under Windows. As such, a post 0.9.4 release snapshot was issued to address these issues. Usually snapshots aren't issued until the developers are preparing for the next stable release, so the new code can be more widely tested.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by jbrjake »

TedJ wrote:Technically, it's neither. ;)

It was noticed shortly after the 0.9.4 release that there were several issues affecting stability and performance, particularly under Windows. As such, a post 0.9.4 release snapshot was issued to address these issues. Usually snapshots aren't issued until the developers are preparing for the next stable release, so the new code can be more widely tested.
Actually, no.

It was to get the new folder scanning and FIFO code and ffmpeg build tested, and because we're trying to do more regular releases. It is indeed part of the lead-up to a stable release, not a bug-fix sop to the masses.
k209
Posts: 14
Joined: Mon Dec 14, 2009 6:48 pm

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by k209 »

Finally I'll get my hand on b-pyramid for my tests :mrgreen: ....... will report back any bug
plazapalz
Posts: 13
Joined: Tue Dec 30, 2008 5:57 am

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by plazapalz »

What is the deal with b-pyramid? I have been searching and searching for an explanation to my observation that when using b-pyramid=strict it decreases the ref frame count by one (at least as mediainfo sees it). Here is an example:

Test 1 (B Pyramid checked)

Code: Select all

Complete name : C:\Users\plaza\Desktop\South Park Pyramid.mkv 
Format : Matroska 
File size : 22.2 MiB 
Duration : 59s 977ms 
Overall bit rate : 3 107 Kbps 
Writing application : HandBrake svn3036 

Video 
ID : 1 
Format : AVC 
Format/Info : Advanced Video Codec 
Format profile : High@L4.0 
Format settings, CABAC : Yes 
Format settings, ReFrames : 4 frames 
Muxing mode : Container profile=Unknown@4.0 
Codec ID : V_MPEG4/ISO/AVC 
Duration : 59s 917ms 
Width : 1 920 pixels 
Height : 1 080 pixels 
Display aspect ratio : 16:9 
Frame rate : 23.976 fps 
Resolution : 8 bits 
Colorimetry : 4:2:0 
Scan type : Progressive 
Writing library : x264 core 80 
Encoding settings : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=9 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=64 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / mbaff=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / wpredp=2 / keyint=240 / keyint_min=24 / scenecut=40 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 
Color primaries : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177 
Transfer characteristics : BT.709-5, BT.1361 
Matrix coefficients : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177 

Audio #1 
ID : 2 
Format : AAC 
Format/Info : Advanced Audio Codec 
Format version : Version 4 
Format profile : LC 
Format settings, SBR : No 
Codec ID : A_AAC 
Duration : 59s 977ms 
Channel(s) : 2 channels 
Channel positions : L R 
Sampling rate : 48.0 KHz 
Language : English 

Audio #2 
ID : 3 
Format : AC-3 
Format/Info : Audio Coding 3 
Codec ID : A_AC3 
Duration : 59s 977ms 
Bit rate mode : Constant 
Bit rate : 640 Kbps 
Channel(s) : 6 channels 
Channel positions : Front: L C R, Surround: L R, LFE 
Sampling rate : 48.0 KHz 
Stream size : 4.58 MiB (21%) 
Language : English 

Menu 
00:00:00.000 : Chapter 1 
Test 2 (b-pyramid=strict added to string)

Code: Select all

General 
Complete name : C:\Users\plaza\Desktop\South Park Strict.mkv 
Format : Matroska 
File size : 22.3 MiB 
Duration : 59s 977ms 
Overall bit rate : 3 123 Kbps 
Writing application : HandBrake svn3036 

Video 
ID : 1 
Format : AVC 
Format/Info : Advanced Video Codec 
Format profile : High@L4.0 
Format settings, CABAC : Yes 
Format settings, ReFrames : 3 frames 
Muxing mode : Container profile=Unknown@4.0 
Codec ID : V_MPEG4/ISO/AVC 
Duration : 59s 917ms 
Width : 1 920 pixels 
Height : 1 080 pixels 
Display aspect ratio : 16:9 
Frame rate : 23.976 fps 
Resolution : 8 bits 
Colorimetry : 4:2:0 
Scan type : Progressive 
Writing library : x264 core 80 
Encoding settings : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=9 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=64 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / mbaff=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / wpredp=2 / keyint=240 / keyint_min=24 / scenecut=40 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 
Color primaries : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177 
Transfer characteristics : BT.709-5, BT.1361 
Matrix coefficients : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177 

Audio #1 
ID : 2 
Format : AAC 
Format/Info : Advanced Audio Codec 
Format version : Version 4 
Format profile : LC 
Format settings, SBR : No 
Codec ID : A_AAC 
Duration : 59s 977ms 
Channel(s) : 2 channels 
Channel positions : L R 
Sampling rate : 48.0 KHz 
Language : English 

Audio #2 
ID : 3 
Format : AC-3 
Format/Info : Audio Coding 3 
Codec ID : A_AC3 
Duration : 59s 977ms 
Bit rate mode : Constant 
Bit rate : 640 Kbps 
Channel(s) : 6 channels 
Channel positions : Front: L C R, Surround: L R, LFE 
Sampling rate : 48.0 KHz 
Stream size : 4.58 MiB (20%) 
Language : English 

Menu 
00:00:00.000 : Chapter 1 
Media info tells me that I only have 3 ref frames in the second test even though it later shows my encoding parameters (ref=4). Is this significant? Does this mean I can add a reference frame and still keep level 4.1 compatibility? The closest thing I got to an answer is http://doom10.org/index.php?topic=69.0 but I'm still a little confused. It seems like he is saying that there are indeed 4 ref frames in my second test but does not explain any further. Am I losing a reference frame or not? Why?

P.S. This question was conceived from my desire to create what I believe to be dxva level 4.1 compliant videos. I satisfied myself that this would be the best way to "future proof" my mkvs (I figured I could simply repackage them to m4v or any other format needed in the future without re-ripping my blu-collection). I am beginning to not care as much anymore but would still be interested in knowing what b-pyramid is actually doing. Thank you for any help and you guys are amazing! Also these videos were simply previews in handbrake which is why I don't have handbrake logs. I could do some individual chapter encodes if that is necessary.
mduell
Veteran User
Posts: 8198
Joined: Sat Apr 21, 2007 8:54 pm

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by mduell »

The future proof solution is to keep the raw rips. Disk is cheap.
plazapalz
Posts: 13
Joined: Tue Dec 30, 2008 5:57 am

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by plazapalz »

That's true but my blu Ray discs aren't going anywhere :D
plazapalz
Posts: 13
Joined: Tue Dec 30, 2008 5:57 am

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by plazapalz »

So is the b-pyramid=strict reducing the reference frames by one or is the b-pyramid=normal technically adding an "invisible" reference frame?
plazapalz
Posts: 13
Joined: Tue Dec 30, 2008 5:57 am

Re: How do I set strict Pyramidal B-Frames in the option string?

Post by plazapalz »

Or is it neither? I just want to know if I use the max amount of ref frames (say 4 for a 1920x1080 movie), will adding b-pyramid change that (the ref #) in some way? For example will it break level 4.1 compatibility? My videos with normal b-pyramid show no change but the ones with b-pyramid strict having one less ref frame then I specified is so confusing to me.
Post Reply