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 January 2018, 07:32   #1  |  Link
DotJun
Registered User
 
Join Date: Aug 2014
Posts: 28
HW decode switches

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?
DotJun is offline   Reply With Quote
Old 7th January 2018, 17:16   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Don't know of any switch which would cause problems with 10bit if the source is Main10 and the gpu supports decoding that.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 28th June 2018, 13:19   #3  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 556
@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?
Forteen88 is offline   Reply With Quote
Old 28th June 2018, 20:40   #4  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
Not unless you are using VERY high bit rates, then you might need some VBV settings.
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 2nd July 2018, 10:26   #5  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 556
Quote:
Originally Posted by Asmodian View Post
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.

Last edited by Forteen88; 4th July 2018 at 10:23. Reason: thanking
Forteen88 is offline   Reply With Quote
Old 2nd July 2018, 11:49   #6  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,342
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.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is online now   Reply With Quote
Old 2nd July 2018, 15:57   #7  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by Forteen88 View Post
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.
foxyshadis is offline   Reply With Quote
Old 3rd July 2018, 18:14   #8  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by Forteen88 View Post
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).
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 5th July 2018, 10:42   #9  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 556
@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.

Last edited by Forteen88; 28th August 2018 at 09:52. Reason: spelling error
Forteen88 is offline   Reply With Quote
Old 9th July 2018, 00:38   #10  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by Forteen88 View Post
@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.
foxyshadis is offline   Reply With Quote
Old 9th July 2018, 14:17   #11  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 556
@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?

Last edited by Forteen88; 20th January 2019 at 21:14. Reason: UPDATE! IDK if my laptop H.265-decodes in MPC-HC with CPU-graphics or Nvidia-card!
Forteen88 is offline   Reply With Quote
Old 11th July 2018, 15:04   #12  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
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!
foxyshadis is offline   Reply With Quote
Old 11th July 2018, 21:34   #13  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by foxyshadis View Post
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.

Quote:
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 12th July 2018, 06:48   #14  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by benwaggoner View Post
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....
foxyshadis is offline   Reply With Quote
Old 12th July 2018, 13:33   #15  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 556
Quote:
Originally Posted by foxyshadis View Post
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.

Last edited by Forteen88; 19th July 2018 at 13:59. Reason: Thanking
Forteen88 is offline   Reply With Quote
Old 13th July 2018, 04:10   #16  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by Forteen88 View Post
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.
foxyshadis is offline   Reply With Quote
Old 13th July 2018, 18:42   #17  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by Forteen88 View Post
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).
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 19th July 2018, 14:06   #18  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 556
Quote:
Originally Posted by benwaggoner View Post
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!

Last edited by Forteen88; 20th July 2018 at 10:42.
Forteen88 is offline   Reply With Quote
Old 20th July 2018, 06:41   #19  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
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.
foxyshadis is offline   Reply With Quote
Reply

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 14:40.


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