Skip to content

Instantly share code, notes, and snippets.

@linguisticmind
Created July 19, 2024 00:28
Show Gist options
  • Select an option

  • Save linguisticmind/dc19ced8467775d03a7c9e3e8af099a5 to your computer and use it in GitHub Desktop.

Select an option

Save linguisticmind/dc19ced8467775d03a7c9e3e8af099a5 to your computer and use it in GitHub Desktop.
mpv configs | "[mpv #2] Additional mpv player stuff" (https://youtu.be/mGLHKogyDUs) | Linguistic Mind
# This file's location: ~/.config/mpv/mpv.conf
profile="1080p-max-size"
# profile="left-1/2"
screen=0
# term-osd-bar=yes
no-native-fs # Disables native macOS full-screen
input-right-alt-gr="no" # Makes right alt key work with keybindings
no-keepaspect-window # Allows resizing video player window to arbitrary dimensions
# (adds black bars around video, preserves its aspect ratio)
audio-file-auto=fuzzy # Load external audio files
keep-open=yes
force-window=yes
input-ipc-server=~/.config/mpv/socket
sub-use-margins=no
sub-ass-force-margins=no
image-display-duration=5
[1080p-max-size]
geometry="100%x1000+0+0" # 1080p monitor
profile="text-large"
[left-1/2]
geometry="50%x1000+0+0"
profile="text-small"
[right-1/2]
geometry="50%x1000-0+0"
profile="text-small"
[1080p-left-2/3]
geometry="1280x1000+0+0"
profile="text-small"
[1080p-right-2/3]
geometry="1280x1000-0+0"
profile="text-small"
[768p-max-size]
geometry="100%x688+0+0" # MacBook built-in monitor
profile="text-medium"
[tv]
profile=1080p-max-size
screen=0
[laptop-monitor]
profile=768p-max-size
screen=1
[default]
osd-font="DejaVu Sans Mono Bold"
sub-font="SourceHanMono-Bold"
sub-margin-y="60"
[text-large]
sub-font-size="60"
osd-font-size="30"
sub-border-size="5"
[text-medium]
sub-font-size="40"
osd-font-size="30"
sub-border-size="4"
[text-small]
sub-font-size="25"
osd-font-size="18"
sub-border-size="3"
[default]
sid="1"
sub-file-paths="Extra subtitles:" # Colon-separated list of directories
# containing subtitles files
volume-max="200"
[playlist-manual]
keep-open=always
reset-on-next-file=pause
[workout]
profile=playlist-manual
fullscreen=yes
sub-visibility=no
[movies2anki]
load-scripts="no"
script="~/.config/mpv/scripts/Colorbox.js"
script="~/.config/mpv/scripts/copy-subtitle.lua"
[input-test]
input-test
force-window
idle
# This file's location: ~/.config/mpv/input.conf
# -----------------------------------------------
# Disabling default bindings
# -----------------------------------------------
MBTN_RIGHT ignore
MBTN_BACK ignore
MBTN_FORWARD ignore
WHEEL_UP ignore
WHEEL_DOWN ignore
WHEEL_LEFT ignore
WHEEL_RIGHT ignore
BS ignore
q ignore
Q ignore
> ignore
< ignore
z ignore
Z ignore
x ignore
/ ignore
* ignore
Alt+0 ignore
v ignore
V ignore
J ignore
j ignore
S ignore
Ctrl+s ignore
ctrl+c ignore
DEL ignore
PGUP ignore
PGDWN ignore
Alt++ ignore
Alt+- ignore
Alt+BS ignore
Alt+left ignore
Alt+right ignore
Alt+up ignore
Alt+down ignore
p ignore
t ignore
u ignore
Shift+PGUP ignore
Shift+PGDWN ignore
Alt+s ignore
{ ignore
} ignore
# -----------------------------------------------
# Seeking
# -----------------------------------------------
LEFT no-osd seek -3 exact
RIGHT no-osd seek 3 exact
UP no-osd seek -10 exact
DOWN no-osd seek 10 exact
Alt+LEFT no-osd seek -60 exact
Alt+RIGHT no-osd seek 60 exact
Alt+UP no-osd seek -300 exact
Alt+DOWN no-osd seek 300 exact
Alt+Shift+UP no-osd seek -30 exact
Alt+Shift+DOWN no-osd seek 30 exact
# Alt+Shift+LEFT no-osd seek -15 exact
# Alt+Shift+RIGHT no-osd seek 15 exact
Alt+HOME no-osd seek 0 absolute-percent
Alt+END no-osd seek 100 absolute-percent+exact
Shift+LEFT no-osd sub-seek -1
Shift+RIGHT no-osd sub-seek 1
# Shift+Alt+LEFT no-osd sub-seek -5
# Shift+Alt+RIGHT no-osd sub-seek 5
Shift+UP add chapter -1
Shift+DOWN add chapter 1
# -----------------------------------------------
# Zooming and panning
# -----------------------------------------------
Meta+= no-osd add video-zoom 0.1
Meta++ no-osd add video-zoom 0.1
Meta+- no-osd add video-zoom -0.1
Meta+0 no-osd set video-zoom 0
# ┬────┬────┬────┬
# │↖ 7│↑ 8│↗ 9│
# ┴┬───┴┬───┴┬───┴┬───┴┬ p - pinky
# │← u│• i│→ o│← p│ o - ring
# ┴┬───┴┬───┴┬───┴┬───┴┬ i - middle
# │↙_ j│↓ k│↘ l│
# ┴┬───┴┬───┴┬───┴┬ j - index
# │↖ m│↑ ,│↗ .│
# ┴────┴────┴┬───┴──┬
# │ meta │ meta - thumb
# ┴──────┴
Meta+7 no-osd add video-pan-x 0.01; no-osd add video-pan-y 0.01
Meta+m no-osd add video-pan-x 0.01; no-osd add video-pan-y 0.01
Meta+8 no-osd add video-pan-y 0.01
Meta+, no-osd add video-pan-y 0.01
Meta+9 no-osd add video-pan-x -0.01; no-osd add video-pan-y 0.01
Meta+. no-osd add video-pan-x -0.01; no-osd add video-pan-y 0.01
Meta+u no-osd add video-pan-x 0.01
Meta+p no-osd add video-pan-x 0.01
Meta+i no-osd set video-pan-x 0; no-osd set video-pan-y 0
Meta+o no-osd add video-pan-x -0.01
Meta+j no-osd add video-pan-x 0.01; no-osd add video-pan-y -0.01
Meta+k no-osd add video-pan-y -0.01
Meta+l no-osd add video-pan-x -0.01; no-osd add video-pan-y -0.01
Meta+BS no-osd set video-zoom 0; no-osd set video-pan-x 0; no-osd set video-pan-y 0
Meta+KP1 no-osd add video-pan-x 0.01; no-osd add video-pan-y -0.01
Meta+KP2 no-osd add video-pan-y -0.01
Meta+KP3 no-osd add video-pan-x -0.01; no-osd add video-pan-y -0.01
Meta+KP4 no-osd add video-pan-x 0.01
Meta+KP5 no-osd set video-pan-x 0; no-osd set video-pan-y 0
Meta+KP6 no-osd add video-pan-x -0.01
Meta+KP7 no-osd add video-pan-x 0.01; no-osd add video-pan-y 0.01
Meta+KP8 no-osd add video-pan-y 0.01
Meta+KP9 no-osd add video-pan-x -0.01; no-osd add video-pan-y 0.01
Meta+KP0 cycle pause
Meta+* no-osd set video-zoom 0
Meta+KP_DEC no-osd set video-zoom 0; no-osd set video-pan-x 0; no-osd set video-pan-y 0
# -----------------------------------------------
# Scaling
# -----------------------------------------------
Alt+Meta+; set video-unscaled downscale-big
Alt+Meta+' set video-unscaled yes
Alt+Meta+\ set video-unscaled no
# -----------------------------------------------
# Looping
# -----------------------------------------------
# : set ab-loop-a ${=time-pos}
# " set ab-loop-b ${=time-pos}
# | no-osd set ab-loop-a no; no-osd set ab-loop-b no; show-text "Clear A-B loop"
# l show-text "A-B loop: ${ab-loop-a} - ${ab-loop-b}"
# L cycle-values loop-file inf no
# Alt+l cycle-values loop-playlist inf no
# -----------------------------------------------
# Changing speed
# -----------------------------------------------
[ add speed -1
] add speed 1
Meta+[ add speed -0.25
Meta+] add speed 0.25
Meta+{ multiply speed 0.5
Meta+} multiply speed 2
; add speed -0.1
' add speed 0.1
\ set speed 1
Meta+; add speed -0.01
Meta+' add speed 0.01
Meta+\ show-text "Speed: ${speed}"
# Meta+[ add speed -0.25
# Meta+] add speed 0.25
# [ add speed -1
# ] add speed 1
# p set speed 1.0
# \ cycle-values speed 5.0 1.0
# -----------------------------------------------
# Other
# -----------------------------------------------
Alt+PGDWN playlist-next
Alt+PGUP playlist-prev
F10 show-text ${chapter-list}
s cycle sub-visibility
Ctrl+S sub-reload
Meta+s cycle sub
Meta+S cycle sub down
Meta+Alt+s cycle secondary-sid
Meta+Alt+S cycle secondary-sid down
Alt+= add sub-font-size 1
Alt++ add sub-font-size 1
Alt+- add sub-font-size -1
Alt+0 set sub-font-size 60
Meta+a cycle audio
Meta+A cycle audio down
Meta+v cycle video
Meta+V cycle video down
# - add volume -2
# = add volume 2
# + add volume 2
Alt+t cycle ontop
# Ctrl+Alt+S screenshot
Meta+I no-osd cycle-values vf negate ""
# Meta+i no-osd cycle-values vf negate ""
ENTER cycle fullscreen
KP_ENTER cycle fullscreen
MBTN_RIGHT cycle fullscreen
Alt+§ set window-scale 0.5 # Scales video player window to half-size
# (Default bindings Alt+1 and Alt+2
# scale it to 100% and 200% respectively)
Alt+Meta+q quit-watch-later
# -----------------------------------------------
# Scripts
# -----------------------------------------------
z script-binding Blackbox_Playlist
x script-binding Blackbox_Files
c script-binding Colorbox
/ script-binding osc-show-hide-hotkey
? script-message show-hide-clock
Meta+r no-osd set video-rotate 0
r script-message Cycle_Video_Rotate 90
R script-message Cycle_Video_Rotate -90
# ` script-binding console/enable
# This file's location: ~/.config/mpv/script-settings/Blackbox.conf
# Menu appearance.
auto_close=0
max_lines=12
font_size=30 # Default 40
help_hint=no
# Favorite paths.
#favorites={/home/example/Movies}+{/home/example/Downloads}+{/home/example/Documents}+{/}
# Additional file-inclusion pattern (regex).
# This particular pattern also adds ".rar" and ".zip" files to the file browser.
include_regex=\.(?:rar|zip)$
# Key rebindings.
#
# Recommendation:
# Bind the main "Blackbox" menu command (via input.conf)
# to "z" and use the left-hand navigation below.
keys_menu_up={up}+{w}
keys_menu_down={down}+{s}
keys_menu_up_fast={pgup}+{shift+w}
keys_menu_down_fast={pgdwn}+{shift+s}
keys_menu_left={left}+{a}
keys_menu_right={right}+{d}
keys_menu_open={enter}+{e}
keys_menu_undo={bs}+{r}
keys_menu_help={h}
keys_menu_close={esc}+{c}
# This file's location: ~/.config/mpv/script-settings/Colorbox.conf
# Presets.
# Format: v1; contrast; brightness; gamma; saturation; hue; sharpen; title
presets[]=v1; 6; -2; 0; -4; 0; 0.6; Subtle depth enhancer (desat)
presets[]=v1; 6; -2; 0; 4; 0; 0.6; Subtle depth enhancer (sat)
presets[]=v1; 7; -8; 6; -10; 5; 1.3; Clarity darker
presets[]=v1; 6; -5; 2; -10; 5; 1.3; Clarity natural/dark
presets[]=v1; 6; -3; 1; -10; 5; 1.3; Clarity medium
presets[]=v1; 6; 0; 1; -5; 5; 1.3; Clarity light
presets[]=v1; 6; 1; 4; -5; 5; 1.3; Clarity lighter
presets[]=v1; 52; -11; -2; -6; 4; 1.3; Lift vintage flatness
presets[]=v1; 21; 3; -2; -30; 8; 1.1; Yellow de-glow and modernize
# Load preset at startup.
#startup_preset=Clarity medium
# Menu appearance.
auto_close=0
max_lines=16
font_size=30
font_alpha=0.7
# Key rebindings.
keys_menu_up={up}+{w}
keys_menu_down={down}+{s}
keys_menu_up_fast={shift+up}+{shift+w}
keys_menu_down_fast={shift+down}+{shift+s}
keys_menu_left={left}+{a}
keys_menu_right={right}+{d}
keys_menu_open={enter}+{e}
keys_menu_undo={bs}+{r}
keys_menu_help={h}
keys_menu_close={esc}+{c}
# This file's location: ~/.config/mpv/script-opts/osc.conf
boxvideo=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment