Skip to content

Instantly share code, notes, and snippets.

@joaquinpf-ds
Last active May 25, 2021 11:40
Show Gist options
  • Save joaquinpf-ds/9c91f0e948191f9e65d1d3bdca7ca81e to your computer and use it in GitHub Desktop.
Save joaquinpf-ds/9c91f0e948191f9e65d1d3bdca7ca81e to your computer and use it in GitHub Desktop.
mpv configuration on Windows
# Skip anime opening/ending
F1 seek -85
F2 seek 85
# Map volume to mouse wheel and up/down keys
AXIS_UP add volume 2
AXIS_DOWN add volume -2
UP add volume 2
DOWN add volume -2
MOUSE_BTN3 add volume 2
MOUSE_BTN4 add volume -2
############################
# Quality related settings #
############################
# Before starting, it is important to understand how some settings influence the video
# quality/performance.
# The most important one is scale and its derivatives (dscale, cscale, tscale).
# Better scalling algorithms result in better images when the video is reproduced in non-native
# resolution, at the expense of performance. However unless you're nitpicking this shouldn't be a
# problem when watching videos. For scale/dscale/cscale, the best algorithms are ewa_lanczos*, but
# they're very slow (needs a high end GPU, specially for downscalling high-resolution videos).
# spline36 is generally good enough (and the default in vo=opengl-hq), while bilinear is the
# default and very fast (but low quality).
#
# tscale is a completely different thing, used only if the option _interpolation_ is active.
# interpolation reduces stuttering caused by mismatches in video FPS and display rate (the majority
# of displays are 60Hz, while videos may have 24Hz or 25Hz and you can't divide cleanly with 60/24
# or 60/25). While it does reduce stuttering, it introduces blur too, so you may deactivate it if
# you don't like.
# There are various algorithms that works well in tscale: oversample, mitchell (default), robidoux
# (and its variation robidouxsharp), gaussian, triangle, catmull_rom, etc. You can get the full list
# by using:
# $ mpv -vo=opengl:tscale=help
# in command line.
# For more informaton see: https://github.com/mpv-player/mpv/blob/master/DOCS/man/vo.rst
#
# backend=dxinterop only works on Windows, and fixes some bad behavior since OpenGL support on
# Windows is so bad. For now, this option does not work reliable in Intel hardware thanks to
# driver bugs. Does not seem to work with NVIDIA Optiomus, see bug:
# https://github.com/mpv-player/mpv/issues/2620
# backend=angle is Windows-only too, and uses ANGLE project to convert OpenGL calls to DirectX 11.
# Since DirectX drivers are much more mature than OpenGL in Windows, this (may) fixes a lot of issues.
# Mimics opengl-vhq, but change some settings.
# More details here: https://github.com/haasn/mpvhq/blob/master/DOCS/man/vo.rst
# Very high/slow quality settings, needs high end GPU and good drivers.
# You may reduce prescale-passes to increase performance at the expense of quality, defaults to 1
# and goes up to 5. Another option is to change the number of nnedi3-neurons, from 16 up to 128.
# vo=opengl-hq:backend=dxinterop:scale=ewa_lanczossharp:cscale=ewa_lanczossoft:interpolation:tscale=mitchell:tscale-clamp:temporal-dither:prescale=nnedi3:prescale-passes=2:nnedi3-neurons=128:nnedi3-window=8x6:blend-subtitles=yes:target-prim=bt.709:target-trc=bt.1886:gamma-auto:icc-profile-auto:3dlut-size=256x256x256
# Using superxbr instead of nnedi3, reducing a lot of GPU workload.
# vo=opengl-hq:backend=dxinterop:scale=ewa_lanczossharp:cscale=ewa_lanczossoft:interpolation:tscale=mitchell:tscale-clamp:temporal-dither:prescale=superxbr:prescale-passes=2:blend-subtitles=yes:target-prim=bt.709:target-trc=bt.1886:gamma-auto:icc-profile-auto:3dlut-size=256x256x256
# Much faster and slightly lower quality variation from above, seems to work with recent Intel GPUs.
# You may set prescale-downscaling-threshold to any value between 1.0 to 1.5 to reduce quality
# and improve performance on HD videos. Lower values are faster/lower quality.
vo=opengl-hq:backend=angle:interpolation:tscale=catmull_rom:tscale-clamp:temporal-dither:prescale=superxbr:prescale-downscaling-threshold=1.5:blend-subtitles=yes:target-prim=bt.709:target-trc=bt.1886:gamma-auto:icc-profile-auto:3dlut-size=256x256x256
# No color correction, better performance and no quality drop (except maybe wrong colors).
# vo=opengl-hq:backend=win:interpolation:tscale=mitchell:tscale-clamp:temporal-dither:prescale=superxbr:prescale-downscaling-threshold=1.5:blend-subtitles=yes
# Finally, fastest settings still including interpolation.
# vo=opengl:backend=win:interpolation:tscale=mitchell:tscale-clamp:blend-subtitles=yes
# In some setups (non-X11, multi-monitor, etc.) display refresh auto-detection is broken.
# Check "Framerate: V=<ignore>/D=<number>" in command line. If the number is "infinite" or simple
# wrong, put the right value below.
# display-fps=60
# Needed for interpolation option above.
video-sync=display-resample
#Playback Speed
speed=1.1
#########################################
# Misc settings, not related to quality #
#########################################
# Enable exclusive mode from WASAPI. By definition prevents sound playback of any other program.
# until mpv exits.
# ao=wasapi:exclusive
# Disable hardware decoder, doesn't help much with the settings above.
hwdec=no
# Reduce default OSD size, the defaults are too big.
osd-font-size=14
sub-text-font-size=40
# Display time elapsed and playtime in the top left corner
# osd-level=3
# Default sub/audio lang.
slang=enUS,en,eng,ptBR,pt
alang=jp,jpn,enUS,en,eng,ptBR,pt
# Output some video stats.
term-playing-msg='Duration: ${duration}, Format: ${file-format}, Resolution: ${width}x${height}, Framerate: V=${fps}/D=${display-fps} Hz'
# For mintty, \r support seems broken.
quiet
# Always on Top
ontop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment