Hint: You can get ready to use builds here.
Introduction
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
- Only for <10.9:
- Install Xcode from App Store
- Install Command Line Tools from Xcode -> Preferences -> Downloads
- 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. - Install some other needed stuff:
sudo easy_install docutils
- 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
- If you want to have an .app-bundle in ~/Applications:
brew linkapps mpv
-
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.
Yep, works fine now.
Thanks for your help!
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.
Works for me on 10.8
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.
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.
ooooooor, use the binaries.
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.
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.
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?
Having issues with mpv and the new 10.9.2 upgrade. Is it happening to anyone else?
Does anyone know how to change the Aspect Ratio to 16:9
Complete newb here.
I followed the steps above but my screenshots are not working/getting an error message.
How can I fix this?
slight addition to this, brew install –HEAD mpv-player/mpv/libass-ct no longer works.
Use brew install –HEAD libass-ct instead
Is there any way to make mpv play consecutive files? Like if you’re marathoning a show and you want it to keep playing.
yeah, opening multiple files.
Any way to increase subtitle sizes with an add-on or something?
Yes, but it’s too complicated for you. (Read the manual)
Anyone care to refer me to a tutorial on how to understand this article?
open ~/.mpv/config just results in :”The file /Users/I’m retarded/.mpv/config does not exist.”
What am I doing wrong?
maybe .. you have to create it first?
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.
Configure after everything else is done.
And if you are so bad you really should be using the binaries instead.
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.
So just to be clear, the config file has to be a .txt file right? Not a .conf file?
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.
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.
you may need libjpg or something
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?
Can we have 10.6/10.7 support? How can I compile it for 10.6?
Thanks!
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.
Yes, just install all dependencies with Homebrew (or something else), check out mpv’s repo … and read the README.
>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.
Thanks, I updated it.
We got that from the official brew site, so that’s already updated.
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.
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.
I follow this guide on Os X 10.10 Yosemite and it works like a charm.
Thank you for this amazing guide
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.
@anon352523
config file is now located at ~/.config/mpv/
you can edit it via text edit.
@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?
The config needs to be named “mpv.conf”, I added it to the guide.
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
–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/
The corevideo VO got removed, use opengl instead.
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
For some reason –native-fs option doesn’t work anymore in recent builds. Has it been changed to something different?
I’ve created a config file and added “screenshot-template=~/Desktop/mpv_screenshot_%n”, but still get “Error writing screenshot”.
Wait just figured it out, config file had to be in ~/.mpv as “config”. Not sure why.
Because your mpv version is outdated.
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.
@Matt: SMPlayer now has support for mpv. For Linux, just install the latest version and switch from MPlayer to mpv in the settings.
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
This is my configuration for Macbook Air: http://pastebin.com/vJbGmF08
For headphones and with highest rendering quality possible.
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?
hello,
is there any pssiile way to get MPV installed on a Powerbook G4 / Powermac G5 via TIGERBREW?
thanks!
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.
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.
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.
Latest build has uchardet support.
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?
No. The builds don’t have any special default settings.
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.
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.
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!
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.
Just enable the additional features in the mpv formula, just like in the guide. Brew will install the necessary dependencies.
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.
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.