Setup: Windows 11 Pro build 26200, Radeon RX 9070 XT (RDNA4), driver 32.0.31021.5001, AMF runtime from the driver.
Context: FFmpeg master's libavfilter AMF filters (vqe_amf, vpp_amf, sr_amf, frc_amf) with D3D11VA decoder input. After fixing a surface-format bug in FFmpeg (https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23874), the filters wrap the decoder's texture-array slices via CreateSurfaceFromDX11Native (+ AMFTextureArrayIndexGUID private data to select the slice). The AMF context is created from the same D3D11 device via InitDX11.
Observed — identical input surfaces (NV12, texture array, D3D11_BIND_DECODER only):
AMFFRC: SubmitInput/QueryOutput work, output is correct.
AMFVQEnhancer / AMFHQScaler / AMFVideoConverter: Init() succeeds, SubmitInput() succeeds, first QueryOutput() returns AMF_DIRECTX_FAILED (18), no further diagnostics.
- The same components succeed when the decode textures are additionally created with
D3D11_BIND_SHADER_RESOURCE (FFmpeg device option SHADER=1).
- DXVA2/DX9 input via
CreateSurfaceFromDX9Native: AMFVQEnhancer works with default decoder surfaces.
Repro with ffmpeg git master (patched with the PR above; fails):
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -i input.mp4 -vf vqe_amf -c:v hevc_amf out.mp4
Works:
ffmpeg -init_hw_device d3d11va=dx11:,SHADER=1 -hwaccel d3d11va -hwaccel_device dx11 \
-hwaccel_output_format d3d11 -i input.mp4 -vf vqe_amf -c:v hevc_amf out.mp4
Requests:
- Could the compute-based components internally handle inputs without SRV bind flags (e.g. an internal copy), as FRC apparently does? Typical D3D11VA decoder pools (FFmpeg's default, and many applications) are
BIND_DECODER-only.
- If it must remain a hard requirement, document it in the VQ Enhancer / HQ Scaler / Video Converter API docs.
- A more specific error than
AMF_DIRECTX_FAILED at QueryOutput would help — Init and SubmitInput both succeed, so the failure surfaces late with no hint at the cause.
Happy to test fixes or provide more traces (RDNA4 / Windows 11).
Setup: Windows 11 Pro build 26200, Radeon RX 9070 XT (RDNA4), driver 32.0.31021.5001, AMF runtime from the driver.
Context: FFmpeg master's libavfilter AMF filters (
vqe_amf,vpp_amf,sr_amf,frc_amf) with D3D11VA decoder input. After fixing a surface-format bug in FFmpeg (https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23874), the filters wrap the decoder's texture-array slices viaCreateSurfaceFromDX11Native(+AMFTextureArrayIndexGUIDprivate data to select the slice). The AMF context is created from the same D3D11 device viaInitDX11.Observed — identical input surfaces (NV12, texture array,
D3D11_BIND_DECODERonly):AMFFRC:SubmitInput/QueryOutputwork, output is correct.AMFVQEnhancer/AMFHQScaler/AMFVideoConverter:Init()succeeds,SubmitInput()succeeds, firstQueryOutput()returnsAMF_DIRECTX_FAILED(18), no further diagnostics.D3D11_BIND_SHADER_RESOURCE(FFmpeg device optionSHADER=1).CreateSurfaceFromDX9Native:AMFVQEnhancerworks with default decoder surfaces.Repro with ffmpeg git master (patched with the PR above; fails):
Works:
Requests:
BIND_DECODER-only.AMF_DIRECTX_FAILEDatQueryOutputwould help —InitandSubmitInputboth succeed, so the failure surfaces late with no hint at the cause.Happy to test fixes or provide more traces (RDNA4 / Windows 11).