Issue with Enabling Shaderc, D3D11, and Vulkan Features in MPV Cross Compilation on Ubuntu #14389
Replies: 3 comments 3 replies
-
meson wrapdb doesn't have shaderc yet, so you'll have to build it yourself or create a wrap for it (you can refer to win32 ci) |
Beta Was this translation helpful? Give feedback.
-
@kasper93 and @Andarwinux
Cross file configuration:
|
Beta Was this translation helpful? Give feedback.
-
You need to build shaderc and spirv-cross and add them to your build root. Both the mingw and win32 CI builds do this.
You need to configure pkg-config to use your cross sysroot. Please refer to
I'm afraid not. We, as the mpv team, are not able to provide individual technical support for cross-compiling software. The compile-windows.md guide already contains extensive details. There are multiple scripts available that automate the tasks you are asking about. You can find these at https://github.com/mpv-player/mpv/blob/master/ci. All the necessary build steps are standard for this task. There are numerous guides and documentation available online. You can even ask some LLM, it will give you full solution. I don't mean to sound harsh, but while we have provided a guide on how to start and build mpv, we cannot provide a guide for building every single dependency you might want to use. It is not feasible. All issues you are facing are not related to mpv in any way, you can try to ask in respective dependencies issue trackers, if they are willing to help cross compile. Also they might have already similar guides as mpv. I encourage others to help, but I personally do not have additional advice on this topic.
This is possible, but except for build testing, I would not recommend using these wrappers for production builds. Using the upstream build system is better, as CMake support in Meson is subpar. For guidance on how to do it with pkg-config, please refer to https://github.com/mpv-player/mpv/blob/master/ci/build-mingw64.sh. Note that if there is upstream wrap for some dependency using subproject is fine, but wrapping CMake is tricky.
There is luajit wrap that will work out of the box. |
Beta Was this translation helpful? Give feedback.
-
System Details:
Description:
I am following the steps outlined in the MPV documentation for cross-compiling on Windows: MPV Compilation Guide. I successfully built 32-bit and 64-bit versions of MPV, and the standalone MPV is able to play. However, I need to add full-fledged features, and I am encountering issues enabling certain features.
Meson Setup Command:
meson setup --wrap-mode=forcefallback -Ddefault_library=static -Dprefer_static=true \ -Dc_link_args='-static' -Dcpp_link_args='-static' \ -Dffmpeg:default_library=static -Dffmpeg:tests=disabled -Dffmpeg:programs=disabled -Dffmpeg:sdl2=disabled -Dffmpeg:vulkan=auto \ -Dlcms2:fastfloat=true -Dlcms2:jpeg=disabled -Dlcms2:tiff=disabled \ -Dlibusb:tests=false -Dlibusb:examples=false -Dlibplacebo:demos=false \ -Dlibplacebo:lcms=enabled -Dlibplacebo:shaderc=enabled -Dlibplacebo:d3d11=enabled \ -Dvulkan=enabled -Dd3d11=enabled -Dxxhash:inline-all=true -Dxxhash:cli=false \ -Ddrm=disabled -Dlibarchive=disabled -Drubberband=disabled -Dwayland=disabled \ -Dx11=disabled -Djavascript=enabled \ --cross-file /home/x86_64-w64-mingw32.txt build
Errors:
Run-time dependency shaderc found: NO (tried pkgconfig, pkgconfig, pkgconfig and system)
Run-time dependency libsixel found: NO (tried pkgconfig and cmake)
Run-time dependency spirv-cross-c-shared found: NO (tried pkgconfig and cmake)
meson.build:1005:28: ERROR: Feature d3d11 cannot be enabled: Either is not a win32 desktop or shaderc nor spirv-cross were found!
meson.build:1285:9: ERROR: Dependency lookup for vulkan with method 'pkgconfig' failed: Pkg-config for machine host machine not found. Giving up.
subprojects/libplacebo/src/glsl/meson.build:2:10: ERROR: Dependency lookup for shaderc with method 'pkgconfig' failed: Pkg-config for machine host machine not found. Giving up.
subprojects/libplacebo/src/d3d11/meson.build:8:2: ERROR: Dependency lookup for spirv-cross-c-shared with method 'pkgconfig' failed: Pkg-config for machine host machine not found. Giving up.
Cross File:
[binaries]
c = 'x86_64-w64-mingw32-gcc'
cpp = 'x86_64-w64-mingw32-g++'
ar = 'x86_64-w64-mingw32-ar'
strip = 'x86_64-w64-mingw32-strip'
windres = 'x86_64-w64-mingw32-windres'
dlltool ='x86_64-w64-mingw32-dlltool'
exe_wrapper = '/usr/lib/wine/wine64'
[properties]
needs_exe_wrapper = true
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
Attempts:
Request:
Could someone provide guidance on how to successfully enable shaderc, d3d11, and vulkan features for cross-compiling MPV with the above configuration? Any help or suggestions would be greatly appreciated.
@kasper93 Could you please suggest as i checked you are the one who updated windows cross compile doc
observation :
difference
debug result (MPV built by here https://sourceforge.net/projects/mpv-player-windows/ ) - working well
Using hardware decoding (d3d11va).
(+) Video --vid=1 (*) (h264 3840x2160 30.000fps)
VO: [gpu] 2560x1080 d3d11[nv12]
[KV: 00:00:00 / 00:00:04 (0%)
MPV built by me
Using hardware decoding (d3d11va-copy).
â—� Video --vid=1 (*) (h264 3840x2160 30 fps)
VO: [gpu] 2560x1080 nv12
V: 00:00:00 / 00:00:04 (0%)
thank you
Beta Was this translation helpful? Give feedback.
All reactions