- custom-osc
- web search
- delete file
- move file
- move file (datetime)
- move file (subfolder)
- cut video
- clip live stream
- next file
- load dir auto
- playlist sort
- clean playlist
- subtitle priority
A minimal on screen controller desgined to use the entire window.
Basic Functionality
- Left Click Sides = Next/Prev
- Left Click Center = Play/Pause
- Double Left Click center = Toggle Fullscreen
- Left Click Bottom = Seekbar
- Right Click Anywhere = Drag-Seek
- Copy custom-osc.lua to your mpv scripts directory.
- Add the following commands to input.conf
MBTN_LEFT script_message custom-osc-left-click
MBTN_LEFT_DBL script_message custom-osc-left-double-click
MBTN_RIGHT ignore
MOUSE_MOVE script_message custom-osc-mouse-move
WHEEL_UP osd-msg add volume 10
WHEEL_DOWN osd-msg add volume -10
- Add the following commands to mpv.conf
osc=no
no-window-dragging
osd-margin-x=10
osd-margin-y=10
osd-bar-w=100
osd-bar-h=1
osd-bar-align-x=0
osd-bar-align-y=1
osd-border-size=2
osd-font-size=26
osd-scale-by-window=no
title= [${playlist-pos-1}/${playlist-count}] [${duration}] [${file-size}] ${filename}
osd-status-msg=${time-pos} / ${duration} \nPL ${playlist-pos-1}/${playlist-count}
Search any website for the currently playing file. No script is necessary for this functionality.
Add the following line to input.conf. Uses the default search engine in firefox.
F1 run "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-search" "${filename/no-ext}"
Add the following line to input.conf. Searches https://anidb.net/ website .
F2 run "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-url" "https://anidb.net/search/anime/?adb.search=${filename/no-ext}&do.search=1"
Uses the firefox command line to open a website and search for the currently playing filename without extension.
Deletes the currently playing video file.
- Copy delete-file.lua to your mpv scripts directory.
- Add the following line to input.conf
Ctrl+DEL script_message delete-file
Activating this command will delete the currently playing video file and also remove it from the playlist.
Moves the currently playing video file to a specified folder.
- Copy move-file.lua to your mpv scripts directory.
- Add the following line to input.conf
Ctrl+1 script_message move-file "C:\\Folder1"
- Edit
"C:\\Folder1"
as needed (double slashes are required).
Activating this command will move the currently playing video file to the specified folder (if the folder doesn't exist then it will be created). It will also remove the file from the playlist.
Moves the currently playing video file to a timestamped subfolder.
- Copy move-file-datetime.lua to your mpv scripts directory.
- Add the following line to input.conf
Ctrl+2 script_message move-file-datetime
Activating this command will move the currently playing video file a timestamped subfolder e.g. .\20200425203645\video.mkv
. The timestamp remains until mpv is closed. The playlist entry is also removed for the video file.
Moves the currently playing video file to a specified subfolder.
- Copy move-file-subfolder.lua to your mpv scripts directory.
- Add the following line to input.conf
Ctrl+3 script_message move-file-subfolder "Subfolder1"
- Edit
"Subfolder1"
as needed (no slashes).
Activating this command will move the currently playing video file to the specified subfolder e.g .\Subfolder1\video.mkv
. The playlist entry is also removed for the video file.
Uses ffmpeg to clip sections of the currently playing video. The original video is untouched.
- Copy cut-video.lua to your mpv scripts directory.
- ffmpeg.exe must either be copied to your mpv install folder or added to your Windows Environment Variables (Path) so that it can be located by the script.
- Add the following text to input.conf
#required
Ctrl+Left script_message cut-left
Ctrl+Right script_message cut-right
Ctrl+Up script_message cut-start
Ctrl+Down script_message cut-end
Ctrl+ENTER script_message cut-finish
#optional
#Ctrl+ENTER script_message cut-finish "avi"
#Ctrl+ENTER script_message cut-finish "webm" "-filter:v crop=200:200:0:0 -q:a 0 -q:v 4"
Ctrl+LEFT
sets the left position
Ctrl+RIGHT
sets the right position
Ctrl+UP
sets the left position to 00:00:00
Ctrl+DOWN
sets the right position to end of file
Ctrl+ENTER
begins cutting that section of video to a new file.
You can also set an optional file extension if you wish to convert the video to a different format.
Clips the last N seconds of a live stream. Takes two parameters: a folder and number of seconds to clip.
It will output two video clip files .ts
and .mkv
because the video type is unknown at the time of clipping.
NOTE: The max clip length is determined by the cache size. You can change it like this demuxer-max-bytes=300M
demuxer-max-back-bytes=350M
- Copy clip-live-stream.lua to your mpv scripts directory.
- Add the following command to input.conf
Alt+c script-message clip-live-stream "C:\\clips\\" 120
- Make sure cache is enabled in mpv.conf
cache=yes
Loads the next video file from the current directory. No playlist is used. The file types can be edited in the script as necessary.
- Copy next-file.lua to your mpv scripts directory.
- Add the following command to input.conf
Alt+e script_message next-file
Automatically adds files from the current directory (not recursive) to the playlist. Files are sorted by filename in ascending order. File types can be edited in the script. Script only runs once per mpv instance.
- Copy load-dir-auto.lua to your mpv scripts directory.
No action required; loading happens automatically after playback begins.
Sorts the current playlist by filename, date modified, or size. After sort is complete it begins playing from the top.
- Copy playlist-sort.lua to your mpv scripts directory.
- Add the following commands to input.conf
1 script_message playlist-sort name asc
2 script_message playlist-sort name desc
3 script_message playlist-sort date asc
4 script_message playlist-sort date desc
5 script_message playlist-sort size asc
6 script_message playlist-sort size desc
Removes all entries from the current playlist that are not video files.
- Copy clean-playlist.lua to your mpv scripts directory.
- Add the following command to input.conf
Alt+c script_message clean-playlist
Activating this command will remove all entires from the current playlist that are not video files. This is useful when the playlist has unwanted file types (images, music, etc).
Automatically selects the last english subtitle track that doesn't contain "song" or "sign". The matching criteria can be modified inside the script.
- Copy sub-priority.lua to your mpv scripts directory.
When a file is loaded this script will scan for subtitle tracks that match the given criteria and activate it. If no matching subtitle exists then the script does nothing and exits.
- Scripts have only been tested on Windows 10