A set of scripts that help build mpv with MoltenVK support.
-
Make sure Xcode is ready by running:
xcodebuild -runFirstLaunch
-
Clone the repository:
git clone "https://github.com/m154k1/mpv-build-macOS.git" cd mpv-build-macOS
-
Install dependencies from Homebrew:
xargs brew install --formula < homebrew/build.txt xargs brew install --formula < homebrew/runtime.txt
-
Create an installation directory for local packages:
sudo mkdir /opt/local sudo chown $USER:admin /opt/local mkdir /opt/local/stow
If you want to use a different directory, export
$PREFIX
environment variable.
-
Vulkan Loader & Vulkan Headers
git -C src clone "https://github.com/KhronosGroup/Vulkan-Loader.git" git -C src clone "https://github.com/KhronosGroup/Vulkan-Headers.git" ./build-vulkan
-
git -C src clone "https://github.com/KhronosGroup/MoltenVK.git" ./build-moltenvk
-
git -C src clone --recursive "https://code.videolan.org/videolan/libplacebo.git" ./build-libplacebo
-
git -C src clone "https://code.videolan.org/videolan/dav1d.git" ./build-dav1d
-
git -C src clone "https://gitlab.freedesktop.org/freetype/freetype.git" git -C src clone "https://github.com/harfbuzz/harfbuzz.git" ./build-freetype -Dharfbuzz=disabled ./build-harfbuzz ./build-freetype
-
git -C src clone "https://github.com/libass/libass.git" ./build-libass
-
git -C src clone "https://git.ffmpeg.org/ffmpeg.git" ./build-ffmpeg
-
git -C src clone "https://github.com/mpv-player/mpv.git" # This will build and install mpv as CLI program ./build-mpv # Alternatively, you can make an app bundle by adding '--bundle' option # This will create mpv.tar.gz with mpv.app ./build-mpv --bundle
-
Add
/opt/local/bin
to your$PATH
.
# ~/.config/mpv/mpv.conf
vo=gpu-next
gpu-context=macvk
-
MTL_HUD_ENABLED=1
Enables the Metal Performance HUD. -
MVK_CONFIG_LOG_LEVEL=3
Enables verbose MoltenVK logging.
graph TD;
mpv-->ffmpeg;
mpv-->libplacebo;
mpv-->vulkan;
mpv-->libass;
libplacebo-->vulkan;
vulkan-->moltenvk;
ffmpeg-->libplacebo;
ffmpeg-->vulkan;
ffmpeg-->dav1d;
ffmpeg-->libass;
ffmpeg-->freetype;
ffmpeg-->harfbuzz;
libass-->freetype;
libass-->harfbuzz;
freetype-->harfbuzz;
harfbuzz-->freetype;