Aleksoid1978 / VideoRenderer

Внешний видео-рендерер
GNU General Public License v3.0
1.06k stars 119 forks source link

DXVA2 Native not working with MPC Video Renderer (latest nightly), when Direct3D 11 option is ON #96

Closed Kekkin closed 1 year ago

Kekkin commented 1 year ago

After updating the K-Lite Codec Pack, which the latest tested version as of writing this contains version 0.7.0.2131 of the Video Renderer, I have noticed lack of hardware acceleration (LAV filters shows active decoder as avcodec, which I assume means software decoding, rather than dxva2n) when Direct3D 11 is enabled in MPC VR settings and the hardware decoder set to DXVA2 (native). The problem doesn't happen if I disable Direct3D 11 from the renderer's settings (which will use D3D9Ex instead, which sucks if I have to go full-screen and wait a few secs in order for the process to complete, rather than instantaneously), or if I use either the copy-back mode or the D3D11 hardware decoder from the decoder settings. At first, I thought it was a problem with HEVC 8-bit decoding (which my iGPU is only capable of when it comes to HEVC), but it also affected H264 playback. Of course, the default EVR (custom) renderer doesn't exhibit this problem.

I have uninstalled the K-Lite Codec Pack, and installed the latest release of MPC-BE (1.6.9), which contained version 0.6.9.2117 (latest stable) of MPC VR. I set the renderer to MPC VR, enabled Direct3D 11, and configured the hardware decoder to DXVA2 Native. Just as I expected, there are no problems with H/W playback of H264 and HEVC 8-bit videos.

I then tried clsid2's latest portable nightly build of MPC-HC, just to see if MPC-HC itself or the LAV Filters aren't affecting this problem. Seeing as the Video Renderer was installed global-wide (regsvr32), I just had to change the renderer from the dropdown, use D3D 11, and change the hardware decoder to DXVA2 Native. Again, there's no problem with H/W playback, and we can rule out MPC-HC and LAV Filters as troublemakers.

So I decided to try reinstalling the K-Lite Codec Pack once again, having uninstalled MPC-BE and removed MPC-HC beforehand. I used the typical settings, with these changes: used DXVA2 Native for MPC-HC (and enabled H/W decoding for H264, HEVC, MPEG2 and VC-1), and set the renderer to MPC VR. Tests showcased the problem exhibiting.

I was thinking of replacing the .ax filters bundled in the K-Lite Codec Pack with the latest stable version of MPC VR, and just as I expected - the problem doesn't exhibit at all. When I replaced the .ax filters with the latest nightly ones, then the problem returned.

So, I was uninstalling (once again :D) K-Lite and installed MPC-BE, only this time - installing the latest nightly version of the renderer. Having set to appropriate settings (DXVA2 Native for hardware decoding, Direct3D 11 in renderer), I can reproduce this problem.

I believe there might be a regression somewhere between the latest stable version (0.6.9.2117) and the latest nightly (which is 0.7.0.2126).

Here are the screens: https://imgur.com/a/VPK6ZYU And here's the system info, from the Codec Tweak Tool:

OS: Windows 10 Enterprise (10.00.19044) (x64) CPU name: Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz CPU details: 2794 MHz | 8 core(s) | Family 6 Model 60 Stepping 3 Memory: 12224 MB Screen size: 1920x1080 (32bits) (60Hz) GPU 1: Intel(R) HD Graphics 4600 VendorID: 8086, DeviceID: 0416, SubSys: 05cc1028 GPU memory: 1024 MB GPU driver: igdumdim64.dll (Version 20.19.15.4835) (10-16-2017) GPU 2: NVIDIA Quadro K2100M VendorID: 10de, DeviceID: 11fc, SubSys: 15cc1028 GPU memory: 2048 MB GPU driver: nvldumdx.dll (Version 30.0.14.7381) (7-11-2022) (NV 473.81) Audio device: Realtek Audio VendorID: 10ec, DeviceID: 0292, SubSys: 102805cc Audio driver: RTDVHD64.sys (Version 6.0.1.6127) (10-1-2018)

v0lt commented 1 year ago

https://github.com/Aleksoid1978/VideoRenderer/blob/master/history.txt

0.7.0 dev

The DXVA2 decoder is no longer supported in DirectX 11 mode.

Use D3D11 decoders in conjunction with Direct3D11 mode. This will be the best solution.

Kekkin commented 1 year ago

https://github.com/Aleksoid1978/VideoRenderer/blob/master/history.txt

0.7.0 dev

The DXVA2 decoder is no longer supported in DirectX 11 mode.

Use D3D11 decoders in conjunction with Direct3D11 mode. This will be the best solution.

Yeah, haven't thought of checking the changelog in the beginning. Good to know, though.😅 I yielded good results with the D3D11 decoder, so I guess the change won't hurt. With how the hybrid decoder setting (D3D11, DXVA2) in the MPC Video Decoder being default, guess it wasn't that noticable unlike in LAV Filters where it's separate. Guess it may be considered as resolved, then.