# Mpv

mpv is a movie player based on mplayer and mplayer2. It supports a wide variety of video file formats, audio and video codecs, and subtitle types. A comprehensive (although admittedly incomplete) list of differences between mpv and the aforementioned players can be found here.

## Installation

Install the mpv package from the official repositories or mpv-git from the AUR. Alternatively, you can install the cmplayer or cmplayer-git Qt 5 front-ends, which provide their own mpv.

## Configuration

System-wide configuration is done in `/etc/mpv/mpv.conf`, while user configuration and key bindings are done in `~/.mpv/config` and `~/.mpv/input.conf` respectively. For example configuration files, see `/usr/share/doc/mpv/examples/example.conf` and `/usr/share/doc/mpv/examples/input.conf`.

Tip: If you prefer a custom location for your user configuration file, set the `MPV_HOME` environment variable as you like. A predictable choice is `MPV_HOME="~/.config/mpv"`.

## Tips and Tricks

### Hardware Decoding

Unlike mplayer and mplayer2, mpv has both VDPAU and VAAPI support built in. To enable one of these methods for video decoding, run mpv with `--hwdec=method` appended to the command, where method is one of the outputs of `mpv --hwdec=help`. To make this persistent, add the line `hwdec=method` to your configuration file. With `--hwdec=vaapi` or `--hwdec=vdpau`, the video output should be specified as `--vo=opengl` (preferred) or `--vo=vaapi` (or `--vo=vdpau`, depending on the `--hwdec=method` in use). If hardware decoding cannot be used, mpv will automatically fall back to software decoding. See options.rst and vo.rst for more information.

Note: Most video filters are not usable with hardware decoding unless the decoded frames are first copied back to system memory, processed, and then uploaded to the GPU memory again. This is slow and not recommended, but in VAAPI’s case it can be done with `--hwdec=vaapi-copy`.

### Automatically resuming from where you left off

The default key to quit mpv,saving the video's current position and state, is `Shift+q`. This key can be changed by adding the `quit_watch_later` string in the key bindings configuration file.

### Volume is too low

Set `softvol-max=value` in your configuration file to a reasonable amount, such as `softvol-max=600`. Additionally (or alternatively), you can utilize dynamic range compression with `af=drc`.

### Quickly cycle between multiple aspect ratio

Append this line to your configuration file:

    ~/.mpv/input.conf

    F2 cycle_values aspect "16:9" "16:10" "4:3" "2.35:1" "-1"

You should now be able to cycle between the provided aspect ratios.

### Drawing to a root window

Run mpv with `--wid=0 file.mp4`. This tells mpv to draw onto a window with a window ID of 0.

### Use as a browser plugin

With the help of mozplugger, mpv can be used in a supported browser to play all sorts of video files. See Browser_plugins#MozPlugger for configuration details. Make sure to install mozplugger-chromium as well if you use chromium. This coupled with a user script such as ViewTube, allows you to use mpv in place of a site's integrated video player.

Category:

- Player