Opened 9 months ago
Closed 7 months ago
#10759 closed defect (fixed)
Bug in new D3D12 decoder.
Reported by: | Aleksoid1978 | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avcodec |
Version: | git-master | Keywords: | D3D12 |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description (last modified by )
Affected only MPEG2/VC1/VP9 decoders.
At decoding start - call assert(0) at d3d12va_decode.c -> ff_d3d12va_get_surface_index() line 83
https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/d3d12va_decode.c#L83
Result - output is broken/jerky.
Attachments (3)
Change History (23)
comment:1 by , 9 months ago
Description: | modified (diff) |
---|
by , 9 months ago
Attachment: | d3d12va_vp9.diff added |
---|
comment:2 by , 9 months ago
Description: | modified (diff) |
---|
comment:3 by , 9 months ago
Version: | unspecified → git-master |
---|
comment:4 by , 9 months ago
Here is MPEG2 and VC1 affected samples:
https://disk.yandex.ru/d/jd8XFMIdNpu3rA
comment:5 by , 9 months ago
How to test/reproduce:
ffmpeg.exe -hwaccel d3d12va -i 720p.mpg broken.mkv
ffmpeg.exe -hwaccel d3d11va -i 720p.mpg good.mkv
ffmpeg.exe -i 720p.mpg good.mkv
comment:6 by , 9 months ago
comment:7 by , 8 months ago
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20240111063121.1467-1-tong1.wu@intel.com/ to fix mpeg2 and vc1 issue. Could you have another try?
comment:10 by , 8 months ago
The D3D12 decoder does not work with AMD integrated graphics.
I get this error on AMD Vega 8:
[h264 @ 0000026c50a058c0] D3D12 decoder doesn't support on this device [h264 @ 0000026c50a058c0] Failed setup for format d3d12: hwaccel initialisation returned error.
People are also reporting problems with the AMD Radeon 780M.
follow-up: 12 comment:11 by , 8 months ago
The D3D12 decoder does not work with AMD integrated graphics.
This is Nvidia novel APIs. Both for encoder and decoder. D3d11 is old.
comment:12 by , 8 months ago
Replying to Balling:
The D3D12 decoder does not work with AMD integrated graphics.
This is Nvidia novel APIs. Both for encoder and decoder. D3d11 is old.
The D3D12 decoder is available for Intel, AMD and Nvidia.
I checked, interfaces are available for adapters from all manufacturers.
https://gist.github.com/v0lt/48477eb96075b23c8aeebc3cfe8240a3
But tests with FFmpeg show the following:
Nvidia GTX 950 - works
Intel UHD 750 - works, except VC-1
AMD Vega 8 - does not work
comment:13 by , 8 months ago
We found out that AMD Vega 8 does not support D3D12_VIDEO_DECODE_TIER_2.
comment:14 by , 8 months ago
If I understand the spec correctly, if someone reworks the D3D12 decoder support for D3D12_VIDEO_DECODE_TIER_1, then it should work for D3D12_VIDEO_DECODE_TIER_2. I don't know how difficult it is to do.
follow-up: 16 comment:15 by , 8 months ago
Another fix for the VC-1 decoder.
The fact is that there are 2 guides (as well as DXVA2 and D3D11):
D3D12_VIDEO_DECODE_PROFILE_VC1 and D3D12_VIDEO_DECODE_PROFILE_VC1_D2010.
Intel for D3D12 only supports D3D12_VIDEO_DECODE_PROFILE_VC1_D2010.
by , 8 months ago
Attachment: | d3d12va_vc1.diff added |
---|
comment:16 by , 8 months ago
Replying to Aleksoid1978:
Another fix for the VC-1 decoder.
The fact is that there are 2 guides (as well as DXVA2 and D3D11):
D3D12_VIDEO_DECODE_PROFILE_VC1 and D3D12_VIDEO_DECODE_PROFILE_VC1_D2010.
Intel for D3D12 only supports D3D12_VIDEO_DECODE_PROFILE_VC1_D2010.
I can help you submit the patch if you want. Could you add your sign-off info in your patch? Thx.
by , 8 months ago
Attachment: | 0001-D3D12-VC-1-decoder-add-support-for-D3D12_VIDEO_DECOD.patch added |
---|
comment:17 by , 8 months ago
About VC1_D2010.
http://download.microsoft.com/download/5/d/c/5dc91455-0a8c-4d57-8975-0afe1cfaf0dd/DXVA_WMV.pdf
The VC1_D2010 profile, also known as VC1_VLD2010, has the same functionality and specification as the VC1_D profile. Support for this profile serves only as a positive indication that the accelerator has been designed with awareness of the modifications specified in the August 2010 version of this specification.
The following GUID is defined for this profile.
DEFINE_GUID(DXVA_ModeVC1_D2010,0x1b81beA4,
0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
Hardware accelerator drivers that expose support for this profile must not also expose the previously specified VC1_D GUID, unless the accelerator works properly with existing software decoders that use VC1_D and that do not incorporate the corrections added to the August 2010 version of this specification.
I think what this means is that VC1_D2010 (and all other synonyms for DXVA2, D3D11, D3D12) should be given higher priority than VC1_D.
comment:18 by , 7 months ago
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20240131113027.1497-1-tong1.wu@intel.com/
Thanks for the explanation. Patch has been submitted.
comment:19 by , 7 months ago
This is fixed now with 336d59643a96843dbc51837e855326f2738f0e5b?
I would love you to add this code but whatever. https://github.com/Aleksoid1978/MPC-BE/commit/31be924604af23801e5329e54b9d5098f6be10d0
comment:20 by , 7 months ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Possible solution for VP9