Optimal mpv Configuration

mpv
Firas Khalil Khana | 31/03/2017

In this article I’ll show you how to setup mpv and arm it up with the best mpv.config file (in terms of performance and resource usage).


1- Installation


Gentoo Linux:

emerge --sync && emerge -av media-video/mpv


Void Linux:

xbps-install -Su && xbps-install -S mpv


Arch Linux:

pacman -Syu mpv

2- Setup Configuration Files


To setup your local mpv configuration files, navigate to your home directory. From there you’ll have to go to the hidden folder .config. Create a directory called mpv (if it doesn’t exist) and enter it:

mkdir ~/.config/mpv && cd ~/.config/mpv


Now we’ll have to create two files. The first being mpv.conf which controls mpv’s settings and the second being input.conf which controls mpv’s key bindings:

touch ~/.config/mpv/mpv.conf ~/.config/mpv/input.conf

3- mpv’s Settings (mpv.conf)


After setting up the previous files, it’s time to do some configuration! I’ve got a nice configuration file to arm mpv with. For maximizing quality over performance choose the following settings:

profile=opengl-hq
scale=ewa_lanczossharp
cscale=ewa_lanczossoft
dscale=mitchell
scale-antiring=0.7
cscale-antiring=0.7
dither-depth=auto
correct-downscaling=yes
sigmoid-upscaling=yes
deband=no
volume-max=100
hwdec=auto


However, if you were on a laptop and wanted the best quality settings with the least CPU usage, you have to enable VAAPI (for example on your integrated Intel Graphics Card), which will result in lower resource usage, smaller memory footprint and the videos will still look as good. To do that just change line 12 from hwdec=auto to hwdec=vaapi:

profile=opengl-hq
scale=ewa_lanczossharp
cscale=ewa_lanczossoft
dscale=mitchell
scale-antiring=0.7
cscale-antiring=0.7
dither-depth=auto
correct-downscaling=yes
sigmoid-upscaling=yes
deband=no
volume-max=100
hwdec=vaapi


Please do note that using vo=opengl-hq is deprecated. Use profile=opengl-hq instead.


4- mpv’s Key Bindings (input.conf)


You can really tweak this file to your liking. I didn’t tamper with the default keybindings for mpv, but the mousewheel seeking through the video thing had me go nuts. So I remapped the mousewheel to control the video’s volume:

MOUSE_BTN3 add volume 5
MOUSE_BTN4 add volume -5


In my case MOUSE_BTN3 and MOUSE_BTN4 referred to scrolling up and down respectively.

6 Comments

follower

01/04/2017


niiicccce

DOTSLASHLINUX

10/04/2017


@follower , Thanks! Feedback is much appreciated :D

Rami Rahmeh

13/04/2017


Brilliant

DOTSLASHLINUX

13/04/2017


@Rami Rahmeh, Thanks a lot!

Superman

27/04/2017


Coool!

DOTSLASHLINUX

27/04/2017


@Superman, Thanks!

Leave A Comment

Become a Patron

If you liked the website and wanted to keep it up and running while remaining ads free then kindly consider supporting DOTSLASHLINUX on Patreon.

Patreon

A huge thank you to all DOTSLASHLINUX patrons:

Crosby Smith (1st Patron)

Recommended Distributions

Gentoo Linux Void Linux Arch Linux

Upcoming Articles

  • Best QEMU and KVM Configuration for Windows Guests on Linux Hosts