Configuring mpv (the best media player in existence)

mpv is without doubt the best video player that I’ve used. But it isn’t necessarily well equipped by default. Let me share what configuration I use.

The files that we are editing are ~/.config/mpv/input.conf and ~/.config/mpv/mpv.conf which are used for Input configuration and General configuration respectively. Create the files if needed. I’ll explain what each line does below.

Scripts folder

Put this file in the scripts folder ~/.config/mpv/scripts (create the folder if it doesn’t exist). This is an autoload script which plays the next file (episode) in the folder after the one completes.

https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autoload.lua

You can add other scripts too if you want, however this is the only one that I use.

mpv.conf

vo=gpu-next
gpu-api=vulkan
hwdec=vaapi
ao=pipewire
autofit=50%
save-position-on-quit
tone-mapping=bt.2446a
tone-mapping-mode=luma

What they does

  1. vo=gpu-next Specifies the video output
  2. gpu-api=vulkan Specifies the video api (vulkan>opengl)
  3. hwdec=vaapi Specifies the hardware decoding api (vaapi recommended). Delete line if un-needed
  4. ao=pipewire Specifies the audio output
  5. autofit=50% Takes up only 50% of the screen when a file is opened
  6. save-position-on-quit Continues playing from where you closed
  7. tone-mapping=bt.2446a and tone-mapping-mode=luma HDR (Dolby Vision, HDR10) —> SDR tone mapping. Necessary for watching HDR content on SDR displays.

input.conf

UP add volume 5
DOWN add volume -5
h cycle deband

What they does

  1. UP add volume 5 Increases volume by 5%
  2. DOWN add volume -5 Decreases volume by 5%
  3. h cycle deband The “h” key on the keyboard toggles debanding