error: unknown type name 'VkVideoCodecOperationFlagBitsKHR'
rodrigomorales1 opened this issue · 5 comments
I'm trying to compile mpv in Ubuntu 22.04.4 LTS.
I cloned the repository and I executed ./rebuild
as indicated in the README.rst file, but I got an error.
$ ./rebuild -j16
(omitted lines)
Build targets in project: 25
mpv 0.38.0-UNKNOWN
d3d11 : NO
javascript: NO
libmpv : NO
lua : NO
opengl : YES
vulkan : YES
wayland : NO
x11 : NO
User defined options
buildtype : release
Found ninja-1.10.1 at /usr/bin/ninja
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /tmp/mpv-build/mpv/build -j 16
ninja: Entering directory `/tmp/mpv-build/mpv/build'
[67/226] Compiling C object libmpv.so.2.3.0.p/demux_demux_mkv.c.o
FAILED: libmpv.so.2.3.0.p/demux_demux_mkv.c.o
cc -Ilibmpv.so.2.3.0.p -I. -I.. -Icommon -Ietc -Iplayer/javascript -Iplayer/lua -Isub -I/tmp/mpv-build/build_libs/include -I/usr/include/uuid -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/libpng16 -fvisibility=hidden -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=c11 -O3 -D_FILE_OFFSET_BITS=64 -Wdisabled-optimization -Wempty-body -Wformat -Wimplicit-fallthrough -Wparentheses -Wpointer-arith -Wshadow -Wundef -Wvla -Wno-cast-function-type -Wno-format-zero-length -Wno-missing-field-initializers -Wno-sign-compare -Wno-switch -Wno-unused-parameter -fno-math-errno -fno-signed-zeros -fno-trapping-math -Werror=format-security -D_GNU_SOURCE -Wmissing-prototypes -Wstrict-prototypes -Werror=implicit-function-declaration -Wno-pointer-sign -fPIC -pthread -DPL_HAVE_PTHREAD -DPTHREAD_HAS_SETCLOCK -DPL_STATIC -MD -MQ libmpv.so.2.3.0.p/demux_demux_mkv.c.o -MF libmpv.so.2.3.0.p/demux_demux_mkv.c.o.d -o libmpv.so.2.3.0.p/demux_demux_mkv.c.o -c ../demux/demux_mkv.c
In file included from /tmp/mpv-build/build_libs/include/libplacebo/utils/libav_internal.h:45,
from /tmp/mpv-build/build_libs/include/libplacebo/utils/libav.h:293,
from ../demux/demux_mkv.c:40:
/tmp/mpv-build/build_libs/include/libavutil/hwcontext_vulkan.h:44:5: error: unknown type name 'VkVideoCodecOperationFlagBitsKHR'
44 | VkVideoCodecOperationFlagBitsKHR video_caps;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[75/226] Compiling C object libmpv.so.2.3.0.p/filters_f_lavfi.c.o
FAILED: libmpv.so.2.3.0.p/filters_f_lavfi.c.o
cc -Ilibmpv.so.2.3.0.p -I. -I.. -Icommon -Ietc -Iplayer/javascript -Iplayer/lua -Isub -I/tmp/mpv-build/build_libs/include -I/usr/include/uuid -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/libpng16 -fvisibility=hidden -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=c11 -O3 -D_FILE_OFFSET_BITS=64 -Wdisabled-optimization -Wempty-body -Wformat -Wimplicit-fallthrough -Wparentheses -Wpointer-arith -Wshadow -Wundef -Wvla -Wno-cast-function-type -Wno-format-zero-length -Wno-missing-field-initializers -Wno-sign-compare -Wno-switch -Wno-unused-parameter -fno-math-errno -fno-signed-zeros -fno-trapping-math -Werror=format-security -D_GNU_SOURCE -Wmissing-prototypes -Wstrict-prototypes -Werror=implicit-function-declaration -Wno-pointer-sign -fPIC -pthread -DPL_HAVE_PTHREAD -DPTHREAD_HAS_SETCLOCK -DPL_STATIC -MD -MQ libmpv.so.2.3.0.p/filters_f_lavfi.c.o -MF libmpv.so.2.3.0.p/filters_f_lavfi.c.o.d -o libmpv.so.2.3.0.p/filters_f_lavfi.c.o -c ../filters/f_lavfi.c
In file included from /tmp/mpv-build/build_libs/include/libplacebo/utils/libav_internal.h:45,
from /tmp/mpv-build/build_libs/include/libplacebo/utils/libav.h:293,
from ../filters/f_lavfi.c:35:
/tmp/mpv-build/build_libs/include/libavutil/hwcontext_vulkan.h:44:5: error: unknown type name 'VkVideoCodecOperationFlagBitsKHR'
44 | VkVideoCodecOperationFlagBitsKHR video_caps;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[82/226] Compiling C object libmpv.so.2.3.0.p/demux_demux.c.o
ninja: build stopped: subcommand failed.
You need to have vulkan headers v1.3.238 to build everything.
Ubuntu 22.04.4 LTS provides v1.3.204. So you have to download newer headers or disable vulkan.
@kasper93 Thanks, that indeed solved the issue.
Here's how I solved it for reference: I downloaded Vulkan headers from https://github.com/KhronosGroup/Vulkan-Headers/releases/tag/v1.3.238 . I decompressed the zip file and I executed the command shown below (I got those commands from the file BUILD.md: https://github.com/KhronosGroup/Vulkan-Headers/blob/main/BUILD.md)
$ cd ~/Downloads/Vulkan-Headers-1.3.238/ \
&& cmake -S . -B build/ \
&& sudo cmake --install build --prefix '/usr'
You need to have vulkan headers v1.3.238 to build everything.
Ubuntu 22.04.4 LTS provides v1.3.204. So you have to download newer headers or disable vulkan.
@kasper93 Thanks, how do you know the version requirement?
I also meet the problem and found the solution, but I donot know how to find the version requirement by myself.
Thanks!
Just a quick comment here, disabling Vulkan from mpv itself isn't enough: you also have to disable it from libplacebo. Here's how:
In the ./mpv_options
file:
-Dvulkan=disabled
In the ./libplacebo_options
file:
-Dvulkan=disabled
-Dvulkan-registry=disabled
(IDK if that -Dvulkan-registry
line is necessary, but it probably can't hurt.
I'm trying to build a fork of 0.39.0 release, I've built and installed Vulkan-Headers-1.3.238 but I'm still getting the error unknown type name 'VkVideoCodecOperationFlagBitsKHR'
It doesn't detect the newer headers for some reason, I verified they are in /usr/share/vulkan
mpv-install.txt
EDIT: My mistake. I was correctly installing the headers and then overwriting them by running mk-build-deps.