mpv Is Nice

I’ve been watching movies and TV using an Emacs interface since 2004, according to the movie.el file.  Under the hood, though, I’ve hacked away at mplayer to make it do what I want, which includes a convenient way to switch audio outputs and output progress info so that I can store that to restart the video in the same place I left off.

And various bits and bobs.

But with the advent of 4K Bluray, it seems like mplayer just doesn’t hack it anymore.  So I started watching 4K material with mpv and the rest with mplayer.

And then I got a new TV machine (because the old one wasn’t fast enough to play Crouching Tiger, Hidden Dragon in 4K) and, as usual, mplayer didn’t really want to compile on the new Debian version, so I thought it was time to switch completely to mpv.

I thought I was going to have to do the same hacking on mpv as mplayer, but it turns out that mpv is really nice: It has almost all the features I need, and in a very pleasant-to-work-with interface: Just talk to mpv by sending JSON via a Unix-domain socket.

The only thing it didn’t have was a way to set the screensaving prefix on-the-fly (which I need for making GIFs), so I hacked that in.  The mpv people have really cleaned up the mplayer source code, I have to say.  Everything is nice and logical and clean, apparently, and I adding the feature took like 15 minutes.  Kudos.  I’ll try upstreaming the patch… if I can figure out how the mpv people like receiving patches.

Just one note on building mplayer and FFmpeg: Some things in Debian break if you have the new FFmpeg libraries in /usr/local, so put it somewhere else.  In case somebody needs to build mpv from git in Debian, this is what works for me, and is non-breakey:

/usr/src/ffmpeg $ ./configure ‐‐prefix=/usr/plocal ‐‐enable-gnutls 
/usr/src/ffmpeg $ make
/usr/src/ffmpeg $ sudo make install
/usr/src/ffmpeg $ cd /usr/src/mpv
/usr/src/mpv $ PKG_CONFIG_PATH=/usr/plocal/lib/pkgconfig meson setup build
/usr/src/mpv $ meson compile -C build

And then the mpv executable is in /usr/src/mpv/build/mpv, and can just live there without being installed.

Leave a Reply