mpv Configuration Guide for Watching Videos

Forewords

I also have a guide for setting up MPC-HC and MadVR if you’re less into tweaking. Other then being slightly less resource efficient at the lower end, imo MPC paired with MadVR is just way more convenient to use.

Table of Contents

These are my recommended settings. Adjust the settings suitable to your system.

Get mpv at mpv.io or custom mpv build w/ vpy enabled configured by me. Just extract the archive to a desired directory. I recommend not using a directory that requires admin/superuser privileges. For Windows, an install script should be included but is not required, as all it does is register mpv for file association. For Mac, there’s also IINA which has a prettier UI although some advanced options may not work and may require more tweaking for power users.

The mpv.conf file can be found in %APPDATA%\mpv on Windows and ~/.config/mpv/ for Linux/Mac. Alternatively, \portable_config\ folder can be used in the mpv executable directory on Windows to make it portable, and will take highest priority over %APPDATA%\mpv.

Read the documentation for all available commands.

To illustrate how the config file works:

# This is a comment.
#inactive-config
active-config # This is a comment.
active-option-value=111
active-option-value=222 # active-option-value is now set to 222 instead of 111. 

Anything behind a # is disregarded by the program as a comment and is inactive. Anytime you write a new line that is present already, it overrides it. This means if you write scale=ewa_lanczossharp, then in the next line write profile=gpu-hq, the scale=spline36 from the gpu-hq profile will override the settings you set earlier.

If you are still using notepad to edit files, I recommend using VSCode, Notepad++ or similar software to edit config files to make your life easier.

GPU Selection

If you have a laptop, you need to select your dedicated graphics for mpv if you wish to use advanced filters/scalers. I don’t have a laptop by me right now, but the power saving option in the screenshot should be the iGPU while the high performance option should be the dedicated GPU.

You need to add the executable to the list if you don’t see it (mpv.exe).

gpu

General mpv Options

Enable this section if you use SVP 4, requires Vapoursynth mpv build.
I also have an SVP 4 guide if you’re interested.

#input-ipc-server=/tmp/mpvsocket # *nix only
input-ipc-server=mpvpipe # Windows only
hwdec=auto-copy
hwdec-codecs=all
hr-seek-framedrop=no
no-resume-playback

Built-in high quality profile. Enables better upscaling algorithm. Recommend GPU minimum of newer Intel Iris iGPU, AMD VEGA 8 iGPU, or NVidia MX150. Add this option at the beginning of the file to prevent overriding options!

profile=gpu-hq

(Optional) Enabled newer Vulkan API. Disable if compatibility/performance issue. May improve performance when running complex shaders. Default has been updated to use 3D311. Set to opengl if you’re having issues.

gpu-api=vulkan

Setup proper color profile to prevent oversaturation on high-gamut monitors. Many IPS monitors these days can achieve near DCI-P3 performance and look oversaturated, especially with the reds/greens. (Oversaturation is pretty on nature videos, but makes human skin look odd and gets old real quick.) If you can calibrate the monitor to get an icc profile, use it. If not, you can set a target primary if you know your display color gamut. Only enable 1 option!

icc-profile="C:\Windows\System32\spool\drivers\color\Example.icc" # Use defined icc file
#icc-profile-auto # Use this if your system has a default icc profile setup already.
#target-prim=dci-p3 # Use this if you don't have a calibrated icc profile, but know your monitor's gamut

Override default language selection order:

alang = 'jpn,jp,eng,en'
slang = 'eng,en,enUS' # enUS for Crunchyroll.

Some other UI options:

keep-open=always # Prevents autoplay playlists. Set to 'yes' to autoload. Both "always" and "yes" prevents player from auto closing upon playback complete.
reset-on-next-file=pause # Resumes playback when skip to next file

window-scale=1 # Set video zoom factor. (High DPI screens want 1.5 or even 2)
autofit-larger=1920x1080 # Set max window size. Can also set something like "75%" to mean max window size is 75% of screen height/width
autofit-smaller=858x480 # Set min window size.

no-osd-bar # Hide OSD bar when seeking.
osd-duration=500 # Hide OSD text after x ms.
osd-font='Trebuchet MS'
#osd-font-size=24

If you have a custom osc.lua, enable this or you will be playing loading roulette with a different or broken OSD every time you open mpv.

osc=no # Disables default OSD. Use this option ONLY if you have a custom osc.lua

Configure network/youtube-dl options:

ytdl-format=bestvideo[height<=?1080]+bestaudio/best # Set max streaming quality as 1080p.
# Default demuxer is 150/75 MB, note that this uses RAM so set a reasonable amount.
demuxer-max-bytes=150000000 # 150MB, Max pre-load for network streams (1 MiB = 1048576 Bytes).
demuxer-max-back-bytes=75000000 # 75MB, Max loaded video kept after playback.
force-seekable=yes # Force stream to be seekable even if disabled.

Screenshot:

screenshot-format=png
screenshot-high-bit-depth=yes
screenshot-png-compression=7 # Setting too high may lag the PC on weaker systems. Recommend 3 (weak systems) or 7.
screenshot-directory="%USERPROFILE%\Pictures\mpv"

Video Config

Denoise filter. Recommend keeping it off unless watching CRT era stuff. (May not work, filter requires vo=vdpau or vo=gpu. See doc.)

#denoise=1

Deband filter. Always turn on for anime. Turned on by default if profile=gpu-hq is set.

deband=yes # Default values are 1:64:16:48

Deband parameters configuration. For Anime, 2:35:20:5 recommended for general use. Use 3:45:25:15 for older DVD, badly mastered BD or WEB streams. Use 4:60:30:30 for really, really bad streams.

deband-iterations=2 # Range 1-16. Higher = better quality but more GPU usage. >5 is redundant.
deband-threshold=35 # Range 0-4096. Deband strength.
deband-range=20 # Range 1-64. Range of deband. Too high may destroy details.
deband-grain=5 # Range 0-4096. Inject grain to cover up bad banding, higher value needed for poor sources.

Note: For older/weaker iGPUs, instead of increasing deband-iterations you may need to increase deband-threshold instead if you need a stronger effect. I recommend 1:60:25:30 if you absolutely must run 1 iteration (lower quality but much less GPU usage).


Dither:
Set to auto for Anime due to 8 and 10 bit encodes. Set to no if your monitor has built-in dither (just leave it at auto if you aren’t sure).

dither-depth=auto

Audio Config

volume=100 # Set volume to 100% on startup.
volume-max=100 # Set player max vol to 100%.

Subtitle Config

Enable if subs are broken or you need legacy ssa support.

demuxer-mkv-subtitle-preroll=yes
#sub-ass-vsfilter-blur-compat=yes
#sub-fix-timing=yes

Enable to modify PGS subs.

#sub-gauss=0.5 # Blur PGS subs.
#sub-gray=yes # Monochrome subs (makes yellow font grey).

Allow loading external subs that do not match file name perfectly.

sub-auto=fuzzy

Default subtitle font when none are specified.

sub-font='Trebuchet MS'
sub-bold=yes # Set the font to bold.
#sub-font-size=55 # Set default subtitle size if not specified.

Advanced Video Scaling Config

Internal Scalers

Note: Press shift + I in mpv to view frame drops. Then press 2 to view frame times and processing layers. Make sure your config does not drop frames and ideally frame times should be <25ms.

scale is the luma upscale method. Prioritize resource on this over cscale.
dscale luma downscale method.
cscale chroma upscale method. Human eyes aren’t as sensitive to chroma compared to luma.

If you enabled profile=gpu-hq earlier, these are the options set by it (no need to include these lines again):

#Scaling algorithm set by profile=gpu-hq
scale=spline36
dscale=mitchell
cscale=spline36

Default gpu-hq should be sufficient for most people, however, here are some suggestions for fine tuning:

I have a Toaster (crappy PC) edition:

scale=bilinear # Set spline16 if possible.
dscale=mitchell
cscale=bilinear

I have an iGPU laptop edition:

scale=spline36
dscale=mitchell
cscale=mitchell

I have a decent GPU (GTX 1050+) edition:

scale=ewa_lanczossharp
dscale=mitchell
cscale=spline36 # alternatively ewa_lanczossoft depending on preference

External Shaders

For those who have really good GPUs (GTX 1060+, sometimes need even better GPU) and want to run external shaders:

Remember to download the shader files and put them in the mpv config folder! ~~/xxx.glsl refers to xxx.glsl file in the mpv config directory.

Always enable profile=gpu-hq before using shaders for fallback at the beginning of the file.

DO NOT COMBINE shaders of the same type mindlessly. Just choose one. You’ll bork the image if you run multiple filters, they’re not designed to work together.

Dynamic Scaler: SSSR
SSSR is a dynamic scaler that improves built-in scalers utilizing structure similarity. Upscale result varies widely depending on your scaler. You may freely choose your preferred one. Moderate to highly GPU intensive. This is my personal favorite due to its versatility.

For a sharper image:

glsl-shader="~~/SSimSuperRes.glsl" # Set B C parameter to Robidoux.
scale=ewa_lanczossharp
dscale=mitchell
cscale=spline64

Alternatively set to haasnsoft for a softer look (much better at artifact/aliasing supression). I found this combo to be very good for anime and performs close to NN based upscalers.

glsl-shader="~~/SSimSuperRes.glsl" # Set B C parameter to Mitchell.
scale=haasnsoft
dscale=mitchell
cscale=ewa_lanczossoft

If you really want to run SSSR on a lower-end GPU, the full power version of MX150 (1D10 25W) should be able to run it if you use the faster algorithms. Results will still be better than spline36. Use bilinear/spline16/spline36 (whichever your GPU can handle without dropping frames) for a sharper image. For anime, if you want a softer anti-aliasing look like haasnsoft, use bicubic.

glsl-shader="~~/SSimSuperRes.glsl" # Set B C parameter to Robidoux for sharper image, else use Mitchell (slightl sharper) or Catrom (default).
scale=bicubic # or bilinear or spline16/36
dscale=mitchell
cscale=mitchell

You can modify the SSSR shader’s cubic B and C parameters (on line 31 and 79) to your needs. Default is Catrom (0,1/2). Set to Mitchell (1/3,1/3) or even Robidoux (0.3782,0.3109) for a sharper image. See this graph.

2x Pre-Scaler: Neural Network Scalers
Some of these shaders require high-end GPUs to run smoothly. 2x pre-scaler means they scale a fixed 2x and should only be used if you have a 4K monitor (1080p x2 = 4K). For NN upscalers, more neurons = better quality but significantly more computational power.
Always remember to set profile=gpu-hq first (at beginning of file).

profile=gpu-hq

Choose 1 of the 2x pre-scalers:

  • FSRCNNX is very good for general use / real-life content, may amplify artifacts (due to it being true to its source). Requires good source material. MadVR equivalent would be NGU-Sharp. Very GPU intensive.
glsl-shader="~~/FSRCNNX_x2_8-0-4-1.glsl"
  • RAVU Lite is relatively lightweight and decent for anime due to the lite version being sharper. I would use SSSR over this due to SSSR being better imo. Moderately GPU intensive.
glsl-shader="~~/ravu-lite-r4.hook"
  • NNEDI3 is designed for anime use. Result is very close to MadVR’s NGU-AA. Very GPU intensive.
glsl-shader="~~/nnedi3-nns32-win8x6.hook"

Remaining:

dscale=mitchell
cscale=spline64 # or ewa_lanczossoft (or your choice, really)

Dynamic Scaler for Anime: Anime4K

Do NOT mix Anime4K with other shaders/scalers.

Anime4K is a unique upscaler + shader designed for Anime. It used to be very destructive, sharpens lines for a… unique “visual quality” look. It works extremely well in some anime and eh in others. Definitely isn’t for everyone. Version 0.9 had lots of flaws (mainly texture banding and line bloating). 1.0RC fixes a lot of the flaws (mainly bad banding) at the cost of doubling GPU consumption. 1.0RC2 optimized GPU usage (even more effecient than 0.9, 1080p > 4K should just barely run on a GTX 1030) and also introduced 2 more speed profiles for even weaker systems (supposedly the fastest profile can run on iGPUs at the cost of shader quality).

The latest 1.0RC2 tones down the “filtered look” even more and serves as an upscaler + filter of {line thinning + line smoothening + sharpening} + artifact/texture-denoiser (reduces jpeg-like edges) combo (note: filter only active when upscaling). One down side to Anime4K compared to other upscalers is that due to line thinning, anime with bad aliasing effects looks even worse (stares at badly made isekai anime magic circles).

Latest Anime4K have multiple glsl files that can be mixed and matched. See documentation for how to set it up for mpv.

# See Anime4K documentation, setup has changed a lot since the 1.0 days.
# Following is an example for v3.1 setup for 1080p scaling + post-processing
glsl-shaders="~~/shaders/Anime4K_Denoise_Bilateral_Mode.glsl;~~/shaders/Anime4K_DarkLines_HQ.glsl;~~/shaders/Anime4K_ThinLines_HQ.glsl;~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl"

For those interested in higher quality downscale:
SSIM downscaler is tuned to be used with mitchell. However, you shouldn’t be downscaling in the first place so just having dscale=mitchell fallback should be good enough.

glsl-shader="~~/SSimDownscaler.glsl" 
dscale=mitchell
linear-downscaling=no

For those inteested in higher quality chroma upscale:
Imo cscale=spline36 is already very good. Human eyes aren’t that sensitive to Chroma compared to Luma. I won’t be surprised if you can’t even tell the difference when simply using cscale=mitchell. However, if you just want the best of the best and have the extra processing power, KrigBilateral is a high quality Chroma upscaler.

glsl-shader="~~/KrigBilateral.glsl"

I always advise testing out settings yourself, “quality” is extremely subjective. For example, in anime, destructive filters (denoise/de-ring/sharpen) upscalers may “look better” visually but not necessarily be true to its source (lower SSIM/PSNR).

If we go purely by measurement, haasnsoft should be a terrible upscaler (and it kinda is with normal content). However, when paired properly with SSSR it looks great in anime. Similarly, NNEDI3 looks better with Anime (as it’s trained for such) despite FSRCNNX is the technically better (accurate) upscaler.

Anime “visual quality” greatly favors algorithms that de-aliases, denoises and sharpens lines to be defined. This is why Anime4K is such a controversial upscaler as it takes these concepts to an extreme.


In terms of algorithm quality (Note: better quality usually = more GPU usage):

abc = abc built-in shader
[xyz] = xyz external shader (requires downloading glsl/hook files)

For scale:
[NNEDI3] or [FRCNNX] > [SSimSuperRes + haasnsoft/ewa_lanczossharp] > ewa_lanczossharp > spline36 > spline16 > bilinear
                <------------------------[Anime4K] (personal preference)------------------------->

For dscale:
[SSimDownscaler] > Mitchell

For cscale:
[KrigBilateral] > spline64 / ewa_lanczossoft / spline36 > mitchell

Upscalers Demo:
Open in new tab to view full size.
2x upscale from 100×54 to 200×108 image (Source: DanMachi).
NNS = nearest neighbor (also interger upscale in this case, essentially original image). mpv default is bilinear. Anime4K shown is older 1.0RC ver.
upscalers

Personal mpv.conf file

Note: I’ve since upgraded my system, current sample file is tailored towards a mid-end desktop with a DCI-P3 monitor intended to be used with SVP. Please modify the file to your needs and not blindly copy-paste.

###--- Enable this section only if you use SVP 4, requires Vapoursynth mpv build ---###
#input-ipc-server=/tmp/mpvsocket # *nix only
input-ipc-server=mpvpipe # Windows only
hwdec=auto-copy
hwdec-codecs=all
hr-seek-framedrop=no
no-resume-playback
###--- End of SVP Section ---###

profile=gpu-hq

#gpu-api=vulkan #Default is now updated to use D3D11 which works better with my current setup.

target-prim=dci-p3 # Clamp video color to display correctly on my DCI-P3 monitor.

# UI/Behavior setup.
alang = 'jpn,jp,eng,en'
slang = 'eng,en,enUS'
keep-open=always
reset-on-next-file=pause
window-scale=1
autofit-larger=75% #Set Resolution (HorizontalxVertical or Screen%, i.e. 1280x720 or 50%)
autofit-smaller=858x480
no-osd-bar
osd-duration=500
osd-font='Trebuchet MS'
#osd-font-size=24

#osc=no # Hide OSC. Use this option ONLY if you have a custom osc.lua

# Configure network/youtube-dl options:
ytdl-format=bestvideo[height<=?1080]+bestaudio/best # Set max streaming quality as 1080p.
demuxer-max-bytes=150000000 # Max pre-load for network streams (1 MiB = 1048576 Bytes).
demuxer-max-back-bytes=75000000 # Max loaded video kept after playback.
force-seekable=yes

# Screenshot:
screenshot-format=png
screenshot-high-bit-depth=yes
screenshot-png-compression=3 # Setting too high may lag the PC.
screenshot-directory="%USERPROFILE%\Pictures\mpv"

# Deband filter. Always turn on for anime.
deband=yes # Default values are 1:64:16:48

# Deband parameters configuration.
deband-iterations=2 # Range 1-16.
deband-threshold=35 # Range 0-4096.
deband-range=20 # Range 1-64.
deband-grain=5 # Range 0-4096.

dither-depth=auto

volume=100
volume-max=100

demuxer-mkv-subtitle-preroll=yes
sub-auto=fuzzy


glsl-shader="~~/shader/SSimSuperResMitchell.glsl"
scale=ewa_lanczossharp
glsl-shader="~~/shaders/KrigBilateral.glsl" # High quality chroma upscaler.

input.conf Config

You may create an input.conf in the same directory as mpvconf to override default shortcuts. Here is a cheatsheet for the default shortcuts:

shortcuts

Keep in mind depending on your country keyboard, you may need to modify the file accordingly. For example, the key = has been ‘incorrectly’ mapped as + for default shortcuts (e.g. alt + = for zoom is mapped as alt + + which won’t work on the US keyboard). This is because in some countries the = key is the + key, and while on the US keyboard they are the same key the + is actually shift + =.

Basically when mapping, a means pressing a, but A means shift + a.

To fix the incorrect zoom shortcut:

Alt+- add video-zoom -0.1
Alt+= add video-zoom 0.1

To modify skip durations and add custom skip shortcuts:
Note that keyframe seeking is much faster (no render lag) but may not be exactly x seconds.

# Seek 5s exact, do not display OSD.
RIGHT no-osd seek  5 exact
LEFT  no-osd seek  -5 exact
# Seek 5s to the closest keyframe.
Ctrl+RIGHT  seek  5
Ctrl+LEFT   seek -5
# Seek 20s exact.
alt+RIGHT no-osd seek 20 exact
alt+LEFT no-osd seek -20 exact

Modify mouse wheel to control volume:

WHEEL_UP add volume 10 # In volume %.
WHEEL_DOWN add volume -10

Add audio delay hotkey:

ctrl+= add audio-delay 0.1 # In seconds.
ctrl+- add audio-delay -0.1

Add subtitle delay:

. add sub-delay +0.042 # 0.042s is 1 frame for a 24fps video
, add sub-delay -0.042

I came from MPC-HC so I remapped many shortcuts to the same keys.
Add full-screen shortcut like that in MPC-HC:

F11 cycle fullscreen

Add screenshot shortcut like that in MPC-HC:

F5 screenshot video # Video stream screenshot (extract video frame).
shift+F5 screenshot # File stream screenshot (video frame + render subtitles/signs)
ctrl+F5 screenshot window # Window screenshot (screenshot current player frame including OSD, shaders, upscale, etc.)

Cycle subtitle & audio like in MPC-HC:

s cycle sub
S cycle sub down # shift + s cycle backwards
a cycle audio

Cycle ASS subs style override:

u cycle-values sub-ass-override "yes" "force" "strip" "no"
ctrl+, add sub-scale -0.05 # Decrease sub size by 5%
ctrl+. add sub-scale 0.05 # Increase sub size by 5%

Cycle adaptive sharpen shader:
Note: Requires AdapSharp glsl in mpv conf directory. When AdapSharp is active sigmoid-upscaling needs to be no.

g change-list glsl-shaders toggle "~~/adaptive-sharpen.glsl"; cycle-values sigmoid-upscaling "no" "yes"; show-text "glsl-shaders='${glsl-shaders}'\nsigmoid-upscaling=${sigmoid-upscaling}"

Cycle deband on/off and weak/medium/strong:
Note: the ‘weak’ first set of deband values here needs to match the values set in mpv.conf or the value order will be messed up (in this specific case 2:35:20:5).

h cycle-values deband "yes" "no"
H cycle-values deband-iterations "2" "3" "4" ; cycle-values deband-threshold "35" "45" "60" ; cycle-values deband-range "20" "25" "30" ; cycle-values deband-grain "5" "15" "30" ; show-text "Deband: ${deband-iterations}:${deband-threshold}:${deband-range}:${deband-grain}" 1000

Visit the wiki or the default input.conf for more info.

mpv Custom Build

Here is a custom built mpv with Vapoursynth enabled (for Windows). Also includes a custom built FFmpeg in the folder. The folder is portable, and the settings are also in the portable folder. The OSC is also custom, delete osc lua and conf files if you want the default back.

Note: \portable_config\ folder takes priority over %APPDATA%\mpv folder. (i.e. \portable_config\mpv.conf will load instead of ~~\mpv.conf.)

Download the 7z or zip archive.

UPDATE: Newer mpv build 7z archive, includes newest Anime4K stuff. HOWEVER, the newer builds post v29 have an OSC bug where it fails to load my custom OSC half the time. If this annoys you, delete ~~\scripts\osc.lua and \script-opts\osc.conf and just use the default UI. I also included the older mpv.exe renamed as mpv.exe.old if you want the older stable executable back, though the newer version should offer better compatability with newer formats such as AV1 and HDR stuff. Important EDIT: Adding osc=no in the config file completely fixes this issue by forcing the original osc to be disabled, thus successfully loading the custom osc.lua. This line is not present in the current provided download so you will need to add it yourself.

Update 2: mpv build. Same as last update but with updated binary/ytdl from shinchiro and no-osc fix.