mpv.conf


This is the extended guide. Click HERE to return to the basic guide.

Last tested build: 20220424-git-9d133eb
Use newer builds at your own risk.

For a more detailed documentation click HERE.
I only offer a tl;dr version for in my opinion “most-used” options.

Keep in mind that all stuff written here is optimized for anime content and might look worse with other content.

If you notice something outdated / wrong or have any question, let me know or ask them on the Discord server.


My config files:

Please don’t simply 1:1 copy the configs. Some settings are there for certain reasons, you probably don’t have. The configs might not run well on every PC anyway.


Want a different opinion?

Check out other mpv guides:
https://kokomins.wordpress.com/2019/10/14/mpv-config-guide/


Stuff that you need for certain options in the guide:

Only download what you actually need/want!

Copy the .hook or .glsl files into the „Shaders“ folder inside the mpv folder (create it, if it doesn’t exist):

Copy the .lua files into the „Scripts“ folder inside the mpv folder (create it, if it doesn’t exist):

  • Autoload – Loads the next video inside the same folder (next episode)
  • Easycrop – Lets you crop black borders
  • webm – Lets you create webm videos
  • (MORE SCRIPTS)

Profile:
#Lazy quality profile which sets some recommended settings 
profile=gpu-hq

#All of the settings can be found further down in the guide
#Setting the profile is not needed, but it doesn't hurt
#You can overwrite the settings without any issue
#Here is a list of the settings "gpu-hq" sets:
scale=spline36
cscale=spline36
dscale=mitchell
dither-depth=auto
correct-downscaling=yes
linear-downscaling=yes
sigmoid-upscaling=yes
deband=yes

#You might want to tweak scale/cscale/dscale better and turn deband for all sources off, since it can result in unnecessary detail loss

Video:
#Video output driver
#Use "gpu-next" for the new and better one (experimental)
#See: https://github.com/mpv-player/mpv/wiki/GPU-Next-vs-GPU
#Some options won't work with "gpu-next". vo=gpu #Called API #Use "opengl" if you have compatibility issues. gpu-api=vulkan #Hardware decoding for whatever your CPU/GPU supports (e.g. 8bit h264 / 10bit h265) #Only should be used when your CPU/GPU are very old, else avoid using it #Use "auto-copy-safe" for the safest result in trade of better performance #You can manually try "dxva2-copy" on Windows, "vaapi" / "vaapi-copy" on Linux or "nvdec" / "nvdec-copy" with a Nvidia GPUs (recommended) hwdec=no

#Gamma correction for a PC screen (sRGB)
#Not needed for a TV screen (Rec.709/Rec.2020)
#Sets the output to sRGB with approximately 2.2 power law gamma
target-trc=srgb
gamma-factor=1.1

For a more detailed explanation about gamma correction, look HERE.


General:
#Always open the video player in full screen
fullscreen=yes


#Don't close the player after finishing the video keep-open=yes
#The last position of your video is saved when quitting mpv save-position-on-quit=yes #Start mpv with a % smaller resolution of your screen autofit=50% #Force seeking (if seeking doesn't work) force-seekable=yes

#Cursor hide in ms
cursor-autohide=100

OSD:
#Don't show a huge volume box on screen when turning the volume up/down
osd-bar=no

There are a lot more settings, but OSD is such a matter of own preference. You can just look them up in the docs to change it to them to your preference if you dislike the defaults.


Audio:
#Default volume of the player
volume=80 

#Max volume of the player
volume-max=100

#Load external audio with (almost) the same name as the video
audio-file-auto=fuzzy

#Audio delay 
#Useful if you're watching with your headphones on PC, but output the video on your Television with a long HDMI cable (counter the delay) 
audio-delay=+0.084

#Passthrough audio without encoding to PCM to your soundbar/soundsystem
#Obviously remove codecs your soundbar doesn't support
#Not recommended, because Interpolation won't work anymore
audio-spdif=ac3,dts,eac3
,dts-hd,truehd

#Dynamic range compression (DRC)
#In theory, turns quieter stuff loader and loader stuff quieter
#It can result in overall worse results
af="acompressor=ratio=4,loudnorm"

Subs:
#Forces showing subtitles while seeking through the video
demuxer-mkv-subtitle-preroll=yes

#Backward compatibility for vsfilter
#Disabling it "no" can result in broken subtitles in older vsfilter subtitles (still recommended)
#Enabling it "yes" can result in broken subtitles in newer libass subtitles sub-ass-vsfilter-blur-compat=no

#THIS OPTION HAS NO EFFECT WITH "vo=gpu-next"
#Subtitle blending in scenechanges (smoother effect)
#This is recommended if you use Interpolation
#Use "video" if you want to render it to video resolution instead, this will display typeset more accurate, but for the cost of sharpness blend-subtitles=yes #Fixes subtitle timing for gaps smaller than 210ms (works with PGS subtitles) sub-fix-timing=yes #Load external subtitles with (almost) the same name as the video sub-auto=fuzzy #Some settings fixing VOB/PGS subtitles (creating blur & changing yellow subs to gray) sub-gauss=1.0 sub-gray=yes #Loads external .ass file for overwriting the styles of the current subtitles sub-ass-styles=C:\mpv\template_advanced.ass #Some settings overwritting the default Arial for .srt subtitles (or .ass if you force it) sub-font=Andika New Basic Bold sub-font-size=52 sub-blur=0.2 sub-border-color=0.0/0.0/0.0/1.0 sub-border-size=3.0 sub-color=1.0/1.0/1.0/1.0 sub-margin-x=100 sub-margin-y=50 sub-shadow-color=0.0/0.0/0.0/0.25 sub-shadow-offset=0

Priority:
#Audio language priority
alang=ja,jp,jpn,en,eng,de,deu,ger

#Subtitle language priority
slang=en,eng,de,deu,ger

Screenshot:
#Turns on software rendering for screenshots
#Faster, but might lack stuff like HDR
screenshot-sw=yes

#Output format of screenshots screenshot-format=png #Same output bitdepth as the video #Set it "no" if you want to save disc space screenshot-high-bit-depth=yes #Compression of the PNG picture (1-9) #Higher value means better compression, but takes more time screenshot-png-compression=1 #Quality of JPG pictures (0-100) #Higher value means better quality screenshot-jpeg-quality=95 #Output directory screenshot-directory="C:\Pictures" #Name format you want to save the pictures screenshot-template="%f-%wH.%wM.%wS.%wT-#%#00n"

You make screenshots with the “s” hotkey.


Dither:

You can skip this part, because the default values are already fine.

#Use "auto" or "8"/"10"/"12" depending on your display bitdepth
#Can lead to ugly outputs when you set the wrong bitdepth number
dither-depth=auto

#Selects the dithering algorithm
#"error-diffusion" HAS NO EFFECT WITH "vo=gpu-next" #Use "error-diffusion" with high-end GPUs (experimental), else use "fruit" dither=fruit #THIS OPTION HAS NO EFFECT WITH "vo=gpu-next"
#Selects the kernel in case of error-diffusion #"sierra-lite" is the fastest choice with decent results, alternatives are "floyd-steinberg" (slow), "atkinson" (slower) and "jarvis-judice-ninke" (slowest) error-diffusion=sierra-lit

Deinterlace:

For an explanation what deinterlace is, click HERE.

You activate deinterlace with the “d” hotkey.
Only use it with interlaced sources (like MPEG2/h264 .ts files)


Deband:

For an explanation what debanding is, click HERE.
For an explanation what grain is, click HERE.
Important: The “deband-pre” shader is a requirement for that: CLICK HERE.

#THIS OPTION HAS NO EFFECT WITH "vo=gpu-next"
#Apply debanding before other shaders (like static noise)
glsl-shader="C:\mpv\Shaders\deband-pre.glsl"

#Debanding on all videos #Set it "no" if you rather handle it with profiles or a key (recommended)
#Debanding videos where it isn't needed can result in detail loss deband=yes #Deband steps (More = Better quality, but higher GPU cost) deband-iterations=4 #Deband strength (More = Less banding, but more detail loss) deband-threshold=48 #Deband range (More = Less banding, but higher GPU cost) deband-range=16 #Dynamic Grain (More = More dynamic grain) #Set it to "0" in case you prefer the static grain shader deband-grain=24

You activate debanding with the “h” hotkey.


Scaling:

For a more detailed upscaling guide, I would advice you to look HERE.

Important scaling settings:

#THIS OPTION HAS NO EFFECT WITH "vo=gpu-next"
#Don't upscale if the video has the same resolution as your screen
#You should disable it, if you use glsl-shader for scaling (except "FSRCNNX") scaler-resizes-only=no #Extend the filter size when downscaling with convolution based filters
correct-downscaling=yes

#Light downscaling method
linear-downscaling=yes

#Light upscaling method
#"sigmoid-upscaling" creates less ringing and better results overall
linear-upscaling=yes
sigmoid-upscaling=yes

For an explanation what a resizer is, click HERE.
Don’t use Anime4K, because it’s not a real upscaler!
With the “i” hotkey you can see how many delayed and dropped frames you have. With clicking “2” after that (changing to the 2nd page) you can see if shaders are loaded properly.

Note:
“cscale” doesn’t exist with “vo=gpu-next”. It’ll use the same as “scale” or “dscale” (depending on if you up- or downscale).

Normal: Regular scaler
Italic: Irregular scaler: Look at (4*) for sinc (with blackman)
Italic & Underlined: Based on a shader: Look at (1*) for FSRCNNX/ravu/nnedi3, look at (2*) for SSimDownscaler, look at (3*) for KrigBilateral

PRESETS LUMA
UPSCALE
LUMA
DOWNSCALE
CHROMA
UP- & DOWNSCALE
Experimental FSRCNNX_x2_8-0-4-1
Ultra ravu-zoom-r4*
nnedi3-nns256-win8x4 *
SSimDownscaler KrigBilateral
Very High ravu-r4*
ravu-lite-r4*
SSimSuperRes

ravu-r4 (YUV/RGB version)*
High ewa_lanczossharp *
ewa_lanczos
ewa_lanczos ewa_lanczossharp *
ewa_lanczos
Medium spline64
spline36
spline16
spline64
spline36
spline16
sinc (with blackman)
Low catmull_rom catmull_rom catmull_rom
Very Low bicubic_fast bicubic_fast bicubic_fast

Note: Different Spline is a matter of preference. “Experimental” are choices that should look better than “Ultra”, but are pretty destructive in certain cases, so not “safe to use” for your everyday usage.

* Ravu: Try a lower “r” variant like r3 or r2 if your GPU can’t handle r4.
* Nnedi3: Try a lower “nns” like 128 or 64 if your GPU can’t handle 256.
* With “vo=gpu-next” use the following instead:

#ewa_lanczossharp
scale=ewa_lanczos
scale-blur=0.981251

Regular scaler:

#Luma upscale 
scale=... 
For example: scale=bicubic_fast

#Luma downscale 
dscale=... 
For example: dscale=bicubic_fast

#Chroma up- & downscale
cscale=... 
For example: cscale=bicubic_fast

Luma (scale/dscale) = Brightness (black & white) information
Chroma (cscale) = Colour information
Luma is more visible for the human eye.
A better resizer means higher GPU cost.

Irregular scaler:
(4*)

sinc (with blackman):

cscale=sinc
cscale-window=blackman
cscale-radius=3

Based on a shader:

#Shaders which override "scale"/"dscale"/"cscale" to a certain point (depending on the shader you use)
glsl-shader= ...

(1*) nnedi3 and ravu are only upscaling the video with a power of 2. For example, if your clip is 1280×720 and your screen 1920×1080, the video gets upscaled to 2560×1440. That means “someone” still needs to downscale it. In that case, the “dscale” you set up.

FSRCNNX:
Important: The “FSRCNNX” shader is a requirement for that: CLICK HERE.

glsl-shader="C:\mpv\Shaders\FSRCNNX_x2_8-0-4-1.glsl"
scale=ewa_lanczos

FSRCNNX is really sharp and depending on the source quality can look either really great or really awful. Something like “FSRCNNX_x2_16-0-4-1.glsl” delivers better sharpness, but is only possible real-time if you’ve a really high-end setup.

nnedi3:
Important: The “nnedi3” shader is a requirement for that: CLICK HERE.

glsl-shader="C:\mpv\Shaders\nnedi3-nns32-win8x4.hook"
scale=ewa_lanczos (or any other scaler)

Higher “nns” means more neurons (usually better quality).
Don’t use “win8x6”, “win8x4” is less prone to bugs.

ravu:
Important: The “ravu” shader is a requirement for that: CLICK HERE (if you’ve gpu-api=opengl) or CLICK HERE (if you’ve gpu-api=vulkan).

glsl-shader="C:\mpv\Shaders\ravu-r4.hook"
scale=ewa_lanczos (or any other scaler)
glsl-shader="C:\mpv\Shaders\ravu-lite-r4.hook"
scale=ewa_lanczos (or any other scaler)
glsl-shader="C:\mpv\Shaders\ravu-zoom-r4.hook"
scale=ewa_lanczos (or any other scaler)

Higher “r” means higher radius (usually better quality), but also slower performance.

Important:
Ravu only upscales if “video resolution:screen resolution” is below the threshold 0.707106. In other words, if you have a 1080p video, but a 1440p screen you get the value 0.75 which is below 0.707106, so ravu isn’t used for upscaling. If you want to change that behavior, open the .hook file and replace every “0.707106” with at least “0.750001” in that case.

ravu-lite-4: Faster and sharper than ravu-r4, but like FSRCNN it tends to oversharp aliasing and creates some halos/ringing.
Comparison: https://slow.pics/c/XjPJrhTr | It’s up to you what you rather prefer.
ravu-zoom-r4: Decent sharpness with slighly better results than ravu-r4, but much slower.

(without addition)= only luma
-chrome = only chroma
-yuv = luma and chroma
-rgb = same as “yuv” but different colour encoding system

(2*)

SSimDownscaler:
Important: The “SSimDownscaler” shader is a requirement for that: CLICK HERE.

glsl-shader="C:\mpv\Shaders\SSimDownscaler.glsl"
dscale=gaussian (or any other scaler like "ewa_lanczos")
linear-downscaling=no

(3*)

KrigBilateral:
Important: The “KrigBilateral” shader is a requirement for that: CLICK HERE.

glsl-shader="C:\mpv\Shaders\KrigBilateral.glsl"
cscale=mitchell (or any other scaler like "ewa_lanczos")

Static Grain:

For an explanation what static grain is, click HERE.
Important: The “Static Noise Luma” & “Static Noise Chroma” hooks are a requirement for that.

#Luma
glsl-shader="C:\mpv\Shaders\noise_static_luma.hook"

#Chroma
glsl-shader="C:\mpv\Shaders\noise_static_chroma.hook"

If you use scaling shaders like “nnedi3”, “ravu”etc., make sure you run grain shaders after them. Don’t forget to tune the “STRENGTH” inside the shader to your screen resolution!


Anti-Ringing:

For an explanation what anti-ringing is, click HERE.

#Luma upscale deringing (Higher = Less rining, but more detail loss)
scale-antiring=0.7

#Luma downscale deringing (Higher = Less rining, but more detail loss)
dscale-antiring=0.7

#Chroma upscale deringing (Higher = Less rining, but more detail loss)
cscale-antiring=0.7

Interpolation:

For an explanation what interpolation is, click HERE.

#Set the fps as the max. of your monitor Hz (only useful and needed with "interpolation=yes)
video-sync=display-resample

#Activate interpolation
interpolation=yes

#Interpolation method [look at the table below]
tscale=...

#THIS OPTION HAS NO EFFECT WITH "vo=gpu"
#Trade smoothness for performance (disables dynamic updates)
interpolation-preserve=no
Smoothness/Sharpness Interpolation
Sharpest oversample
Sharper linear
Sharp catmull_rom
Smooth mitchell
Smoother gaussian
Smoothest bicubic

A different approach, using “quadric” (doesn’t work with “vo=gpu-next”) or “sphinx ” instead, should give better results overall with some fine tuning.

tscale=sphinx
tscale-blur=0.6991556596428412 tscale-radius=1.0 #lower (e.g. 0.955) = sharper; higher (e.g. 1.005) = smoother tscale-clamp=0.0

Streaming:

It’s possible to direcly stream content with mpv, as long as the website is supported by yt-dlp.
You simply open a command line and do the following:

<path_to_mpv> <link_to_episode>

Example:
"C:\mpv\mpv.exe" https://www.crunchyroll.com/de/chihayafuru/chihayafuru-3-doku-794440

Or if you want it even simpler, you can use an extension like “ff2mpv“.
As for configuration, there are some options:

#If you want to exclude a certain codec (for example VP9 & Opus)
#With YouTube this one will result in h264 + AAC playback
ytdl-format="(bestvideo[vcodec!=vp9]/bestvideo)+(bestaudio[acodec!=opus]/bestaudio)"

#Only playback videos with 1080p (or lower) instead of highest resolution
ytdl-format="bestvideo[height<=?1080]+bestaudio/best"

#It's also possible to combine both
ytdl-format="(bestvideo[height<=?1080][vcodec!=vp9]/bestvideo)+(bestaudio[acodec!=opus]/bestaudio)"

HDR:

Method 1: Displaying HDR content [Windows only].
You’ve to manually toggle “HDR” to “On” for your “Windows HD Colour settings”.

#Needed for HDR playback
vo=gpu
gpu-api=d3d11
d3d11-output-csp=pq
blend-subtitles=no


#Not needed, but recommended
hwdec=no
dither-depth=no
fullscreen=yes

Method 2: Displaying HDR and dynamic HDR content [Recommended].

#Needed for HDR playback
vo=gpu-next
gpu-api=vulkan
target-colorspace-hint=yes


#Not needed, but recommended
hwdec=no
dither-depth=no
fullscreen=yes

Note: Make sure your TV has at least 600 Nits (1000+ Nits are optimal) and a true 10bit panel — not just “8bit+FRC” (fake HDR). HDMI 2.1 is recommended for at least 60Hz 4:4:4/RGB 10bit. With HDMI 2.0 you’ve to lower the Hz of your TV to at least 30 or change the colour format to 4:2:2/4:2:0 to make it work with 10bit.


HDR -> SDR:

Use this if you want to display HDR content on a SDR screen or dislike the “effect” of HDR.

#Method of converting HDR to SDR
#Good alternatives are: "mobius" or "reinhard" tone-mapping=hable
hdr-compute-peak=yes
#(if you use "hable")

Auto-Profiles:

Important: The “Auto-Profiles” script is a requirement for that.

#You can set up functions like debanding automatically for some sources
#Every profiles thats with a name [TestProfile]
#Then you add a condition - String match p.filename, "" is the interesting part here
#There are also other conditions, but doing it by string with filename is the easiest one
#For this example it will detect everything with the name "TestFile" in it

[TestProfile]
profile-cond=string.match(p.filename, "TestFile")~=nil
deband=yes

[TestProfile-Revert]
profile-cond=string.match(p.filename, "TestFile")==nil
deband=no

In some cases where you need special characters like “-“, you’ve to use “%” for recognizing it as a character and not function:

[Test-Profile]
profile-cond=string.match(p.filename, "Test%-File")~=nil
deband=yes

There also also much more ways, here are some example profiles:

[yuv420source]
profile-desc=cond:((p["video-params/pixelformat"] == "yuv420p10" or p["video-params/pixelformat"] == "yuv420p"))
glsl-shader="C:\mpv\Shaders\KrigBilateral.glsl"

[not1080pbut720pOrHigher]
profile-desc=cond:((p["video-params/h"] >= 720 and p["video-params/h"] < 1080))
glsl-shader="C:\mpv\Shaders\FSRCNN_x2_r2_16-0-2.glsl"
scale=ewa_lanczos

%d bloggers like this: