Log in

View Full Version : H.264 Level 5.1


PuzZLeR
1st May 2007, 00:03
I have noticed that the default level that x264 encodes in the Main profile is level 5.1.

Why is that?

Isn't level 5.1 supposed to be for some advanced HD format? Even BD/HD-DvD supposedly only accepts up to level 4.1. Nero Digital only encodes to level 3.0 with Main and High profiles.

Maybe I don't understand what level and profile have in relation to each other, if such a relationship exists. There is so little info on this.

Anyhow, if I were to input level 4.1 with the x264 command "level=41", would it change anything or am I really wasting my time? What would the difference be anyway?

(I'm asking because some of the AVC playback hardware that is due out in a few months only accepts H.264 up till level 4.0/4.1.)

Thanks in advance for any feedback, comments or suggestions.

SealTooGreat
1st May 2007, 00:26
... and multiplexing with mp4/mbox you're getting more incompatibility (i.e. Nero ShowTime can't swallow mp4/mp4box)

akupenguin
1st May 2007, 00:28
ASP has an "unrestricted" level. H.264 doesn't, so I had to just pick the highest level instead.

Setting the x264 option "level=41" doesn't affect the encode at all, it simply sets one field in the header informing the decoder that this stream complies with level 4.1. And it's up to you to make sure that it actually does comply. x264 will warn (but encode anyway) about some (but not all) options that violate the level constraint.

You might ask, "why doesn't x264 automatically pick the smallest level that's compliant with the given input stream and settings?" And the answer is: because many encodes (especially those aimed at PC playback) don't use VBV constraints, and without that x264 has no idea in advance which level it will require.
You might ask, "why does it only warn?" And the answer is: because you might want to encode a 8000x4000 resolution (yes, someone really did ask me about doing that) which isn't compliant to any level, and who am I (or the H.264 standards writers) to stop you?

PuzZLeR
1st May 2007, 00:54
Thank you for the replies.

Akupenguin, if I may, I just have two questions:

1. Are there any particular settings that would violate this compliancy with 4.1 that I have to watch out for? I would really appreciate your thoughts on this.

2. Just for observation, are H.264 decoders backward compatible?
Examples (assuming compliancy):
A decoder accepting High automatically accepts Main/Baseline.
A decoder accepting Main automatically accepts Baseline.
A decoder accepting level x also accepts level y, where x>y.

Thanks again!

akupenguin
1st May 2007, 01:06
Are there any particular settings that would violate this compliancy with 4.1 that I have to watch out for?
Don't use p4x4 partitions with level >= 3. (This is one of the constraints x264 doesn't warn about.) (Strictly speaking p4x4 is allowed in the standard, but there's some restrictions on where it can be used, and x264 doesn't check those restrictions, so the only way to be sure is to disable p4x4.)
There are other ways in which x264 doesn't guarantee levels compliance, but no options will fix them.

A decoder accepting High automatically accepts Main.
yes
A decoder accepting High automatically accepts Baseline.
A decoder accepting Main automatically accepts Baseline.
no. Although in practice, no one uses the Baseline features that aren't also in Main. And no one uses Extended at all, so its relation to Baseline and Main doesn't really matter, but again it's not a strict subset or superset of either.
A decoder accepting level x also accepts level y, where x>y.
no. The numeric constraints (bitrate, resolution, etc) are strictly increasing with level number, but the boolean constraints aren't.
e.g. levels 2.1 - 4.1 can be interlaced, but levels 1 - 2 and 4.2 - 5.1 can't.

SealTooGreat
1st May 2007, 01:48
ASP has an "unrestricted" level. H.264 doesn't, so I had to just pick the highest level instead.

What is "unrestricted" used for In MeGUI?

Setting the x264 option "level=41" doesn't affect the encode at all, it simply sets one field in the header informing the decoder that this stream complies with level 4.1. And it's up to you to make sure that it actually does comply. x264 will warn (but encode anyway) about some (but not all) options that violate the level constraint.

Most of people don't have a clue how to adjust options to achieve 4.1 level. Is it so hard to restrict options for specific level, or is this a job for MeGUI (or other h264 gui) developers? It has to be some order, otherwise levels shouldn't exist.

You might ask, "why does it only warn?" And the answer is: because you might want to encode a 8000x4000 resolution (yes, someone really did ask me about doing that) which isn't compliant to any level, and who am I (or the H.264 standards writers) to stop you?
You're AKUPENGUIN :D, and you should block further encoder operation or give him a BIG FAT WARNING to change level to "unrestricted" or that encoder will modify h264 options for previously setted level.

Theliel
1st May 2007, 02:26
What is "unrestricted" used for In MeGUI?

I didnt know that in ASP existed a unrestricted profile. Anyway, in h264 dont exist. Megui is only a GUI for h264 and implement inside profiles and levels. In CLI x264 version you must to know profiles and level restriction if you want force a determinate level, so the job is for Megui or for you:

http://en.wikipedia.org/wiki/H264

PuzZLeR
1st May 2007, 14:09
I thank you all for the feedback.

I don’t mean to pester the forum with a question that would be more of a “definition” type of answer. Unfortunately, other than a limited intro on Wikipedia, there really isn’t much info on this. Yes, there are a few dissertations floating around, however my grad school days are long over, and another thesis isn’t going to sink in today.:confused:

Anyhow, having said that, I’ve uploaded a small sample clip with settings that should be compliant with 4.1. I’m just wondering if any gurus in this forum can maybe confirm its compliancy (if possible). It’s not like I can change the level after it’s encoded, so I’m hoping someone out there can let me know if I’m on track.

http://www.mediafire.com/?bwhoiyemn0y

I get the impression that the main difference between 4.1 and 5.1 would be max bitrate/rez, etc. Hopefully I didn't alter any other flags that would violate compliancy.

:thanks: in advance!

Theliel
1st May 2007, 20:14
If wiki are insufficient for you, you always can read h264/AVC specification.

http://www.itu.int/rec/T-REC-H.264-200503-I/en

;)

anyway, your upload video are 4.1 compliancy.