Kindly support DOTSLASHLINUX on Patreon to keep the website up and running while remaining ads free.

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.

12 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!

oldgaro

15/12/2017


thanks!

DOTSLASHLINUX

15/12/2017


@oldgaro, you’re welcome! Glad you found the article useful!

uwu

28/12/2017


i love you dude

DOTSLASHLINUX

28/12/2017


@uwu, Thanks for all the love :P Glad you liked the website!

Lemme know if you needed anything.

Ashraaf

09/01/2018


Thanks for the guide! just one thing i want to ask. If using ‘hwdec=auto’, will it choose one among my ‘va’ available?, or it may not even using ‘va’ at all? Currently i have installed and configured both vaapi and vdpau for my intel graphics.

DOTSLASHLINUX

09/01/2018


@Ashraaf, glad that you found the guide helpful!

I think it’s better to specify ‘hwdec=vaapi’ if you’re using an Intel Integrated GPU as the technology itself ‘VA-API’ was developed by Intel and is used in their integrated GPUs and some AMD/ATI Radeon HD GPUs as well.

Although ‘VD-PAU’ support was being planned for Intel’s Integrated GPUs, I believe it never saw light or was buggy when compared to ‘VA-API’ or its performance wasn’t on the same level as the one used in NVIDIA GPUs.

Leave A Comment