clsid2 / mpc-hc

Media Player Classic
GNU General Public License v3.0
11.45k stars 499 forks source link

ToDo: adjust hardware decoder when selecting MPCVR #2621

Open clsid2 opened 8 months ago

clsid2 commented 8 months ago

When changing renderer to MPCVR, change hardware decoder in internal LAV Video to D3D11. Check registry for MPCVR settings first to see if DX11 was maybe disabled by user on Win10/11.

When changing from MPCVR to VMR9/EVR change it back to DXVA2 Native?

Maybe show prompt "Would you like to optimize hardware video decoding setting for the selected video renderer?"

NBruderman commented 8 months ago

Sounds like a neat idea! How about MadVR? Should we revert to DXVA2 when switching to it from MPCVR?

clsid2 commented 8 months ago

For MadVR either D3D11 or DXVA2 Copyback is best choice. So can't do anything there. I don't want to interfere with deliberate user choices. Nor I am interested in making this super complex.

NBruderman commented 8 months ago

So yeah, maybe each time a switch between the relevant renderes occurs, a dialog box might be the best solution if the optimal decoder is not the one chosen

gitschab commented 8 months ago

Thanks for this ticket, thanks to it I figured out why MadVR wouldn't work in MPC-HC on Win11 on Intel Iris XE, it was precisely because "DXVA2 (native)" is selected, and MadVR doesn't seem to work with it. Switching do D3D11 solves this. MPC-BE does this automatically, so MadVR works in it out of the box.

I'm forced to use MadVR as both EVR and MPCVR won't play 25fps videos on Win11/Iris XE smoothly, there's visible jitter/stutter (whatever this is called). MadVR plays them fine, but uses (in case of my laptop) 1W of energy more (which means approx 1 hour of playback less). I have no such problem playing 25fps videos on YouTube, VLC also seems fine. Any idea what could be causing this in MPC-HC and MPC-BE under both EVR and MPCVR?

clsid2 commented 8 months ago

MadVR supports DXVA2 just fine. It is your GPU driver which does no longer properly supports DXVA2 and other DirectX9 functionality.

This issue is not for GPU driver support. I can't help you with that.

gitschab commented 8 months ago

Yes, I realize it's the GPU driver. However, Iris XE has been included in more and more new PCs since 2022. I would really love to continue using MPC-HC and I bet I'm not alone. Seeing that YouTube or VLC (or even MadVR on MPC-HC/BE) work fine it looks it CAN be done/fixed on player/decoder/renderer end. Is there really nothing that you can do? :(

(Sorry for commenting on this thread, I just stumbled upon it accidentally and was just so happy that I figured out a way to get MadVR to work thanks to it, as I had no idea about decoder config)

clsid2 commented 8 months ago

Ask here for MPCVR: https://github.com/Aleksoid1978/VideoRenderer/issues

gitschab commented 8 months ago

I will, thank you and once again sorry for barging in on this thread, I'm desperate (as I'm frustrated having spent a hefty amount of money on a new laptop (and I'm honestly considering returning it) only to find out that a 7-year-old laptop can play videos in MPC-HC better!)

bibsp commented 4 months ago

I want to add some more cases here before someone implements this. clsid's plan: Show prompt while switching between renderers.

Additional cases: Changing the renderer or LAV decoder settings will also show prompt. For example:

  1. Someone tries to change renderer settings to DX9 (for any driver bug or whatever), and if his LAV setting is D3D11 then player will show a prompt to change LAV settings to DXVA2 Native.
  2. Opposite case. Someone changes the LAV settings to DXVA2 Native. If he is using MPCVR in DX11 mode, he will get a prompt to change MPCVR settings to DX9. And if there are some limitations in MPCVR's DX9 that can be also shown in that prompt.

In short, if player finds mismatch between decoder settings and renderer settings, it will show a prompt message.

And after all these implementations change the default MPC-HC settings. Default LAV decoder: D3D11 Default video renderer: MPCVR (DX11) Default audio renderer: MPCAR

clsid2 commented 4 months ago

DX11 decoder will be copyback when used with DX9 renderer, and that is fine.

MPCAR will not become default. I prefer SaneAR.

I am not interested in further discussion or suggestions.