Closed fulalas closed 1 month ago
Sure making the check fail in waf and meson if the headers are not installed is easy enough. Although does anyone actually know why the headers need to be there? Seems unintuitive for me.
What's the bug? hwdec=nvdec requires those headers because the interop uses cuda directly. hwdec=nvdec-copy does not. It only requires FFmpeg to have been built with nvdec support. So if you want nvdec, you build with headers. We use the headers if they are present automatically.
Also, your waf output says it found the headers:
Checking for CUDA Headers and dynamic loader : yes
Checking for CUDA acceleration : yes
Checking for CUDA with graphics interop : yes
What we would expect to happen is that the if the headers are missing, it will fail the first check and then it will not compile in nvdec support and if you try to use --hwdec=nvdec
, it will fail as an unrecognised choice.
@philipl, you're right. I pasted the output when the headers were installed. It's fixed now.
I'm just wondering if we could better inform that when missing ffnvcodec headers mpv will always fallback to nvdec-copy (when a nvidia card is presented). It took me a long time to find out that and it's not just me (e.g. https://github.com/mpv-player/mpv/issues/10839). Maybe an entry like this:
Checking for nvdec acceleration : nvdec-hwaccel not found
It's because the options are not named with nvdec
, but they are there. If you want to fail if you can't build with nvdec
support, you would pass -Dcuda-interop=enabled
to meson and it would fail without headers.
Works as expected. No headers, no nvdec.
mpv version and platform versions
mpv 0.35.0 ffmpeg 4.4.1 NVIDIA GeForce GTX 1650 SUPER with driver 510.60.02 Porteus 5.0 x64 distro
Reproduction steps
When building mpv against ffmpeg that was compiled with
--enable-nvenc
, mpv doesn't complain if it doesn't find ffnvcodec headers and the result is that when playing videos it always falls back to nvdec-copy, skipping nvdec.This issue was mentioned here.
Expected behavior
During configure, if mpv detects that ffmpeg was compiled using
--enable-nvenc
it should warn if it doesn't find ffnvcodec headers.Actual behavior
Mpv doesn't inform anything and when playing back videos it always falls back to nvdec-copy.
Log file