- Notifications
You must be signed in to change notification settings - Fork14
Zren/mpv-osc-tethys
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This theme replacesthe built inosc.lua
shipped withmpv.
Local files can show thumbnail previews (using a patched version ofmpv_thumbnail_script).
Picture-In-Picture button to position in the corner, on top of other windows, and on all virtual desktops.
(1) Copyosc_tethys.lua
,mpv_thumbnail_script_server.lua
and mpv'sautoload.lua
to
Windows:
%APPDATA%\mpv\scripts\
(C:\Users\USER\AppData\Roaming\mpv\scripts\
)- Type
%APPDATA%
in the File Explorer address bar and hit enter.
You should be inC:\Users\USER\AppData\Roaming\
whereUSER
is your username. - Create the
C:\Users\USER\AppData\Roaming\mpv\scripts\
folder if it doesn't exist. - View the following scripts and Save Page As (
Ctrl+S
). Save the files in the...\scripts\
directory. - You should now have
C:\Users\USER\AppData\Roaming\mpv\scripts\osc_tethys.lua
- Type
Linux:
~/.config/mpv/scripts/
mkdir -p~/.config/mpv/scripts/cd~/.config/mpv/scripts/wget https://raw.githubusercontent.com/Zren/mpv-osc-tethys/master/osc_tethys.luawget https://raw.githubusercontent.com/Zren/mpv-osc-tethys/master/mpv_thumbnail_script_server.luawget https://raw.githubusercontent.com/mpv-player/mpv/master/TOOLS/lua/autoload.lua
(2) Edit~/.config/mpv/mpv.conf
(%APPDATA%\mpv\mpv.conf
on Windows) to disable the defaultosc.lua
and improve the window.
osc=no
will disable the defaultosc.lua
border=no
will remove the window titlebar and frame. You can still drag a window by dragging the video.keep-open=yes
will keep the player open after the video has finished.keepaspect-window=no
will allow black borders around the video when maximized or half screen.
osc=noborder=nokeep-open=yeskeepaspect-window=no
(3) Edit~/.config/mpv/input.conf
(%APPDATA%\mpv\input.conf
on Windows) to rebind LEFT/RIGHT arrows to exactly 5s skips.
# Defaults: https://github.com/mpv-player/mpv/blob/master/etc/input.conf# Seek by exactly 5s instead of relative+keyframes 10sRIGHT seek 5 exact# forwardLEFT seek -5 exact# backwardWHEEL_UP seek 5 exact# forwardWHEEL_DOWN seek -5 exact# backward# Seek by exactly 30s instead of relative+keyframes 60sUP seek 30 exact# forwardDOWN seek -30 exact# backward
(4) Close and reopen MPV to view the new Tethys theme!
If you don't like any of the default colors/sizes, you can create a few text files to configure certain settings.
A complete list of configuration keys can be found at the top ofosc_tethys.lua
.
- Windows:
%APPDATA%\mpv\script-opts\tethys.conf
- Linux:
~/.config/mpv/script-opts/tethys.conf
### ConfigshowPictureInPictureButton=yesshowSpeedButton=yes# Show name and shortcut of buttons on hovershowShortcutTooltip=yes# Show chapter above timestamp in seekbar tooltipshowChapterTooltip=yes# skipback/skipfrwd amount in secondsskipBy=5# RightClick skipback/skipfrwd amount in secondsskipByMore=30# "exact" (mordenx default) or "relative+keyframes" (mpv default)skipMode=exact# PictureInPicture 33% screen width, 10px from bottom rightpipGeometry=33%+-10+-10# PictureInPicture will show video on all virtual desktopspipAllWorkspaces=yes### Sizes# 16:9 video thumbnail = 256x144thumbnailSize=256seekbarHeight=20controlsHeight=64buttonTooltipSize=20windowBarHeight=44windowButtonSize=44windowTitleSize=24cacheTextSize=20timecodeSize=27seekbarTimestampSize=30seekbarTimestampOutline=1chapterTickSize=6windowTitleOutline=1### Colors (uses GGBBRR for some reason)### Alpha ranges 0 (opaque) .. 255 (transparent)textColor=FFFFFFbuttonColor=CCCCCCbuttonHoveredColor=FFFFFFbuttonHoveredRectColor=000000# Easily debug button geometry by setting buttonHoveredRectAlpha to 80buttonHoveredRectAlpha=255tooltipColor=CCCCCCwindowBarColor=000000# windowBarAlpha (80 is mpv default) (255 morden default)windowBarAlpha=255windowButtonColor=CCCCCCcloseButtonHoveredColor=1111DDseekbarHandleColor=FFFFFFseekbarFgColor=483DD7seekbarBgColor=929292seekbarCacheColor=000000seekbarCacheAlpha=128chapterTickColor=CCCCCC
A complete list of configuration keys inherited fromosc.lua
canbe found in the source code orits documentation.
Note that tethys ignores a few options inosc.conf
that are already covered bytethys.conf
.
- Windows:
%APPDATA%\mpv\script-opts\osc.conf
- Linux:
~/.config/mpv/script-opts/osc.conf
# Timestamp# Display total time instead of remaining timetimetotal=no# Display timecodes with millisecondstimems=no# Whether to display the chapters/playlist at the OSD when left-clicking the next/previous OSC buttons, respectively.playlist_osd=yeschapters_osd=yes# Duration of fade out in ms, 0 = no fadefadeduration=200# Minimum amount of pixels the mouse has to move between ticks to make the OSC show up. Default pre-0.21.0 was 3.minmousemove=0# auto=hide/show on mouse move# Also supports never and alwaysvisibility=auto# Use a Unicode minus sign instead of an ASCII hyphen when displaying the remaining playback time.unicodeminus=no
A complete list of configuration keys for mpv_thumbnail_script canbe found in the source code orits documentation.
Note thatthumbnailSize
intethys.conf
overridesthumbnail_width
andthumbnail_height
. Tethys also forcesmpv_no_sub=yes
andmpv_no_config=yes
to make thumbnails easier to read.
- Windows:
%APPDATA%\mpv\script-opts\mpv_thumbnail_script.conf
- Linux:
~/.config/mpv/script-opts/mpv_thumbnail_script.conf
# Automatically generate the thumbnails on video load, without a keypressautogenerate=yes# 1 hour, Only automatically thumbnail videos shorter than this (seconds)autogenerate_max_duration=3600# SHA1-sum filenames over this length# It's nice to know what files the thumbnails are (hence directory names)# but long URLs may approach filesystem limits.hash_filename_length=128# Use mpv to generate thumbnail even if ffmpeg is found in PATH# ffmpeg does not handle ordered chapters (MKVs which rely on other MKVs)!# mpv is a bit slower, but has better support overall (eg. subtitles in the previews)prefer_mpv=yes# Disable the built-in keybind ("T") to add your owndisable_keybinds=no# The thumbnail count target# (This will result in a thumbnail every ~10 seconds for a 25 minute video)thumbnail_count=150# The above target count will be adjusted by the minimum and# maximum time difference between thumbnails.# The thumbnail_count will be used to calculate a target separation,# and min/max_delta will be used to constrict it.# In other words, thumbnails will be:# at least min_delta seconds apart (limiting the amount)# at most max_delta seconds apart (raising the amount if needed)min_delta=5# 120 seconds aka 2 minutes will add more thumbnails when the video is over 5 hours!max_delta=90# Overrides for remote urls (you generally want less thumbnails!)# Thumbnailing network paths will be done with mpv# Allow thumbnailing network paths (naive check for "://")thumbnail_network=no# Override thumbnail count, min/max deltaremote_thumbnail_count=60remote_min_delta=15remote_max_delta=120# Try to grab the raw stream and disable ytdl for the mpv subcalls# Much faster than passing the url to ytdl again, but may cause problems with some sitesremote_direct_stream=yes
- Windows:
%APPDATA%\mpv\script-opts\autoload.conf
- Linux:
~/.config/mpv/script-opts/autoload.conf
disabled=noimages=yesvideos=yesaudio=yesignore_hidden=yes
- https://github.com/mpv-player/mpv/blob/master/player/lua/osc.lua
- https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autoload.lua
- Zren/mpvz#13 (
osc_tethys.lua
Development Notes) - https://github.com/mpv-player/mpv/blob/master/player/lua/assdraw.lua
- https://github.com/mpv-player/mpv/blob/master/sub/osd.c
- https://github.com/libass/libass/wiki/ASSv5-Override-Tags
- https://github.com/libass/libass/wiki/Libass'-ASS-Extensions
- https://mpv.io/manual/master/
- https://bomi-player.github.io/gallery.html (Tethys icon set designed by Kotus Works)
I haven't tried these, but have used them as reference.