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:
- Initially selects the current chapter instead of the first one on list open
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:
- Pause icon is now less obtrusive and is placed in top right corner.
- Shows hourglass icon when buffering or seeking.
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 (mpv-player/mpv#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:
- When bindings are defined in
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 hasrepeatable
word in it and if it does, it sets the binding to be repeatable. And if you define a binding ininput.conf
and you want its translated counterpart to be repeatable too, you should explicitly addrepeatable
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:
- uses
media-title
for generated filenames instead of video file name - not fast cutting like original script (using
copy
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:
- Searches in a subtitle file active as a primary subtitle instead of attempting to find subtitle files matching video name
- Outputs all search results in OSD list instead of jumping between them with a hotkey (the closest subtitle is selected by default)
- Supports searching unicode text (subtitles should be encoded as utf8, please re-encode your subtitles if you get no results searching for unicode text)
- Embedded console replaced with more recent variant from mpv sources (to support unicode input)
- Takes into account current
sub-delay
value - Can use special phrase "*" to show all subtitle lines
- Can search in embedded subtitles (requires ffmpeg to be installed to extract subtitles from video files)
- Can search subtitles for youtube videos (requires ffmpeg to be installed to fetch remote subtitles)
- Supports
.srt
,.vtt
and.sub
(microdvd) subtitle formats - Use
ctrl+shift+f
shortcut to show all subtitle lines simultaneously and dynamically highlight the current line
Requires 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:
- Supports selecting secondary subtitle track