mpv for anime

Settings (and some scripts) I've found to be great for anime with mpv. I think I've managed to (almost) match the image quality of madvr (MPC-HC/NGU algorithm). Used this as a reference for some of the settings.

Stuff used in the article

Custom shader settings

Decreased the strength of Anime4K_ThinLines_HQ.glsl from 0.6 to 0.01 and increased iterations from 1 to 20:

#define STRENGTH 0.01 //Strength of warping for each iteration
#define ITERATIONS 20  //Number of iterations for the forwards solver, decreasing strength and increasing iterations improves quality at the cost of speed.

mpv.conf for image quality

Refresh rate reported by the OS can be verified with testufo.

profile=gpu-hq

###### Display ######
# Refresh rate of the monitor (143.856 = 6* 23.976, which is the standard video framerate)
override-display-fps=143.856
# 'display-vdrop' is basically the same as 'audio', but with better debugging in Shift+i menu
# Read more about this here: https://mpv.io/manual/master/#options-video-sync
video-sync=display-vdrop

###### DX on Windows (recommended)
gpu-api=d3d11
fbo-format=rgba16hf
###### OpenGL on Linux (recommended)
# gpu-api=opengl
# fbo-format=rgba16f
###### Vulkan on Linux/Windows (currently blurrier)
# gpu-api=vulkan
# fbo-format=rgba16hf

###### Shaders ######

###### Luma up
glsl-shader="C:\path\to\mpv\shaders\SSimSuperRes.glsl"
scale=ewa_lanczossharp

###### Luma down
glsl-shader="C:\path\to\mpv\shaders\SSimDownscaler.glsl"
linear-downscaling=no
dscale=mitchell

###### Chroma up + down
glsl-shader="C:\path\to\mpv\shaders\KrigBilateral.glsl"
cscale=mitchell

###### Sharpen
# Didn't find this too useful with the SuperRes shader.
# glsl-shader="C:\path\to\mpv\shaders\adaptive-sharpen.glsl"
# sigmoid-upscaling=no
# linear-upscaling=no

###### Thinlines
glsl-shader="C:\path\to\mpv\shaders\Anime4K_ThinLines_HQ.glsl"

###### Antiring
scale-antiring=0.7
dscale-antiring=0.7
cscale-antiring=0.7

###### Debanding
deband=yes
deband-iterations=4
deband-threshold=35
deband-range=16
deband-grain=4

Other settings in my mpv.conf

###### General
keep-open=yes
snap-window=yes
cursor-autohide=1000
save-position-on-quit
# No huge box on screen when turning the volume
osd-bar=no
osd-font-size=32
volume=100
volume-max=100
# A hotkey for this inside input.conf (k cycle audio-exclusive)
audio-exclusive=no

###### Lang & Sub (good for Japanese)
# Hide subtitles by default
sub-visibility=no
alang=jp,jpn,ja,en,eng
slang=jp,jpn,ja,en,eng
sub-auto=fuzzy
sub-font='Arial'
sub-font-size=40
sub-border-size=1
sub-shadow-color=0.0/0.0/0.0/0.50
sub-shadow-offset=2

###### Screenshots
screenshot-format=webp
screenshot-webp-lossless=yes
screenshot-high-bit-depth=yes
screenshot-sw=no
screenshot-directory="C:\path\to\screenshots"
screenshot-template="%f-%wH.%wM.%wS.%wT-#%#00n"

input.conf

z          ignore

##### General
w          no-osd cycle sub-visibility
s          cycle sub
S          cycle sub down
F1         add sub-delay -0.1   
F2         add sub-delay +0.1
F5         no-osd screenshot
k          cycle audio-exclusive
p          add panscan -0.1
P          add panscan +0.1

WHEEL_UP   add volume   2
WHEEL_DOWN add volume  -2
RIGHT      seek   2 exact
LEFT       seek  -2 exact
UP         seek   5 exact
DOWN       seek  -5 exact
Ctrl+RIGHT seek  20 exact
Ctrl+LEFT  seek -20 exact

##### mpvacious
q          script-binding mpvacious-sub-seek-back
e          script-binding mpvacious-sub-seek-forward
x          script-binding mpvacious-sub-rewind

##### Better Chapters
MOUSE_BTN7 script_binding chapter_prev
MOUSE_BTN8 script_binding chapter_next

##### Bookmarker Menu
B          script_message bookmarker-menu
b          script_message bookmarker-quick-save
ctrl+b     script_message bookmarker-quick-load

animated avatar

By Marko Leinikka