Skip to content

Instantly share code, notes, and snippets.

@dbrookman
Last active February 26, 2026 01:41
Show Gist options
  • Select an option

  • Save dbrookman/74b8bcfb37a23452f7137b83bca9580f to your computer and use it in GitHub Desktop.

Select an option

Save dbrookman/74b8bcfb37a23452f7137b83bca9580f to your computer and use it in GitHub Desktop.
How to build mpv & mpv.app on an Apple silicon Mac

Preparations

Before you can build mpv & mpv.app on an Apple silicon Mac, there's a couple of required dependencies you'll need to install if you haven't already:

  1. Go to System Preferences > Software Update. If there's anything there to update, do it.

  2. If you don't have the Xcode Command Line Tools installed, run xcode-select --install and select Install on the prompt that appears.

  3. If you don't have Homebrew installed, follow the instructions here.

  4. If you don't have all of mpv's dependencies installed, run brew install --build-from-source --only-dependencies mpv && brew install libplacebo.

You'll also need a local copy of the mpv repo, which you can get by running git clone https://github.com/mpv-player/mpv.

You can now run the attached script to build mpv & mpv.app on an Apple silicon Mac yourself. Just make sure to run it from the root directory of the cloned repo.

Static Build

If you want to bundle a static build of mpv.app, perform these steps following the ones above.

  1. Run brew install dylibbundler.

  2. Run the script from the root directory of the cloned repo, but append --static to the command, like ./build-mpv_silicon.sh --static.


Updating

Going forward, you can update your local copy of the repo by running the following commands from its root directory:

git reset --hard
git clean --force -d -x
git pull origin master
#!/usr/bin/env bash
# Builds mpv & mpv.app on Apple silicon Macs.
# Run this script from the root directory of the mpv repo.
# if anything fails, gtfo
set -ex
meson setup build
meson compile -C build
# test the binary we just built
./build/mpv --version
./TOOLS/osxbundle.py --skip-deps build/mpv
if [[ $1 == "--static" ]]; then
dylibbundler --bundle-deps --dest-dir build/mpv.app/Contents/MacOS/lib/ --install-path @executable_path/lib/ --fix-file build/mpv.app/Contents/MacOS/mpv
# test the app binary to make sure all the dylibs made it okay
./build/mpv.app/Contents/MacOS/mpv --version
fi
@pxia
Copy link

pxia commented Aug 31, 2025

change the mpv repo in my script to their git head

@tano70
Copy link

tano70 commented Aug 31, 2025

I can't understand what you're saying. If you explain exactly what I need to do or what I need to download, I'm already using your script.
I have compiled mpv with your script after the updates released a few days ago on Homebrew for ffmpeg (version 8) and mpv, which had made my previous mpv non-functional.
Now mpv works, I don't understand how your suggestion can help me in the future, with other homebrew updates, to avoid it breaking again and always requiring a new compilation

@LampPrinter
Copy link

Is there any update to the script? I am getting an error when compiling using --static.

@amnah
Copy link

amnah commented Feb 25, 2026

Is there any update to the script? I am getting an error when compiling using --static.

there's no need for this script anymore because you can download it directly now

cli - brew install mpv
gui - https://nightly.link/mpv-player/mpv/workflows/build/master

@nwparker
Copy link

Is there any update to the script? I am getting an error when compiling using --static.

there's no need for this script anymore because you can download it directly now

cli - brew install mpv gui - nightly.link/mpv-player/mpv/workflows/build/master

brew install mpv (the formula) only installs the CLI binary — no .app bundle, no Spotlight. You need the cask version for that.

Instead:
brew install --cask mpv

@mcp73
Copy link

mcp73 commented Feb 26, 2026

gui - https://nightly.link/mpv-player/mpv/workflows/build/master

I get strange washed out colors on video on my external USB-C SDR monitor when using git head and this nightly build. Everything is fine with v0.41.0 stable release from Dec 21, 2025, so maybe a bug in the dev branch. Anyone else seeing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment