AMD HW AV1 + HDR = nonsensical errors

emp_zealoth

New Member
With sdr settings everything works fine (I've already been recording in SDR AV1 for a while), however, when I tried to setup HDR recording (P010 colour format, Rec.2100(PQ) colour space) I fail to start recording with a weird error
1706912492342.png

I'm already on latest AMD driver and OBS version
 

Suslik V

Active Member
Code:
23:21:11.987: [texture-amf-av1] amf_av1_create_texencode: AMFComponent::Init failed: AMF_INVALID_ARG
Hardly believable that your card supports 2K-4K for AV1 encode with 10-bits in real-time. Maybe I'm wrong here, but at least try to reduce resolution in OBS to 1920x1080 (if it doesn't help - 10-bits AV1 encoding simply not supported for your device, so you can try other HDR capable encoder).
Edit: see posts about CQP rate control below.

Also,
Code:
23:19:22.451:         refresh=165
23:19:22.451:         bits_per_color=8
I don't think that this info is related to the issue but your display is reported to OS as 8-bit device, is it right setting?

And one more thing, the:
BufferDesc.Format: 87 ---> DXGI_FORMAT_B8G8R8A8_UNORM
I see in the log - is 8-bit texture (Game Capture source of OBS), so non-HDR source was selected for capture.
Expected format here is DXGI_FORMAT_R10G10B10A2_UNORM (BufferDesc.Format: 24) or something similar in case this is HDR source.
 
Last edited:

emp_zealoth

New Member
switched my display to from 8bit + dithering to 10bit YCbCr 422 Limited (not that I really know what the hell the difference is)

BTW I'm using the W11 auto-HDR functionality and it seems to work fine for the games itself, perhaps that's why the output is 8-bit? Does HDR capture not work with auto-hdr?

AV1 main profile is supposed to support 10-bit encoding. https://trac.ffmpeg.org/wiki/Encode/AV1#HDRandhighbitdepth
I am not getting errors like

1706974116083.png


Nor am I starting the recording succesfully and having it overload and fail that way (and I know how it looks, since HQVBR overloads at anything past Balanced preset with SDR)

When I pick P010 the encoder just fails to be initialised/loaded/whatever you want to call it:
Code:
16:15:32.814: [AMF] Version 2.8.0 loaded (Compiled: 1.4.14.0, Runtime: 1.4.33.0, Library: 1;4;33;0;23.40;202401111230;AMD-Radeon-Driver/drivers:54466fc264df7f017313690ceccee3fe39b2535e).
16:15:32.871: [AMF] <Id: 1> Unable to set converter transfer characteristic, error AMF_NOT_FOUND (code 11)
16:15:32.927: [AMF] <Id: 2> Unable to set converter transfer characteristic, error AMF_NOT_FOUND (code 11)
16:15:32.927: [AMF] [Capability Manager] Testing Direct3D 11 Adapter 'AMD Radeon RX 7800 XT (VEN_1002/DEV_747e/SUB_53241849/REV_00c8)':
16:15:32.927:   H264/AVC: Supported
16:15:32.927:   H265/HEVC: Supported
16:15:32.927:
16:15:32.971: [AMF] <Id: 3> Unable to set converter transfer characteristic, error AMF_NOT_FOUND (code 11)
16:15:33.014: [AMF] <Id: 4> Unable to set converter transfer characteristic, error AMF_NOT_FOUND (code 11)
16:15:33.015: [AMF] [Capability Manager] Testing Direct3D 11 Adapter 'AMD Radeon(TM) Graphics (VEN_1002/DEV_164e/SUB_88771043/REV_00c1)':
16:15:33.015:   H264/AVC: Supported
16:15:33.015:   H265/HEVC: Supported
 

Suslik V

Active Member
Mentioned init errors is unrelated to the issue. Let's say, this part is report from old AMF implementation which will be loaded anyway (as last attempt to enable hardware-based encoder). When hardware simply doesn't supports some modern techniques (textures) OBS switches to old code. OBS simply checks everything what your PC is capable of at the beginning and then tries to use what it has (from best to worst).
Info is based on developer's answer and my own thoughts:

Later, the log shows that both attempts to use AV1 encoder fails. New implementation and fallback to old implementation fails too, and with the same error:
Code:
16:16:54.459: [texture-amf-av1] amf_av1_create_texencode: AMFComponent::Init failed: AMF_INVALID_ARG
...
16:16:54.501: [fallback-amf-av1] amf_av1_create_fallback: AMFComponent::Init failed: AMF_INVALID_ARG


As for the Game Capture, it seems that "enlisted.exe" process (you attempting to capture) isn't rendered in HDR.
Code:
16:16:52.104: [game-capture: 'Game Capture'] DXGI_SWAP_CHAIN_DESC:
16:16:52.104:     BufferDesc.Width: 2560
16:16:52.104:     BufferDesc.Height: 1440
16:16:52.104:     BufferDesc.RefreshRate.Numerator: 0
16:16:52.104:     BufferDesc.RefreshRate.Denominator: 1
16:16:52.104:     BufferDesc.Format: 87
,,,
The BufferDesc.Format: 87 ---> DXGI_FORMAT_B8G8R8A8_UNORM ---> this is still 8-bit texture (image).
If game supports HDR rendering in fullscreen this should be enabled in the game settings... Or maybe you uploaded wrong log-file.
 

Suslik V

Active Member

emp_zealoth

New Member
According to:
it is wise to try CQP for Rate Control for selected AV1 encoder.
Switching to CQP rate control worked with P010 format, thank you
HQVBR in Balanced preset sadly seems way more efficient with data used for same visual quality. (Although HQVBR recordings seem to get kinda mangled by re-encode during editing/after upload)

Still, OBS should probably provide a useful error for this case, like the comment you directly link to
"HQVBR forces PreAnalysis to true, PreAnalysis only works with NV12 format, try CQP instead"
 
Top