autodetecting cuda fails during configure
mpv version and platform
mpv and ffmpeg git master on linux (ubuntu 17.04)
Reproduction steps
cuda autodetection of mpv fails during ./waf configure even though ffmpeg is compiled with cuda and cuvid support. Same behavior when using mpv-build or manual configure.
Expected behavior
cuda autodetected
Actual behavior
cuda autodetection fails. Bisected this behavior to commit https://github.com/mpv-player/mpv/commit/dc5fcced233ac4c9f2d644cbfc246644a095f673 changes to cuda.c fragment, specifically lines
AVCodecContext *avctx = avcodec_alloc_context3(NULL);
avctx->hw_device_ctx = NULL;
to confirm when these are removed autodetecting succeeds.
Possible solution
Adding libavcodec to cuda use part in wscript seems to solve this
}, {
'name': '--cuda-hwaccel',
'desc': 'CUDA hwaccel',
'deps': 'gl',
'func': check_cc(fragment=load_fragment('cuda.c'),
use=['libav', 'libavcodec']),
}
when both libav and libavcodec is in use part cuda can be autodected on my system else it always fails.
It's detected with ffmpeg master here. Can't reproduce.
I get the same issue and a suggested workaround does help.
I also have a similar issue. The only difference is that I'm explicitly setting --enable-cuda-hwaccel, and not using the autodetection.
CUDA is not detected by waf configure.
The proposed solution of modifying wscript to use=['libav', 'libavcodec'] in --cuda-hwaccel section works for me.
Commit https://github.com/mpv-player/mpv/commit/09c61347a8481cfb42bfc381880bd3fe93c4e744 fixed this issue for me.