official manual, arch mpv page (which i deem to b a must-read)
Dependencies: libsixel, lua52, sndio, unzip
This repository works via Emacs Org-mode tangling. Sections of this readme
are tangled to mpv.conf
, input.conf
and sources
file which contains links to all
external scripts i use. Save this file once and those files will be created.
Then run ./mpvmanager
without an argument to get all scripts downloaded to
proper directories. Run ./mpvmanager sync
to download only missing (or if you
added new scripts to this readme). It won’t delete scripts that you removed from
readme, cuz i deemed such functionality as overly complex, remove those by hand.
External Sources of this config:
- https://wiki.archlinux.org/title/mpv <– READ WHOLE
- https://github.com/hl2guide/better-mpv-config
- https://raw.githubusercontent.com/classicjazz/mpv-config/master/mpv.conf
# DO NOT ALTER! This config is tangled from README
pause=no # disables autoplay
border=no # hides the window title bar
# Sets the profile restore method to "copy if equal"
profile-restore=copy-equal
no-input-builtin-bindings
save-position-on-quit=yes # saves the seekbar position on exit
force-seekable=yes # forces videos to be seekable
vlang=en,eng # Sets the video language
# Uses GPU-accelerated video output by default.
# https://github.com/mpv-player/mpv/wiki/GPU-Next-vs-GPU
vo=gpu # gpu-next <- experimental video renderer based on libplacebo
profile=gpu-hq # Can cause performance problems with some GPU drivers and GPUs.
# scale=ewa_lanczossharp
dscale=mitchell
volume-max=100 # maximum volume in %, everything above 100 results in amplification
volume=70 # default volume, 100 = unchanged
display-fps-override=60
video-sync=display-resample
interpolation=yes
tscale=oversample # smoothmotion
blend-subtitles=yes
sub-auto=fuzzy # Enable fuzzy searching:
Use SHARP to assign the #
key.
- List of commands and further details: DOCS/man/input.rst
- List of special keys: –input-keylist
- Keybindings testing mode: mpv –input-test –force-window –idle
Use ‘ignore’ to unbind a key fully (e.g. ‘ctrl+a ignore’).
Strings need to be quoted and escaped: KEY show-text “This is a single backslash: \ and a quote: " !”
# THIS FILE IS BEING TANGLED FROM README
# If this is enabled, treat all the following bindings as default:
default-bindings start
Note: All key bindings below that are bound to _
are defined as leader ones in
my leader script.
# always exact seeks (non-keyframe-limited).
# Don't show them on the OSD (no-osd).
l no-osd seek 10 exact
h no-osd seek -10 exact
RIGHT no-osd seek 5 exact
LEFT no-osd seek -5 exact
[ multiply speed 1/1.1 # decrease the playback speed
] multiply speed 1.1 # increase the playback speed
> multiply speed 2.0 # double the playback speed
< multiply speed 0.5 # halve the playback speed
0 set speed 1.0 # reset the speed to normal
SPACE cycle pause # toggle pause/playback mode
PLAY cycle pause # toggle pause/playback mode
PAUSE cycle pause # toggle pause/playback mode
PLAYPAUSE cycle pause # toggle pause/playback mode
PLAYONLY set pause no # unpause
PAUSEONLY set pause yes # pause
j add volume -5
k add volume 5
m cycle mute # toggle mute
# Quitting
# q quit
Q quit-watch-later # exit and remember the playback position
# q {encode} quit 4
ESC set fullscreen no # leave fullscreen
ESC {encode} quit 4
# toggle displaying information and statistics (https://mpv.io/manual/master/#stats)
i script-binding stats/display-stats-toggle
` script-binding console/enable # open the console
Ctrl+F cycle fullscreen # toggle fullscreen
Alt+v cycle video # switch video track
# cycle the video aspect ratio ("-1" is the container aspect)
Alt+Ctrl+v cycle-values video-aspect-override "16:9" "4:3" "2.35:1" "-1"
# take a screenshot of the video in its original resolution without subtitles
Ctrl+S screenshot video
H no-osd sub-seek -1 # seek to the previous subtitle
L no-osd sub-seek 1 # seek to the next subtitle
my own scripts
get M-x-rofi script https://raw.githubusercontent.com/Seme4eg/mpv-scripts/master/M-x-rofi.lua
get M-x-rofi options https://raw.githubusercontent.com/Seme4eg/mpv-scripts/master/script-opts/M_x_rofi.conf
get leader script https://raw.githubusercontent.com/Seme4eg/mpv-scripts/master/leader.lua
get leader module https://raw.githubusercontent.com/Seme4eg/mpv-scripts/master/script-modules/leader.lua
get leader options https://raw.githubusercontent.com/Seme4eg/mpv-scripts/master/script-opts/leader.conf
get shaders-rofi script https://raw.githubusercontent.com/Seme4eg/mpv-scripts/master/shaders-rofi.lua
dbvol - volume control using decibels
get dbvol script https://gist.githubusercontent.com/Artefact2/0a9c87d6d0f0ef6a565e44d830943fff/raw/c841063304a98f99371ce28e0b14ade609e8185c/dbvol.lua
j script-binding dbvol/decrease-db
k script-binding dbvol/increase-db
Fills the black bars on the side of a video with a blurred copy of its edges.
NOTE slows everything down a lot + triggers only on fullscreen toggle
get blur_edges script https://raw.githubusercontent.com/occivink/mpv-scripts/master/scripts/blur-edges.lua
get blur_edges options https://raw.githubusercontent.com/occivink/mpv-scripts/master/script-opts/blur_edges.conf
Alt+b script-binding blur-edges/toggle-blur
quack temporarily reduce the volume after a seek
get quack script https://raw.githubusercontent.com/CounterPillow/mpv-quack/master/quack.lua
conf_file=quack.conf
! config_exists quack && echo "ducksecs=1" >"$conf_file"
ctrl+r
to reload if anything is wrong / stuck
get reload script https://raw.githubusercontent.com/sibwaf/mpv-scripts/master/reload.lua
Ctrl+r script-binding reload/reload
get undoredo script https://raw.githubusercontent.com/Eisa01/mpv-scripts/master/scripts/UndoRedo.lua
u script-binding UndoRedo/undo
r script-binding UndoRedo/redo
U script-binding UndoRedo/undoLoop
lilskippa fast forward to scene/black/silence
– This script defines the following keybinds: – – % skip2scene – skip2scene fast forwards to the next scene change – ^ skip2black – skip2black fast forwards to the next black video segment – & skip2silence – skip2silence fast forwards to the next silent audio segment
get lilskippa script https://raw.githubusercontent.com/AN3223/dotfiles/master/.config/mpv/scripts/lilskippa.lua
thumbfast High-performance on-the-fly thumbnailer for mpv.
get thumbfast script https://raw.githubusercontent.com/l-jared/thumbfast/master/thumbfast.lua
get thumbfast options https://raw.githubusercontent.com/l-jared/thumbfast/master/thumbfast.conf
uosc Feature-rich minimalist proximity-based UI for MPV player.
get_uosc() {
config_dir="${XDG_CONFIG_HOME:-~/.config}"
mkdir -pv "$config_dir"/mpv/script-opts/
rm -rf "$config_dir"/mpv/scripts/uosc_shared
wget -P /tmp/ https://github.com/tomasklaen/uosc/releases/latest/download/uosc.zip
unzip -od "$config_dir"/mpv/ /tmp/uosc.zip
rm -fv /tmp/uosc.zip
get uosc options https://github.com/tomasklaen/uosc/releases/latest/download/uosc.conf
}
if [ $command == sync ]; then
[ ! -d ./scripts/uosc ] && get_uosc
else
get_uosc
fi
Config:
# required so that the 2 UIs don't fight each other
osc=no
# uosc provides its own seeking/volume indicators, so you also don't need this
osd-bar=no
# uosc will draw its own window controls if you disable window border
border=no
# uosc respects this setting
# osd-font='Iosevka'
# And these doesn't
# osd-font-size=45
# osd-scale=0.5
get SmartCopyPaste script https://github.com/Eisa01/mpv-scripts/raw/master/scripts/SmartCopyPaste.lua
- SSimDownscaler, SSimSuperRes, Krig, Adaptive Sharpen, etc. -
- SSimDownscaler: Perceptually based downscaler.
- SSimSuperRes: make corrections to the image upscaled by mpv built-in scaler.
- Krig: Chroma scaler that uses luma information for high quality upscaling.
- FidelityFX CAS - AMD FidelityFX Contrast Adaptive Sharpening (CAS) - sharpen and optionally scale an image.
- FidelityFX FSR - AMD FidelityFX Super Resolution is a spatial upscaler.
- NVIDIA Image Scaling - spatial scaling and sharpening algorithm.
- Anime4K
get NVScaler shader https://gist.github.com/agyild/7e8951915b2bf24526a9343d951db214/raw/05f00864228871ffd157daa9beb2db8fa7412cfa/NVScaler.glsl
get NVScaler shader https://gist.github.com/agyild/7e8951915b2bf24526a9343d951db214/raw/05f00864228871ffd157daa9beb2db8fa7412cfa/NVSharpen.glsl
get FSR shader https://gist.github.com/agyild/82219c545228d70c5604f865ce0b0ce5/raw/2623d743b9c23f500ba086f05b385dcb1557e15d/FSR.glsl
get SSimDownscaler shader https://gist.github.com/igv/36508af3ffc84410fe39761d6969be10/raw/575d13567bbe3caa778310bd3b2a4c516c445039/SSimDownscaler.glsl
glsl-shader="~~/shaders/NVScaler.glsl"
[fastforward]
profile-restore=copy-equal
scale=bilinear
dscale=bilinear
cscale=bilinear
vd-lavc-skiploopfilter=all
vd-lavc-skipframe=all
# GIF Files
[extension.gif]
profile-restore=copy-equal # Sets the profile restore method to "copy if equal"
profile-desc=gif
cache=no
no-pause
loop-file=yes
# WebM Files
[extension.webm]
profile-restore=copy-equal # Sets the profile restore method to "copy if equal"
profile-desc=webm
no-pause
loop-file=yes
[protocol.http]
profile-restore=copy-equal # Sets the profile restore method to "copy if equal"
profile-desc=http
hls-bitrate=max # use max quality for HLS streams
cache=yes
no-cache-pause # don't pause when the cache runs low
[protocol.https]
profile-restore=copy-equal # Sets the profile restore method to "copy if equal"
profile-desc=https
profile=protocol.http
[protocol.ytdl]
profile-restore=copy-equal # Sets the profile restore method to "copy if equal"
profile-desc=ytdl
profile=protocol.http
take any script that SIMPLY logs history and pipe it to rofi
Example of line format in history.log file (see how it forms here):
[Wednesday/September 06/09/2023 19:17:52] "output.lq.mp4" | https://dl4.vibio.tv/f064277c672d45c35a49426dca2020f7/2839/2839278/output.lq.mp4 | length=5367.4472335601 | time=5367.4100453432
IDEA [#B] mpv-webtorrent-hook
several deps, view installation section in docs
IDEA cycle-denoise
IDEA mpv-skipsilence and skiptosilence
https://github.com/ehoneyse/mpv-open-anilist-page
either this or this. Former - press to download, latter - automatic also search on scripts page for ‘sub-‘, there are lots of utility scripts for working with subtitles
and yet another script for subtitles
Bind those if ya’ll ever need ‘em:
- Shift+g add sub-scale +0.1 # increase the subtitle font size
- Shift+f add sub-scale -0.1 # decrease the subtitle font size
- Ctrl+Shift+LEFT sub-step -1 # change subtitle timing such that the previous subtitle is displayed
- Ctrl+Shift+RIGHT sub-step 1 # change subtitle timing such that the next subtitle is displayed
copy-subtitle and lang-learner as a must and immersive also for learning rikay-mpv - special for jap yomichampv