Collection of my personalized mpv scripts and configuration.
Can be cloned directly in ~/.config/mpv
directory.
Includes modified and customized scripts by other authors.
Here is the list of included scripts with short descriptions and customizations. Links to original scripts are included. A script was written from scratch if there is no link.
Original: https://github.com/CogentRedTester/mpv-scroll-list
Boss key. Pauses playback and minimizes the window on ESCAPE.
Original: https://github.com/CogentRedTester/mpv-scroll-list/blob/master/examples/chapter-list.lua
Changes:
Shows system clock in bottom right corner (position is configurable).
Can be toggled on/off with F12
(configurable).
Uses guessit to detect media title by filename.
Upon detection, sets force-media-title
variable and shows the detected title on screen.
Useful for getting cleaner screenshot file names.
Requires guessit
to be installed and accessible as guessit
command.
This script is used to load platform-dependent profiles.
One should specify profiles to load in script-opts/load-profiles.conf
file in the following form:
profiles=one,two,three
Original: https://github.com/oltodosel/mpv-scripts/blob/master/pause-indicator.lua
Changes:
You can configure the script using the following options in script-opts/pause_indicator.conf
:
# position of the icon, first word is horizontal alignment, second is vertical (you can also use `center` shorthand for `center-center`)
position=bottom-right
# font size of the icon
size=50
# whether to show hourglass icon when buffering or seeking
show_hourglass=no
Original: https://github.com/hacel/recent
When a property changes, it saves it to restore on next start.
Saved values are not file-specific.
List of properties to save is configured in script-opts/remember-props.conf
file:
props=one,two,three
Saves selected subtitle tracks to saved-subs.json
file in mpv directory and restores them whenever file is loaded.
Differs from watch-later
-saved data in that it saves secondary subtitles too (and uses subtitle file paths instead of ids).
It also stores subtitle visibility state for a secondary subtitles too.
As mpv does not natively support shortcuts independent of the keyboard layout (https://github.com/mpv-player/mpv/issues/351), this script tries to workaround this issue for some limited cases with russian (йцукен) keyboard layout.
Upon startup, it takes currently active bindings from input-bindings
property and duplicates them for the russian layout.
You can adapt the script for your preferred layout, but it won't (of course) work for layouts sharing unicode characters with the english layout.
Known issues:
input.conf
, mpv determines by the attached command whether this binding should be repeatable or not.
But when defining a binding from inside a script, the script should decide whether the binding should be repeatable.
And mpv does not give any information on whether a binding was detected to be repeatable, so we have no easy way to determine this.
So this script uses a quick and dirty solution: it just checks if the command has repeatable
word in it and if it does, it sets the binding to be repeatable.
And if you define a binding in input.conf
and you want its translated counterpart to be repeatable too, you should explicitly add repeatable
prefix to the command (for example: translated shortcut for . sub-seek 1
is not going to be repeatable while . repeatable sub-seek 1
is).Cut video segment into a new file with ffmpeg.
Original: https://github.com/snylonue/mpv_slicing_copy/blob/master/slicing_copy.lua
Changes:
media-title
for generated filenames instead of video file namecopy
as a codec for ffmpeg), re-encodes the video each time to avoid problems with keyframes.Searching for text inside subtitles.
Original: https://github.com/kelciour/mpv-scripts/blob/master/sub-search.lua
Changes:
sub-delay
value.srt
, .vtt
and .sub
(microdvd) subtitle formatsctrl+shift+f
shortcut to show all subtitle lines simultaneously and dynamically highlight the current lineRequires script-modules/utf8
repository, script-modules/scroll-list.lua
, script-modules/sha1.lua
, script-modules/utf8_data.lua
and script-modules/input-console.lua
to work.
You can clone script-modules/utf8
repository with the following command (assuming you are in mpv config directory): git clone git@github.com:Stepets/utf8.lua.git script-modules/utf8
You should add the following bindings into your input.conf
file after script installation:
Ctrl+f script-message-to subtitle_search start-search
Ctrl+Shift+f script-message-to subtitle_search show-all-lines
Allows toggling osc on/off with a hotkey.
Bound to TAB
and single right mouse button click in input.conf
.
Shows a navigable menu with list of chapters for the current video.
Original: https://github.com/dyphire/mpv-scripts/blob/main/track-menu.lua
Changes: