Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th February 2021, 20:38   #1  |  Link
YaBoyShredderson
Registered User
 
Join Date: Jul 2020
Posts: 72
X265 high vs main tier??

In x264/H.264(AVC) high offers better quality than main, as far as i know anyway. Is the same true for x265? I ask as in staxrip i have to select an encoder level to use the high tier of that level. Selecting level 4 still uses main though? Im thinking at this point that its only a tag, like level, and doesnt actually affect quality as long i stay in range of the level/tier? Like it will only increase quality if i exceed the maximum bitrate of, say, level 4 main, and cross into level 4 high? I dont know if i explained that right but anyway. Is high tier better than main in x265?
YaBoyShredderson is offline   Reply With Quote
Old 7th February 2021, 10:25   #2  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 95
H.264 has a High Profile which allows the use of additional coding tools like 8x8 transform. This increases Quality/Rate most of the time.

H.265 has a High Tier for Levels which potentially requires additional decoder resources and speed but has no effect on the selected Profile which specifies the available coding tools.

So if you do not hit Level Limits with H.265 there is no impact to Quality. Or you can constrain your streams to a specific Level to target a specific Decoder Class which is recommended for playback compatibility.
rwill is offline   Reply With Quote
Old 7th February 2021, 13:08   #3  |  Link
YaBoyShredderson
Registered User
 
Join Date: Jul 2020
Posts: 72
Quote:
Originally Posted by rwill View Post
H.264 has a High Profile which allows the use of additional coding tools like 8x8 transform. This increases Quality/Rate most of the time.

H.265 has a High Tier for Levels which potentially requires additional decoder resources and speed but has no effect on the selected Profile which specifies the available coding tools.

So if you do not hit Level Limits with H.265 there is no impact to Quality. Or you can constrain your streams to a specific Level to target a specific Decoder Class which is recommended for playback compatibility.
So i can leave the level on automatic and dont have to worry about quality? I believe everything i encode will be within level 4 anyway, so selecting level 4 high wont make any difference?
YaBoyShredderson is offline   Reply With Quote
Old 7th February 2021, 13:26   #4  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 95
Well maybe you should not let the encoder automatically decide the level but set a hard cap yourself.

You can always download the h.265 spec from here:
https://www.itu.int/rec/T-REC-H.265-201911-I
and check the level limits for a certain level. Then configure all relevant parameters of your encoder to match a specific level and set that level at the encoder so no magic things that are not wanted happen.
rwill is offline   Reply With Quote
Old 7th February 2021, 23:39   #5  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,981
Quote:
Originally Posted by rwill View Post
Well maybe you should not let the encoder automatically decide the level but set a hard cap yourself.

You can always download the h.265 spec from here:
https://www.itu.int/rec/T-REC-H.265-201911-I
and check the level limits for a certain level. Then configure all relevant parameters of your encoder to match a specific level and set that level at the encoder so no magic things that are not wanted happen.
That said, the default levels in HEVC are pretty sane for any given height * width * fps, and using the lowest content-compatible level maximizes decoder compatibility. x265 does a good job at automatically picking the optimal level for your content, and I only override it in rare and peculiar circumstances.

For reasonably slow presets and a broad range of content, the max bitrate/ref frames/ecetera of the default profile is almost always sufficient for excellent quality.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 8th February 2021, 09:38   #6  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 206
Quote:
Originally Posted by benwaggoner View Post
For reasonably slow presets and a broad range of content, the max bitrate/ref frames/ecetera of the default profile is almost always sufficient for excellent quality.
Correct me if I'm wrong, but afaik x265 does only enforce vbv restrictions when level is set manually.

And for OP, level 4 @ main has max bitrate of 12Mbps, that could effect quality for 1080p. But as I said above, I'm pretty sure that its left unrestricted at auto, so in that case it wont effect your output.

Last edited by excellentswordfight; 8th February 2021 at 10:25.
excellentswordfight is offline   Reply With Quote
Old 8th February 2021, 23:11   #7  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,981
Quote:
Originally Posted by excellentswordfight View Post
Correct me if I'm wrong, but afaik x265 does only enforce vbv restrictions when level is set manually.

And for OP, level 4 @ main has max bitrate of 12Mbps, that could effect quality for 1080p. But as I said above, I'm pretty sure that its left unrestricted at auto, so in that case it wont effect your output.
My understanding is that it will automatically enforce the appropriate vbv-bufsize and vbv-maxrate for the given level irrespective of whether it was manually or automatically set. I've not tested that recently, though. It'd be obvious in the console output at the start of encoding.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 8th February 2021, 23:25   #8  |  Link
apophis906
Registered User
 
Join Date: Apr 2009
Posts: 24
Quote:
Originally Posted by benwaggoner View Post
My understanding is that it will automatically enforce the appropriate vbv-bufsize and vbv-maxrate for the given level irrespective of whether it was manually or automatically set. I've not tested that recently, though. It'd be obvious in the console output at the start of encoding.
My experience is that it doesn't enforce either of them. I have mine set to auto and have seen it set main level 4 and the output file average 19.7 Mb/s and know it spikes at some points into the 40's. I even tested a 4K clip with auto levels and a low crf to see if it would go past the default level 5 vbv settings and it got up to over 200 Mb/s and averaged around 150's.
apophis906 is offline   Reply With Quote
Old 10th February 2021, 02:24   #9  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,981
Quote:
Originally Posted by apophis906 View Post
My experience is that it doesn't enforce either of them. I have mine set to auto and have seen it set main level 4 and the output file average 19.7 Mb/s and know it spikes at some points into the 40's. I even tested a 4K clip with auto levels and a low crf to see if it would go past the default level 5 vbv settings and it got up to over 200 Mb/s and averaged around 150's.
Peak bitrate can only be measured based on a particular VBV buffer size. I've seen MediaInfo calculate peak bitrates much higher than the stream actually had based on --vbv-maxrate and --vbv-bufsize.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 10th February 2021, 02:46   #10  |  Link
apophis906
Registered User
 
Join Date: Apr 2009
Posts: 24
Quote:
Originally Posted by benwaggoner View Post
Peak bitrate can only be measured based on a particular VBV buffer size. I've seen MediaInfo calculate peak bitrates much higher than the stream actually had based on --vbv-maxrate and --vbv-bufsize.
All I can say is that when left to auto the bitrate will go up to what it needs to for the set crf. Even if that bitrate is past what the auto set level is and what its vbv maxrate would be.

A 5 min clip I muxed and ran through bdinfo. This was set to auto and came out as level 5 main.

Code:
VIDEO:

Codec                   Bitrate             Description     
-----                   -------             -----------     
MPEG-H HEVC Video       37701 kbps          2160p / 23.976 fps / 16:9 / Main 10 @ Level 5 @ Main / 10 bits / HDR10 / BT.2020

FILES:

Name            Time In         Length          Size            Total Bitrate   
----            -------         ------          ----            -------------   
00000.M2TS      0:00:00.000     0:04:59.757     1,620,111,360   39,405          

CHAPTERS:

Number          Time In         Length          Avg Video Rate  Max 1-Sec Rate  Max 1-Sec Time  Max 5-Sec Rate  Max 5-Sec Time  Max 10Sec Rate  Max 10Sec Time  Avg Frame Size  Max Frame Size  Max Frame Time  
------          -------         ------          --------------  --------------  --------------  --------------  --------------  --------------  --------------  --------------  --------------  --------------  
1               0:00:00.000     0:04:59.757     41,368 kbps     77,747 kbps     00:01:56.741    72,488 kbps     00:01:56.741    69,931 kbps     00:01:56.825    0 bytes         1,024,557 bytes 00:03:20.950
apophis906 is offline   Reply With Quote
Old 10th February 2021, 08:42   #11  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 206
Quote:
Originally Posted by apophis906 View Post
All I can say is that when left to auto the bitrate will go up to what it needs to for the set crf. Even if that bitrate is past what the auto set level is and what its vbv maxrate would be.

A 5 min clip I muxed and ran through bdinfo. This was set to auto and came out as level 5 main.

Code:
VIDEO:

Codec                   Bitrate             Description     
-----                   -------             -----------     
MPEG-H HEVC Video       37701 kbps          2160p / 23.976 fps / 16:9 / Main 10 @ Level 5 @ Main / 10 bits / HDR10 / BT.2020

FILES:

Name            Time In         Length          Size            Total Bitrate   
----            -------         ------          ----            -------------   
00000.M2TS      0:00:00.000     0:04:59.757     1,620,111,360   39,405          

CHAPTERS:

Number          Time In         Length          Avg Video Rate  Max 1-Sec Rate  Max 1-Sec Time  Max 5-Sec Rate  Max 5-Sec Time  Max 10Sec Rate  Max 10Sec Time  Avg Frame Size  Max Frame Size  Max Frame Time  
------          -------         ------          --------------  --------------  --------------  --------------  --------------  --------------  --------------  --------------  --------------  --------------  
1               0:00:00.000     0:04:59.757     41,368 kbps     77,747 kbps     00:01:56.741    72,488 kbps     00:01:56.741    69,931 kbps     00:01:56.825    0 bytes         1,024,557 bytes 00:03:20.950
Yes this is my experience as well, and its also stated in the docs that vbv is disabled by default so when using crf mode its uncapped when level is set automatically. This is also why I always set level manually so that I dont get any weird spikes that can cause buffer issues for LAN streaming, SoC mediaplayers etc. 4.1 High for HD and 3.1 for SD usually is high enough either way to cause much impact on quality, were using the lowest possible for that MaxDpbSize can.
excellentswordfight is offline   Reply With Quote
Old 23rd February 2021, 10:33   #12  |  Link
Tenkei
Registered User
 
Join Date: Jan 2021
Posts: 10
But what about device compatibility? If specification for a device says it supports "Main 10 Profile Level 4.1", does that mean main tier and high tier or just main? AFAIK Main 10 profile does not mean main tier, so I'm a little confused. If it's just main, can I assume that device supporting 4.1 main tier would also run 4.0 high?
Tenkei is offline   Reply With Quote
Old 23rd February 2021, 19:23   #13  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,981
Quote:
Originally Posted by Tenkei View Post
But what about device compatibility? If specification for a device says it supports "Main 10 Profile Level 4.1", does that mean main tier and high tier or just main? AFAIK Main 10 profile does not mean main tier, so I'm a little confused. If it's just main, can I assume that device supporting 4.1 main tier would also run 4.0 high?
Assume it's Main Tier unless otherwise specified.

The primary exception I can think if is that UHD Blu-ray's peak bitrate is a lot higher than 40 Mbps, so that probably should be done at High Tier and then --vbv-bufsize and --vbv-maxrate specified per the BD spec.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 23rd February 2021, 20:21   #14  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 206
Quote:
Originally Posted by benwaggoner View Post
Assume it's Main Tier unless otherwise specified.

The primary exception I can think if is that UHD Blu-ray's peak bitrate is a lot higher than 40 Mbps, so that probably should be done at High Tier and then --vbv-bufsize and --vbv-maxrate specified per the BD spec.
Yes, the uhd blu-ray standard specify high tier, the lower max bitrate is set as other disk based media cause of the limitation of the read bandwidth from the disk. The decoder itself in those units can probably handle the full data rate of high teir.

Quote:
Originally Posted by Tenkei View Post
But what about device compatibility? If specification for a device says it supports "Main 10 Profile Level 4.1", does that mean main tier and high tier or just main? AFAIK Main 10 profile does not mean main tier, so I'm a little confused. If it's just main, can I assume that device supporting 4.1 main tier would also run 4.0 high?
I wouldn't assume that, 4.0 high specify a higher data rate then 4.1 main.
excellentswordfight is offline   Reply With Quote
Old 24th February 2021, 16:05   #15  |  Link
Tenkei
Registered User
 
Join Date: Jan 2021
Posts: 10
Quote:
Originally Posted by excellentswordfight View Post
I wouldn't assume that, 4.0 high specify a higher data rate then 4.1 main.
I'll have to manually set the profile then, because If I set the VBV constraints to eg. 19000, x265 will choose 4.0 high instead of 4.1 main.
Tenkei is offline   Reply With Quote
Old 25th February 2021, 00:43   #16  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,981
Quote:
Originally Posted by Tenkei View Post
I'll have to manually set the profile then, because If I set the VBV constraints to eg. 19000, x265 will choose 4.0 high instead of 4.1 main.
Profile or Tier?

I always specify Profile and Level, and it always defaults to Main Tier as long as my --vbv-maxrate and --vbv-bufsize are within Main Tier limits.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 25th February 2021, 10:01   #17  |  Link
Tenkei
Registered User
 
Join Date: Jan 2021
Posts: 10
Quote:
Originally Posted by benwaggoner View Post
Profile or Tier?

I always specify Profile and Level, and it always defaults to Main Tier as long as my --vbv-maxrate and --vbv-bufsize are within Main Tier limits.
I meant Level 4.0, Tier High, the wording on those settings confuse me too much.

Last edited by Tenkei; 25th February 2021 at 10:10.
Tenkei is offline   Reply With Quote
Old 25th February 2021, 17:31   #18  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,981
Quote:
Originally Posted by Tenkei View Post
I meant Level 4.0, Tier High, the wording on those settings confuse me too much.
I get that!

"High Tier Main Profile Level 4.0"
Some old x264 reflexes get weird here, since some content can use a different level in HEVC than H.264, H.264 High is equivalent to HEVC Main, etcetera.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Reply

Tags
bitrate, level, quality, staxrip, x265

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.