View Full Version : HW decode switches
DotJun
6th January 2018, 07:32
What switches need to be used/not used so that my 10 bit encodes have a higher chance of being able to be decoded via gpu?
Selur
7th January 2018, 17:16
Don't know of any switch which would cause problems with 10bit if the source is Main10 and the gpu supports decoding that.
Forteen88
28th June 2018, 13:19
@Selur. So when using x265, I only need to set --profile main10
for H265 DXVA decoding-compatibility? I really don't need to change --vbv-maxrate & --vbv-bufsize or anything else?
Asmodian
28th June 2018, 20:40
Not unless you are using VERY high bit rates, then you might need some VBV settings.
Forteen88
2nd July 2018, 10:26
Not unless you are using VERY high bit rates, then you might need some VBV settings.OK, thanks. I usually do CRF 18 encodes at best, so that shouldn't be a problem then.
Don't I need to set level 4.1 for DXVA, like in x264? --level-idc 4.1
Don't I need to set a maximum --ref for DXVA, depending on the resolution, like in x264? --ref 3
Don't I need to set a maximum --bframes for DXVA-compatibility?
Or does the setting: --profile main10
restrict max --ref and max --bframes automatically?
EDIT: "x265 should set the level value on its own"-nevcairiel. Thanks everyone.
nevcairiel
2nd July 2018, 11:49
Just stay within the valid H.265 profiles and level, which hopefully x265 will not break by default. Most newer GPUs can even decode 8K content, which means support for up to level 6.2, older ones may be limited to 4K, which would be level 5.2, but x265 should set the level value on its own, instead of requiring you to override it.
foxyshadis
2nd July 2018, 15:57
OK, thanks. I usually do CRF 18 encodes at best, so that shouldn't be a problem then.
Don't I need to set level 4.1 for DXVA, like in x264? --level-idc 4.1
Don't I need to set a maximum --ref for DXVA, depending on the resolution, like in x264? --ref 3
Don't I need to set a maximum --bframes for DXVA-compatibility?
Or does the setting: --profile main10
restrict max --ref and max --bframes automatically?
EDIT: "x265 should set the level value on its own"-nevcairiel. Thanks.
Level 4.1 was a first-generation H.264 limitation, all of the later hardware could do 5.1 just fine. Likewise, main (not main10) @ 4.0 was a first-generation HEVC limitation, but now most can do main10 @ 5.0 without a problem. You can look up your decoder's actual limitations, since it's based on the hardware, not on DXVA itself.
benwaggoner
3rd July 2018, 18:14
OK, thanks. I usually do CRF 18 encodes at best, so that shouldn't be a problem then.
Don't I need to set level 4.1 for DXVA, like in x264? --level-idc 4.1
Don't I need to set a maximum --ref for DXVA, depending on the resolution, like in x264? --ref 3
Don't I need to set a maximum --bframes for DXVA-compatibility?
Or does the setting: --profile main10
restrict max --ref and max --bframes automatically?
EDIT: "x265 should set the level value on its own"-nevcairiel. Thanks.
I think it's always a good practice to set the Profile and Level you want. x265 does a good job of picking appropriate defaults for your content's fps, resolution, bitrate, etcetera. But if the values matter, and you set them, it'll let you know if you did something to violate those. And there's rarely any reason to not use the lowest profile compatible with your height*width*fps for entertainment content. Stuff enabled by High Tier makes sense for content acquisition (especially IDR-only).
Forteen88
5th July 2018, 10:42
@foxyshadis. Thanks. main10 @ 5.0, which graphics-cards supports that, it's not only the Nvidia 1000-series?! I think I read that Nvidia 900-series also supports it. Unfortunately the graphics-chip on my laptop is a Nvidia 800-series :P But my MPC-HC shows that there is still some H265 HW-decoding on my Nvidia 800-series graphics-chip, but I guess that it's not at all as good decoding as in the newer chips.
@benwaggoner. Thanks, I'll set the Profile and Level I want, I hope that maximum reference frames & bframes is set automatically then. Setting max on those settings is especially great for cartoon/anime.
foxyshadis
9th July 2018, 00:38
@foxyshadis. Thanks. main10 @ 5.0, which graphics-cards supports that, it's not only the Nvidia 1000-series?! I think I read that Nvidia 900-series also supports it. Unfortunately the graphics-chip on my laptop is a Nvidia 800-series :P But I MPC-HC shows that there is still some H265 HW-decoding on my Nvidia 800-series graphics-chip, but I guess that it's not at all as good decoding as in the newer chips.
@benwaggoner. Thanks, I'll set the Profile and Level I want, I hope that maximum reference frames & bframes is set automatically then. Setting max on those settings is especially great for cartoon/anime.
Sorry, just coming back to this. The 800M generation was a weird one, with a mix of Fermi, Kepler, and Maxwell; you'd have to look at GPU-Z and see if it's GF, GK, or GM. (Particularly since the 860M came in both GK and GM flavors.) If it's Maxwell, you get HEVC main, not main10, but done in shaders so your max level is based entirely on how fast your card is (full 8/10 dedicated decoding didn't come until the 950/960); if it's Kepler, you're completely out of luck and you get CPU-only.
Forteen88
9th July 2018, 14:17
@foxyshadis. Thanks. Do you have a suggestion for how many maximal --bframes and & --refs I should set in x265 to keep a generally high compatibility for GPU-decoding (main10@L5.0)? I've read that when encoding cartoon/anime, maximal --bframes and & --refs should be set for high compression.
I guess that maximal --refs depends on the resolution, like for H264-encoders?!
Are the x265-levels the same as x264-levels when it comes to --refs?
This page calculates maximal reference-frames for a certain H264-level,
https://planetcalc.com/3321/
or
http://blog.mediacoderhq.com/h264-profiles-and-levels/
UPDATE: I saw that my laptop's graphics-chip is a Nvidia GeForce 840M GM108, so only support for main, not main10?! But I've played main10 (x265-video that I've encoded with --main10 in 10-bits), my MPC-HC says that a x265 main10-videoclip I have is "Playing [H/W], maybe it's slow decoding of main10?!
UPDATE2: OH, sorry, I forgot to mention: maybe I'm wrong about my laptop with a Nvidia GeForce 840M GM108. Maybe my MPC-HC uses my Intel CPU graphics in that laptop to GPU-decode H.265/HEVC-video?
foxyshadis
11th July 2018, 15:04
You can max out the refs at 1080p. At 4K, you only get 6, and that has to include the B frames, so if you have --b-pyramid you only get --ref 4.
That's kind of cool, it sounds like Nvidia added more capability in later drivers. Good to know it can decode main10, I guess you'll just have to try higher bitrates until you find out where it tops out!
benwaggoner
11th July 2018, 21:34
You can max out the refs at 1080p.
Well, you should always stay within your profile @ level limit. And for broadest compatibility, I always recommend using main tier and the lowest profile and level that work for your bit depth, fps, and frame size. For normal delivery encoding at reasonably quality-tuned settings, using anything beyond that very rarely results in a material improvement in perceptual quality or reduction in file size.
At 4K, you only get 6, and that has to include the B frames, so if you have --b-pyramid you only get --ref 4.
This is more of syntactical thing; the actual max number of previously decoded frames that can be referenced is the same.
foxyshadis
12th July 2018, 06:48
Well, you should always stay within your profile @ level limit. And for broadest compatibility, I always recommend using main tier and the lowest profile and level that work for your bit depth, fps, and frame size. For normal delivery encoding at reasonably quality-tuned settings, using anything beyond that very rarely results in a material improvement in perceptual quality or reduction in file size.
This is more of syntactical thing; the actual max number of previously decoded frames that can be referenced is the same.
Yeah, that's based on x265's (and x264's) understanding of refs; I wish they would just build the bframes into the overall number.
What I meant by max out is that even 1080p120 @ L5 can handle up to 16 refs, and the spec only allows 8 L0 refs, so....
Forteen88
12th July 2018, 13:33
You can max out the refs at 1080p.Can I max out the refs at 1080p with 16 bframes & --b-pyramid enabled (--b-pyramid enabled, as it is in x265 as default) in x265 main10@L5.0?
EDIT: Thanks foxyshadis & benwaggoner.
foxyshadis
13th July 2018, 04:10
Can I max out the refs at 1080p with 16 bframes & --b-pyramid enabled (--b-pyramid enabled, as it is in x265 as default) in x265 main10@L5.0?
You should be able to use --ref 6 without a problem, yeah. I'm sure there's decoders that let you get away with more, too, despite it being out-of-spec.
benwaggoner
13th July 2018, 18:42
Can I max out the refs at 1080p with 16 bframes & --b-pyramid enabled (--b-pyramid enabled, as it is in x265 as default) in x265 main10@L5.0?
As for b-frames, yes the max of 16 should work everywhere, and I've verified it works in practice on a wide variety of decoders.
Efficiency gains at >8 are pretty small unless content is quite clean or very low bitrate (which tends to make it quite clean in practice due to the low pass filtering of high QP).
Forteen88
19th July 2018, 14:06
As for b-frames, yes the max of 16 should work everywhere, and I've verified it works in practice on a wide variety of decoders.
Efficiency gains at >8 are pretty small unless content is quite clean or very low bitrate (which tends to make it quite clean in practice due to the low pass filtering of high QP).But --bframes 16 is greatest to set for clean cartoon/anime & 3d-animated videos, right?!
UPDATE: Thanks again foxyshadis!
foxyshadis
20th July 2018, 06:41
16 bframes is a set-and-forget option; the encoder will only use as many as it thinks are worth it, all the players will play it, and it doesn't really affect encoding time much. If you encode a lot of clean cartoon/anime, it's basically a requirement.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.