Skip to main content
mpv reads configuration from files on startup. Options set in config files use the same names as command-line options, but without the leading --. Command-line options override config file settings.

Config file locations

The XDG_CONFIG_HOME environment variable overrides the config directory. If set, mpv uses $XDG_CONFIG_HOME/mpv/ instead of ~/.config/mpv/.Setting MPV_HOME overrides everything: mpv looks for $MPV_HOME/mpv.conf.

Syntax

The configuration file syntax is option=value. Lines beginning with # are comments.
Key rules:
  • Drop the -- prefix from command-line options: --fs becomes fs.
  • Flag options can be enabled by setting them to yes, or just by specifying the option name alone (hwdec implies hwdec=yes).
  • Flag options are disabled with no: fs=no.
  • Values do not need to be quoted unless they contain #, leading/trailing whitespace, or start with ", ', or %.
  • You cannot use --option=value syntax inside config files.

Config directory structure

On Linux, the watch-later directory follows the XDG state directory convention at ~/.local/state/mpv/watch_later/. On macOS it is at ~/.config/mpv/watch_later/. On Windows it is at %LOCALAPPDATA%\mpv\watch_later. The location can be overridden by setting $XDG_STATE_HOME (Linux) or $MPV_HOME (all platforms).
All .lua and .js files placed in ~/.config/mpv/scripts/ are automatically loaded as if passed to --script. Use --load-scripts=no to disable this behavior.

Annotated mpv.conf example

Profiles

Profiles group a set of options under a named section. A profile begins with its name in square brackets. Options that follow belong to that profile until the next profile section or end of file.
Apply a profile on the command line with --profile=<name>:
List all available profiles:
Show the contents of a profile:

Built-in profiles

mpv ships several built-in profiles you can apply directly:

Conditional auto-profiles

Profiles with a profile-cond option are applied automatically when their condition evaluates to true. The condition is a Lua expression that can reference mpv properties.
Conditions that reference frequently-changing properties like playback_time are re-evaluated on every change. Avoid using such properties in conditions to prevent performance issues.
Use p.property_name or get("property-name", default) for more robust property access. Underscores in identifiers are automatically converted to hyphens when looking up properties.

Per-file configuration files

To apply specific options to one file, create a companion config file named <filename>.conf in the same directory as the media file, or in ~/.config/mpv/. You must also enable file-directory config loading:
Example: for a file named movie.mkv, create movie.mkv.conf:
With --use-filedir-conf enabled, mpv also looks for a mpv.conf in the same directory as the file for directory-level settings.

Legacy extension/protocol auto-profiles

A simpler (soft-deprecated) mechanism automatically loads profiles based on the file extension or protocol:
Prefer conditional auto-profiles (profile-cond) for new configurations.

Including other config files

Use include to split your configuration across multiple files: