smplayer-dev / smplayer

Free Media Player for Windows, Linux and Mac OS with YouTube support.
https://smplayer.info
GNU General Public License v2.0
656 stars 92 forks source link

List of hardware decoders is static; doesn't include `nvdec` #610

Open DaviMedrade opened 1 year ago

DaviMedrade commented 1 year ago

Describe the bug The list of hardware decoders in the Performance options doesn't show nvdec nor nvdec-copy, which are valid decoders for mpv.

To Reproduce Steps to reproduce the behavior:

  1. Options → Preferences, “Performance” tab.
  2. In the “Hardware decoding” tab, the list does not include nvdec nor nvdec-copy.

Expected behavior From mplayeroptions.cpp I understand that the “Hardware Decoding” option is only supported by mpv. Ideally, all hardware decoders supported by the running mpv, and only those, would be displayed. The list can be obtained by running mpv --hwdec=help.

From what I can tell by the source in prefperformance.cpp, the hardware decoder list is hard-coded, with some compile-time toggles by OS (and one run-time check for Windows version). But there's no guarantee that those hardware decoders have been compiled into mpv, and new decoders added to mpv would have to be manually added to this list.

My suggestion is that the list of hardware decoders is initialized from the results of running mpv --hwdec=help, which would ensure that only the decoders that are supported by the running platform and have been compiled into mpv are presented as options.

Alternatively, or in the interim, the options nvdec and nvdec-copy should be added (at least for Linux; I don't know if they are supported by mpv in Windows or OSX).

Your Enviroment

dbermond commented 10 months ago

Additionally, the mpv documentation says that nvdec and nvdec-copy are the recommended settings for NVIDIA GPUs, and also that using cuda and cuda-copy may cause problems. By selecting Auto, nvdec is used by mpv in my system, but NVIDIA users are still lacking important options in the hardware decoding list.

Quote from mpv documenation:

nvdec and nvdec-copy are the newest, and recommended method to do hardware decoding on Nvidia GPUs.

cuda and cuda-copy are an older implementation of hardware decoding on Nvidia GPUs that uses Nvidia's bitstream parsers rather than FFmpeg's. This can lead to feature deficiencies, such as incorrect playback of HDR content, and nvdec/nvdec-copy should always be preferred unless you specifically need Nvidia's deinterlacing algorithms.

smplayer-dev commented 9 months ago

I've just updated the list in this commit https://github.com/smplayer-dev/smplayer/commit/a2506f7238994971848db67844ea0d8ec9ee70da