Compiling mpv on Mac OS X

Note: This guide is outdated and won’t be updated anymore.

Hint: You can get ready to use builds here.

Introduction

958b8d1019b8cb77e5c9c37f0b26fb13

This is a guide to compiling mpv, a fork of the MPlayer family and the current recommended media player on *nix. It has more active development and some features like nicer CLI output, an On Screen GUI and high quality OpenGL video output.
This will ensure you are using the latest, most up-to-date high quality playback that you can get for OS X.
This guide is targeted at advanced users and assumes basic commandline-knowledge. This guide may not always be up to date, so you may have to do your own research. mpv on OS X requires at least 10.7.

Installation

  1. Only for <10.9:
  2. Install Homebrew by running the command
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    in a Terminal, install the Command Line Tools when asked.
  3. Install some other needed stuff: sudo easy_install docutils
  4. Build mpv and the needed dependencies using homebrew:
    The command lines you'll need are:

    • export LC_ALL=en_US.UTF-8 ; export LANG=en_US.UTF-8
    • brew install --HEAD --with-bundle --with-bluray-support --with-libdvdread --with-little-cms2 --with-lua --with-bundle mpv
  5. If you want to have an .app-bundle in ~/Applications: brew linkapps mpv
  6. Done!

Configuration

To set mpv as the default program to open .filetypes, get Finder-info on the filetype you want to associate, select mpv.app under Open with: and click the “Change All…” button. You can view options and keybinds here or by typing man mpv into Terminal. You can quit this dialogue any time by pressing q. mpv can also be launched by typing mpv into Terminal, dragging the file into the terminal window and hitting enter.

To make your own configuration, create the folders ~/.config/mpv and create the file mpv.conf in there. Paste the the options you want to change in that file (see mpv’s documentation for all possible options).

If you have sufficient GPU power, it is recommended to use the opengl-hq video-output (requires Intel HD4000 or better). To use this add this line to your config:
vo=opengl-hq:icc-profile-auto

Notes

  • Remember to keep everything up-to-date using brew update. Since mpv is on –HEAD, brew update won’t work for it. You need to uninstall and reinstall (brew rm mpv && brew install --HEAD --with-bundle --with-bluray-support --with-libdvdread --with-little-cms2 --with-lua --with-bundle mpv), as it’s a HEAD only formula homebrew is not smart enough to figure out the version it built.
  • Having MacPorts or Fink installed may break brew. See brew doctor if you run into problems.
  • If you have problems, join the #mpv channel on freenode or open an issue on the Github page. Please use the comments here only for problems related to CGi releases.

Original guide written by valtism. Modified.

155 Responses to Compiling mpv on Mac OS X

  1. steenuil writes:

    Yep, works fine now.
    Thanks for your help!

  2. HamsterCurry writes:

    Hey I managed to compile mpv on os x 10.9 pretty much using the same steps above. The only extra steps I needed to take was installing python via homebrew for sudo easy_install docutils to work and using brew doctor to link some files for waf to install.

    It seems they changed the Colour Profile in 10.9 so you will have to watch out for that too if you’re using pigoz’s configuration otherwise you will get no video output and only have audio.

  3. Amaury writes:

    Works for me on 10.8

  4. Ace writes:

    Caveat about doing this on the new Macbook Pro Retina: The color profile that comes with the machine has a space in the name, which if substituted directly will cause the config file not to parse properly. I fixed this personally by creating a copy of the color profile and replacing the space with a dash.

  5. drosan writes:

    Not working on 10.9 like that; mpv needs docutils, docutils could be installed only with pip (which is not from homebrew but from sudo easy_install T_T) and pip doesn’t work because of old setuptools package which is a part of the default python installation. Off course it is possible to solve it all but I don’t like an idea of transforming my OS X to Slackware =) Its much easier to use VLC.

  6. Kintaro writes:

    Regarding the builds:
    – Can I find or access a listing for keyboard shortcuts somewhere?
    – And it seems screenshots can be taken by pushing “s” but whenever I do it it says “Error writing screenshot!” Is it an issue in the build or something wrong on my end?

    Also thank you for the builds, saves me time and work to dig myself through the whole setup process.

  7. misiekkb writes:

    I have problem with font subtitles and OSD. I no see OSD and subtitles.
    Error [osd/libass] can’t find selected font provider. How I might fix this.

  8. HamsterCurry writes:

    Hey can anyone explain the difference between rgb16 and rgb32f for fbo-format? They say some os x setups might be faster with rgb32f instead of the default rgb16 for opengl-hq? Why?

  9. 10.9.2 writes:

    Having issues with mpv and the new 10.9.2 upgrade. Is it happening to anyone else?

  10. aksjdb writes:

    Does anyone know how to change the Aspect Ratio to 16:9

  11. Kamo writes:

    Complete newb here.

    I followed the steps above but my screenshots are not working/getting an error message.

    How can I fix this?

  12. Kuchiru writes:

    slight addition to this, brew install –HEAD mpv-player/mpv/libass-ct no longer works.
    Use brew install –HEAD libass-ct instead

  13. Kamo writes:

    Is there any way to make mpv play consecutive files? Like if you’re marathoning a show and you want it to keep playing.

  14. Kamo writes:

    Any way to increase subtitle sizes with an add-on or something?

  15. Anonymous writes:

    Anyone care to refer me to a tutorial on how to understand this article?

  16. I'm retarded writes:

    open ~/.mpv/config just results in :”The file /Users/I’m retarded/.mpv/config does not exist.”
    What am I doing wrong?

  17. I'm retarded writes:

    At what point am I to configure mpv in steps 1-5? I’ve been trying after following all 5 steps. Also after attempting a re-install, now I cannot create an app from step 5 even though the command line is accepted. Sorry man, I’m really bad at this.

    • ChrisK writes:

      Configure after everything else is done.

      And if you are so bad you really should be using the binaries instead.

  18. I'm retarded writes:

    Okay so I have mpv built and can play videos with it, but I am still getting the /.mpv/config file does not exist message. Please help.

  19. I'm also retarded writes:

    So just to be clear, the config file has to be a .txt file right? Not a .conf file?

  20. Pablo writes:

    The .mpv folder is hidden, FYI.

    Open Terminal and enter “open ~/.mpv/”. The folder is now open, with the hidden .mpv folder. Inside of it, you can find the config file. Open it with Textedit, add pigoz’s latest config and save it. Mpv should now be able to show the video.

  21. micheal99 writes:

    I’m trying the experimental builds but I can only take screenshots in png format. I’ve edited the config file to add screenshot-format=jpg but mpv seems to ignore the option.

  22. rniso writes:

    I got everything down and ready and it’s amazing. The only thing I don’t understand is the updating part. I basically run Terminal and put in the highlighted command?

  23. MacBook Air writes:

    Can we have 10.6/10.7 support? How can I compile it for 10.6?

    Thanks!

  24. usingsystem8 writes:

    Is there a way to build an osx binary of mpv without Homebrew?
    I want to build it with an option ‘–enable-vda-hwaccel’. There isn’t the option in the brew options list.

    • ChrisK writes:

      Yes, just install all dependencies with Homebrew (or something else), check out mpv’s repo … and read the README.

  25. endless_cat writes:

    >Whoops, the Homebrew installer has moved! Please instead run:

    ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

    Also, please ask wherever you got this link from to update it to the above.

  26. Morisummer writes:

    Is mpv retina aware? I noticed that mpv uses a lot more GPU power when I’m using the Scaled – More Space setting in Display than when I use the Best (Retina) setting. My theory is that mpv would output 1080p video at 3840*2160 then downscale to 2800×1800.

    • ChrisK writes:

      This is most likely what is happening. I’m not sure if it is possible to make it render at the display resolution instead of the virtual desktop resolution.

  27. somallg writes:

    I follow this guide on Os X 10.10 Yosemite and it works like a charm.
    Thank you for this amazing guide

  28. Anon352523 writes:

    For some reason the folder at ~/.mpv/ doesn’t even exist, so I’m not sure how to add the config file. Mpv installed fine, and it works fine, but I’m not sure how to edit the config.

  29. KCAS writes:

    @anon352523

    config file is now located at ~/.config/mpv/

    you can edit it via text edit.

  30. Anon352523 writes:

    @KCAS

    thanks, I found the folder but the config file wasn’t there. Made one called config.txt but its not working so I assume it’s named something else?

  31. decimer writes:

    I suggest to modify reinstall (brew rm mpv && brew update && brew upgrade && brew cleanup && brew install –HEAD –with-bundle –with-bluray-support –with-libdvdread –with-libquvi –with-little-cms2 –with-lua mpv).
    As there are no reminders that you use out dated version of Homebrew

  32. fer writes:

    –hwdec=vda –vo=corevideo

    [vo] Video output corevideo not found!
    Error opening/initializing the selected video_out (-vo) device

    Using latest build from http://sva.wakku.to/~chris/mpv_builds/

  33. fer writes:

    Using –hwdec=vda –vo=opengl or openl-old uses hardware decoding and mpv consumes around 10% CPU but the fans kick in and make noise whereas same mp4(h264, aac) video in quicktime player uses less than 10% cpu with fans at minimum rpm.

    Core 2 Duo Macbook
    Nvidia 9400m

  34. Anon42 writes:

    For some reason –native-fs option doesn’t work anymore in recent builds. Has it been changed to something different?

  35. Sar writes:

    I’ve created a config file and added “screenshot-template=~/Desktop/mpv_screenshot_%n”, but still get “Error writing screenshot”.

  36. Sar writes:

    Wait just figured it out, config file had to be in ~/.mpv as “config”. Not sure why.

  37. Matt writes:

    I apologize if this is the wrong place to ask this. I really like mpvs playback abilities but not a fan of the on screen controls. Is there anything based on mpv with a better OSC?

    There used to be cmplayer but I believe that project is dead.

  38. kamineko writes:

    @Matt: SMPlayer now has support for mpv. For Linux, just install the latest version and switch from MPlayer to mpv in the settings.

  39. kamineko writes:

    Oops, sent without the next sentence.

    For Mac, you are on your own to get the Mac SMPlayer version compiled. From what I saw here, getting it compiled with MacPorts should be easy if you don’t need MPlayer: http://blog.zyxar.com/2008/25

  40. Muratcan Simsek writes:

    This is my configuration for Macbook Air: http://pastebin.com/vJbGmF08

    For headphones and with highest rendering quality possible.

  41. asoksevil writes:

    As @fer has previously pointed out:
    Using –hwdec=vda –vo=opengl or openl-old uses hardware decoding and mpv consumes around 10% CPU but the fans kick in and make noise whereas same mp4(h264, aac) video in quicktime player uses less than 10% cpu with fans at minimum rpm.

    I am seeing the same issue here, why?

  42. richard writes:

    hello,

    is there any pssiile way to get MPV installed on a Powerbook G4 / Powermac G5 via TIGERBREW?

    thanks!

  43. George writes:

    Now that Quicktime+Perian is obsolete there’s a huge need for one good, all encompassing player. Something that’s like mplayerx but uses mpv instead. vlc and mosxe are a joke.

  44. asoksevil writes:

    Hi ChrisK,

    Thank you for your effort!

    I´ve been wondering if it would be easy to add an auto-update feature so we don´t have to constantly check your website for updated builds.

  45. yunaitong writes:

    Hi, ChrisK,

    Thank you for your nice build!

    Can you please add uchardet feature to your builds? I am a Chinese user, and this char set detection feature is very important for us.

  46. Paul writes:

    In your ready to use builds, is opengl-hq the default video output setting?

    Or do we have to add those lines (vo=opengl-hq:icc-profile-auto) as well in the config for it?

  47. Denis writes:

    Did you remove the font.conf file in your recent builds for OS X? It seems my old font.conf does not work anymore. But build in 8/27/15 still works with font.conf, I am not sure if I did something wrong here, but I just want to load extra user fonts with mpv, hope you could provide a way to do it, thanks.

    • ChrisK writes:

      New builds use CoreText to find fonts instead of fontconfig, so no more fonts.conf. Just install fonts normally on your system, mpv should find them.

  48. asoksevil writes:

    I suppose the auto update function won´t be implemented anytime soon… 🙁

    How do you install new builds? You just copy and replace them?

    Thanks!

  49. Helium writes:

    Hi, ChrisK,

    A good how-to, but could you give me some additional advice? In the latest update of mpv, the new introduced function “auto-detect sub charset” by uchardet is very useful for me. So how to compile a build with uchardet support by myself on OS X? I already have homebrew installed and I can build mpv build without enca/uchardet support from source successfully.

    • ChrisK writes:

      Just enable the additional features in the mpv formula, just like in the guide. Brew will install the necessary dependencies.

  50. Paul writes:

    I’d like to report a performance regression in your ready to use builds.

    Starting from mpv_20150910090118_git-b4abcbd.tar.bz2 and newer builds, my videos show choppy playback if I have vo=opengl-hq:icc-profile-auto in the config.

    Granted my graphics chipset is Nvidia 9400m, and you do say we should have Intel HD4000 or higher… but opengl-hq video output used to work smoothly on mpv_20150908101030_git-0eb72d7.tar.bz2 and older builds.

    • ChrisK writes:

      opengl-hq alias options were recently changed, look up what options the opengl-hq alias maps to and then remove one until you find the offending one, start with pbo.