Video

~/.config/mpv/input.conf

Rina Kawakita 2020. 1. 8. 18:35
~/.config/mpv/input.conf
# vim:ft=cfg:foldmethod=marker
###############################################################################
## (MPlayer-style) Mpv key bindings
##
## mpv --version: 0.28.0
## Save it as ~/.config/mpv/input.conf to use it.
##
## by nietz (last updated 2018.03.01)
###############################################################################
#
# General {{{
## Generally, it's recommended to use this as reference-only.
# Lines starting with # are comments. Use SHARP to assign the # key.
# Copy this file and uncomment and edit the bindings you want to change.
#
## List of commands and further details: DOCS/man/input.rst
# List of special keys: $ mpv --input-keylist
# Keybindings testing mode: $ mpv --input-test --force-window --idle
#
## Use 'ignore' to unbind a key fully (e.g. 'ctrl+a ignore').
ctrl+x ignore
w ignore
#
## Strings need to be quoted and escaped:
#   KEY show-text "This is a single backslash: \\ and a quote: \" !"
#
## You can use modifier-key combinations like Shift+Left or Ctrl+Alt+x with
# the modifiers Shift, Ctrl, Alt and Meta (may not work on the terminal).
#
## The default keybindings are hardcoded into the mpv binary.
#
## You can disable them completely with: --no-input-default-bindings
#
## If this is enabled, treat all the following bindings as default.
#default-bindings start
# }}}

# Mouse {{{
## Mouse
#MOUSE_BTN0 ignore                     # don't do anything
MOUSE_BTN0_DBL cycle fullscreen        # toggle fullscreen on/off
MOUSE_BTN1 cycle mute                  # toggle mute
#MOUSE_BTN2 cycle pause                # toggle pause on/off
MOUSE_BTN2 script_message mpv_context_menu
MOUSE_BTN3 seek 10
MOUSE_BTN4 seek -10
MOUSE_BTN5 add volume -2
MOUSE_BTN6 add volume 2
MOUSE_BTN7 add volume -2
MOUSE_BTN8 add volume 2
# }}}

# Seeking {{{
## Seeking
RIGHT seek +10
LEFT seek -5
DOWN seek -60
UP seek +60
PGUP seek 600
PGDWN seek -600
ctrl+PGUP add chapter -1    # skip to previous dvd chapter
ctrl+PGDWN add chapter +1   #         next
DEL no-osd sub-seek -1
END no-osd sub-seek 1
#p cycle pause
P cycle pause
. frame_step                # advance one frame and pause
SPACE cycle pause
# }}}

# Audio & Sync {{{
## Audio & sync
m cycle mute
#SHARP cycle audio          # switch audio streams
` cycle audio               # switch audio streams
( add balance -0.1          # adjust audio balance in favor of left
) add balance +0.1          #                                  right
+ add audio-delay 0.100
= add audio-delay 0.100
- add audio-delay -0.100
[ multiply speed 0.9091     # scale playback speed
] multiply speed 1.1
{ multiply speed 0.5
} multiply speed 2.0
BS set speed 1.0            # reset speed to normal
# }}}

# Exit {{{
## Quit
ESC quit
q quit
Q quit-watch-later
#ENTER playlist_next force  # skip to next file
ENTER quit 
# }}}

# Playlist {{{
## Playlist
HOME set playlist-pos 0     # not the same as MPlayer
#END pt_up_step -1
#INS alt_src_step 1
#DEL alt_src_step -1
> playlist_next             # skip to next file
< playlist_prev             #         previous
# }}}

# OSD & Subtitles delay {{{
## OSD & Subtitles delay
o cycle osd-level
#I show_text "${filename}"  # display filename in osd, disabled for stats.lua I key binding
P show_progress
z add sub-delay -0.1        # subtract 100 ms delay from subs
x add sub-delay +0.1        # add
# }}}

# Volume & Picture Cali {{{
## Volume & Pciture
9 add volume -1
_ add volume -1
#/ add volume -1
0 add volume 1
+ add volume 1
#* add volume 1
# Seeking: osd sub-seek
9 no-osd sub-seek -1
0 no-osd sub-seek  1
#
#1 add contrast -1
#2 add contrast 1
#3 add brightness -1
#4 add brightness 1
#5 add hue -1
#6 add hue 1
#7 add saturation -1
#8 add saturation 1
#
! add contrast -1
@ add contrast 1
SHARP add brightness -1
$ add brightness 1
% add hue -1
^ add hue 1
& add saturation -1
* add saturation 1
[ add volume -1
] add volume 1
# }}}

# Subtitles {{{
## Subtitles
r add sub-pos -1            # move subtitles up
R add sub-pos +1            # ~              down   ( default : t key )
#? sub_step +1              # immediately display next subtitle
#? sub_step -1              #                     previous
y add sub-scale +0.1        # increase subtitle font size
Y add sub-scale -0.1        # decrease subtitle font size
# }}}

# TV CHannel {{{
## Tv Channel
h cycle tv-channel 1
l cycle tv-channel -1
n cycle tv-norm
#b tv_step_chanlist
# }}}

# Video {{{
## Video
f cycle fullscreen
T cycle ontop               # toggle video window ontop of other windows
w add panscan -0.1          # zoom out with -panscan 0 -fs
e add panscan +0.1          #      in
#c cycle stream-capture     # save (and append) file/stream to stream.dump with -capture
#c	# lua script : easycrop
d cycle framedrop
#D cycle deinterlace # toggle deinterlacer (auto-inserted filter)
#D vf toggle vavpp
D vf toggle "lavfi=graph=[bwdif=mode=send_frame:parity=auto:deint=all]" # toggle deinterlacer (auto-inserted filter)
#D vf toggle "lavfi=graph=[delogo=x=1672:y=43:w=166:h=94]" # toggle Delogo - attackers
#D vf toggle "lavfi=graph=[cropdetect=limit=24:round=2:reset=0],lavfi=graph=[crop=1920:1076:0:4],lavfi=graph=[bwdif=mode=send_frame:parity=auto:deint=interlaced],lavfi=graph=[gradfun=strength=3.5:radius=8]" # toggle deinterlacer (auto-inserted filter)
# }}}

# Screenshot {{{
## Screenshot
s screenshot subtitles             # (default) take a screenshot, with subtitles (if you want PNG, use "--screenshot-format=png")
ctrl+s screenshot video            # without OSD or subtitles
alt+s screenshot window            # with OSD or subtitles, resized window size
S screenshot "window+each-frame"   # S will take a png resized window screenshot of every frame
# }}}

# Movie-Image Rotate,pan,zoom {{{
## Movie, Rotate (for images)
ctrl+left add video-pan-x 0.1
ctrl+right add video-pan-x -0.1
ctrl+up add video-pan-y 0.1
ctrl+down add video-pan-y -0.1
ctrl+= add video-zoom 0.1
ctrl+- add video-zoom -0.1
ctrl+space set video-zoom 0; set video-pan-x 0; set video-pan-y 0
#alt+right no-osd cycle video-rotate 90   # Rotate by 90 degrees clockwise
#alt+left no-osd cycle video-rotate -90   # Rotate by 90 degrees counterclockwise
alt+right no-osd cycle-values video-rotate  "90" "180" "270" "0"
alt+left no-osd cycle-values video-rotate  "270" "180" "90" "0"
#alt+right no-osd vf add rotate=1   # Rotate
#alt+left no-osd vf add rotate=2    # Rotate
# }}}

# Apple Remote {{{
##
## Apple Remote section
##
## To use OSD menu with Apple Remote, set key AR_MENU to any OSD menu command,
## or just comment out the 'AR_MENU osd' line and uncomment the line after it.
##

AR_PLAY cycle pause
AR_PLAY_HOLD quit
AR_NEXT seek 30
AR_NEXT_HOLD seek 120
AR_PREV seek -10
AR_PREV_HOLD seek -120
#AR_MENU menu up
#AR_MENU menu cancel
AR_MENU_HOLD cycle mute
AR_VUP add volume 1
AR_VDOWN add volume -1
# }}}

# Advanced Seek {{{
##
## Advanced seek
## Uncomment the following lines to be able to seek to n% of the media with
## the Fx keys.
##
F1 seek 10 absolute-percent
F2 seek 20 absolute-percent
F3 seek 30 absolute-percent
F4 seek 40 absolute-percent
F5 seek 50 absolute-percent
F6 seek 60 absolute-percent
F7 seek 70 absolute-percent
F8 seek 80 absolute-percent
F9 seek 90 absolute-percent
# }}}

# Vapoursynth {{{
##
## Vapoursynth toggle keybinding
## defalut key overwrite for IR remote key
#
## mvtools
1 vf toggle vapoursynth=/home/nietz/.config/mpv/vapoursynth/mvtools.vpy
## flash3kyuu debanding
#2 vf toggle vapoursynth=~/.config/mpv/vapoursynth/flash3kyuu.vpy
2 quit
## SVP4 interpolation low quality
# vf toggle vapoursynth=/home/nietz/.config/mpv/vapoursynth/svp4.vpy
## SVP4 interpolation middle quality + gpu
3 vf toggle vapoursynth=/home/nietz/.config/mpv/vapoursynth/svp4.vpy
#3 vf toggle vapoursynth=/home/nietz/.config/mpv/vapoursynth/svp4gpu.vpy
## SVP4 interpolation low quality for tv 29.970 fps
#4 vf toggle vapoursynth=/home/nietz/.config/mpv/vapoursynth/svp4tv.vpy
4 vf toggle "lavfi=graph=[cropdetect=limit=24:round=2:reset=0],lavfi=graph=[crop=1920:1076:0:4],lavfi=graph=[bwdif=mode=send_frame:parity=auto:deint=interlaced],vapoursynth=/home/nietz/.config/mpv/vapoursynth/mvtools.vpy,lavfi=graph=[gradfun=strength=3.5:radius=8]" # toggle deinterlacer (auto-inserted filter)
## toggle gradfun debanding on 5
5 vf toggle lavfi=gradfun
#
# remove all video filters on 6
6 vf set ""
# vf toggle vapoursynth=/home/nietz/.config/mpv/vapoursynth/test.vpy
## fullscreen 7
7 cycle fullscreen
## osd toggle 8
8 cycle osd-level
# }}}

# Lua Custom Keybind {{{
###########################################################
## Lua script custom keybinding
## lua scripts file: ~/.config/mpv/scripts/
## cutomization conf: ~/.config/mpv/lua-settings/
#
#
## mpv-progressbar.lua https://github.com/torque/mpv-progressbar
# torque-progressbar.conf
#. script-binding progressbar/step-forward
#, script-binding progressbar/step-backward
ctrl+o script-binding progressbar/toggle-inactive-bar
tab script-binding progressbar/request-display
mouse_btn0 script-binding progressbar/seek-to-mouse

## stats.lua https://github.com/Argon-/mpv-stats
# stats.conf
# 1 stats (as usual)
# 2 frame timings
i script-binding stats/display-stats
I script-binding stats/display-stats-toggle

## autocrop.lua https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autocrop.lua
C script-binding auto_crop

## autodeint https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autodeint.lua
ctrl+d script-binding autodeint

## autoload.lua https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autoload.lua

## easycrop.lua https://github.com/aidanholm/mpv-easycrop
#c script-binding easy_crop

## playlistmanager.lua https://github.com/jonniek/mpv-playlistmanager/blob/master/playlistmanager.luao
# playlistmanager.conf https://github.com/jonniek/mpv-playlistmanager/blob/master/playlistmanager.conf
#enter playlist-next ; script-message playlistmanager show playlist
# shitft+enter: show playlist toggle
ctrl+p script-message playlistmanager sort startover
p script-message playlistmanager show playlist toggle
i script-binding jumptofile


## Encode, Various scripts for mpv https://github.com/occivink/mpv-scripts#encodelua
# vo mode: no hwdec, no vapoursynth
# {blacklist-extensions,blur-edges,crop,encode,misc,seek-to}.lua
# {blacklist-extensions,blur-edges,crop,encode_slice,encode_webm}.conf
## crop.lua
c script-message-to crop start-crop                         # start cropping
#d vf del -1
ctrl+c vf del -1                                            # remove the crop
alt+c script-message-to crop toggle-crop                    # or use the ready-make "toggle" binding
d script-message-to delogo start-delogo                     # start deloging
## delogo.lua
ctrl+d script-message-to delogo toggle-delogo               # or use the ready-make "toggle" binding
## encode.lua
e script-message-to encode set-timestamp                    # encode (default profile: vp8 webms)
alt+e script-message-to encode set-timestamp encode_webm    # encode (custom webm profile)
E script-message-to encode set-timestamp encode_slice       # slice (custom profile)
## blur-edges.lua
b script-message-to blur_edges toggle-blur
## seek-to.lua
t script-message-to seek_to toggle-seeker

## image-viewer.lua https://github.com/occivink/mpv-image-viewer
#

## mpv-gallery-view https://github.com/occivink/mpv-gallery-view
# {gallery.lua,gallery-thumbgen}.lua
# gallery.conf
g script-message gallery-view

## subit.lua
alt+d script-binding subit

## mpv_thumbnail_script
shift+alt+s script-binding generate-thumbnails
# }}}


5 cycle pause

~/.config/mpv/input-image.conf
# Easier image navigation
h repeatable script-message zoom-invariant-add video-pan-x 0.2
l repeatable script-message zoom-invariant-add video-pan-x -0.2
k repeatable script-message zoom-invariant-add video-pan-y 0.2
j repeatable script-message zoom-invariant-add video-pan-y -0.2

ctrl+h repeatable script-message zoom-invariant-add video-pan-x 0.02
ctrl+l repeatable script-message zoom-invariant-add video-pan-x -0.02
ctrl+k repeatable script-message zoom-invariant-add video-pan-y 0.02
ctrl+j repeatable script-message zoom-invariant-add video-pan-y -0.02

+ add video-zoom 0.5
- add video-zoom -0.5; script-message zoom-check-center
= no-osd set video-zoom 0; script-message zoom-check-center

MOUSE_BTN3 add video-zoom 0.1
MOUSE_BTN4 add video-zoom -0.1

# sxiv compatibility
w no-osd set video-unscaled yes; keypress =
e no-osd set video-unscaled no; keypress =

BS repeatable playlist-prev
SPACE repeatable playlist-next
ENTER playlist-next force
ESC quit
q quit

RIGHT repeatable playlist-next
LEFT repeatable playlist-prev
UP ignore
DOWN ignore

CTRL+RIGHT script-message rotate-video 90
CTRL+LEFT script-message rotate-video -90
CTRL+DOWN no-osd set video-rotate 0

# Toggling between pixel-exact reproduction and interpolation
a cycle deband; cycle-values scale nearest ewa_lanczossharp

# Toggle color management on or off
c cycle icc-profile-auto

# Screenshot of the window output
S screenshot window

# For Argon-/mpv-stats (optional)
# J script_binding stats

# Toggle aspect ratio information on and off
A cycle-values video-aspect "-1" "no"