View Full Version : X265 high vs main tier??
YaBoyShredderson
6th February 2021, 20:38
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?
rwill
7th February 2021, 10:25
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.
YaBoyShredderson
7th February 2021, 13:08
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?
rwill
7th February 2021, 13:26
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.
benwaggoner
7th February 2021, 23:39
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.
excellentswordfight
8th February 2021, 09:38
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.
benwaggoner
8th February 2021, 23:11
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.
apophis906
8th February 2021, 23:25
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.
benwaggoner
10th February 2021, 02:24
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.
apophis906
10th February 2021, 02:46
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.
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
https://i.ibb.co/Sc3C3Xx/no-levels-00000-bitrate-01s.png (https://ibb.co/Sc3C3Xx)
excellentswordfight
10th February 2021, 08:42
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.
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
https://i.ibb.co/Sc3C3Xx/no-levels-00000-bitrate-01s.png (https://ibb.co/Sc3C3Xx)
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.
Tenkei
23rd February 2021, 10:33
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?
benwaggoner
23rd February 2021, 19:23
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.
excellentswordfight
23rd February 2021, 20:21
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.
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.
Tenkei
24th February 2021, 16:05
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.
benwaggoner
25th February 2021, 00:43
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.
Tenkei
25th February 2021, 10:01
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.
benwaggoner
25th February 2021, 17:31
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.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.