Uosc
Feature-rich minimalist proximity-based UI for MPV player.
Install / Use
/learn @tomasklaen/UoscREADME
Features:
- UI elements hide and show based on their proximity to cursor instead of every time mouse moves. This provides 100% control over when you see the UI and when you don't. Click on the preview above to see it in action.
- When timeline is unused, it can minimize itself into a small discrete progress bar.
- Build your own context menu with nesting support by editing your
input.conffile. - Configurable controls bar.
- Fast and efficient thumbnails with thumbfast integration.
- UIs for:
- Selecting subtitle/audio/video track.
- Downloading subtitles from Open Subtitles.
- Loading external subtitles.
- Selecting stream quality.
- Quick directory and playlist navigation.
- All menus are instantly searchable. Just start typing.
- Mouse scroll wheel does multiple things depending on what is the cursor hovering over:
- Timeline: seek by
timeline_stepseconds per scroll. - Volume bar: change volume by
volume_stepper scroll. - Speed bar: change speed by
speed_stepper scroll. - Just hovering video with no UI widget below cursor: your configured wheel bindings from
input.conf.
- Timeline: seek by
- Right click on volume or speed elements to reset them.
- Transforming chapters into timeline ranges (the red portion of the timeline in the preview).
- A lot of useful options and commands to bind keys to.
- API for 3rd party scripts to extend, or use uosc to render their menus.
Install
uosc requires mpv 0.33 and higher.
-
These commands will install or update uosc and place a default
uosc.conffile intoscript-optsif it doesn't exist already.Windows
Optional, needed to run a remote script the first time if not enabled already:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUserRun:
irm https://raw.githubusercontent.com/tomasklaen/uosc/HEAD/installers/windows.ps1 | iexNOTE: If this command is run in an mpv installation directory with
portable_config, it'll install there instead ofAppData.NOTE2: The downloaded archive might trigger false positives in some antiviruses. This is explained in FAQ below.
Linux & macOS
Requires curl and unzip.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/tomasklaen/uosc/HEAD/installers/unix.sh)"On Linux, we try to detect what package manager variant of the config location you're using, with precedent being:
~/.var/app/io.mpv.Mpv (flatpak) ~/snap/mpv ~/snap/mpv-wayland ~/.config/mpvTo install into any of these locations, make sure the ones above it don't exist.
Manual
-
Download & extract
uosc.zipinto your mpv config directory. (See the documentation of mpv config locations.) -
If you don't have it already, download & extract
uosc.confintoscript-optsinside your mpv config directory. It contains all of uosc options along with their default values and documentation.
-
-
OPTIONAL:
mpv.conftweaks to better integrate with uosc:# uosc provides seeking & volume indicators (via flash-timeline and flash-volume commands) # if you decide to use them, you don't need osd-bar osd-bar=no # uosc will draw its own window controls and border if you disable window border border=no -
OPTIONAL: To have thumbnails in timeline, install thumbfast. No other step necessary, uosc integrates with it seamlessly.
-
OPTIONAL: If the UI feels sluggish/slow while playing video, you can remedy this a bit by placing this in your
mpv.conf:video-sync=display-resampleThough this does come at the cost of a little bit higher CPU/GPU load.
What is going on?
uosc places performance as one of its top priorities, but it might feel a bit sluggish because during a video playback, the UI rendering frequency is chained to its frame rate. To test this, you can pause the video which will switch refresh rate to be closer or match the frequency of your monitor, and the UI should feel smoother. This is mpv limitation, and not much we can do about it on our side.
Build instructions
To build ziggy (our utility binary) yourself, run:
tools/build ziggy
Which will run the tools/build(.ps1) script that builds it for each platform. It requires go to be installed. Source code is in src/ziggy.
Options
All of the available uosc options with their default values are documented in uosc.conf file (download).
To change the font, uosc respects the mpv's osd-font configuration.
Navigation
These bindings are active when any uosc menu is open (main menu, playlist, load/select subtitles,...):
up,down- Select previous/next item.enter- Activate item or submenu.bs(backspace) - Activate parent menu.esc- Close menu.wheel_up,wheel_down- Scroll menu.pgup,pgdwn,home,end- Self explanatory.ctrl+for\- In casemenu_type_to_searchconfig option is disabled, these two trigger the menu search instead.ctrl+backspace- Delete search query by word.shift+backspace- Clear search query.- Holding
altwhile activating an item should prevent closing the menu (this is just a guideline, not all menus behave this way).
Each menu can also add its own shortcuts and bindings for special actions on items/menu, such as del to delete a playlist item, ctrl+up/down/pgup/pgdwn/home/end to move it around, etc. These are usually also exposed as item action buttons for you to find out about them that way.
When menu search is active del will edit the string. If you want to trigger the current menu's action bound to del (such as delete item from playlist menu), use shift+del.
Click on a faded parent menu to go back to it.
Commands
uosc provides various commands with useful features to bind your preferred keys to, or populate your menu with. These are all unbound by default.
To add a keybind to one of this commands, open your input.conf file and add one on a new line. The command syntax is script-binding uosc/{command-name}.
Example to bind the tab key to toggle the ui visibility:
tab script-binding uosc/toggle-ui
Available commands:
toggle-ui
Makes the whole UI visible until you call this command again. Useful for peeking remaining time and such while watching.
There's also a toggle-elements <ids> message you can send to toggle one or more specific elements by specifying their names separated by comma:
script-message-to uosc toggle-elements timeline,speed
Available element IDs: timeline, controls, volume, top_bar, speed
Under the hood, toggle-ui is using toggle-elements, and that is in turn using the set-min-visibility <visibility> [<ids>] message. <visibility> is a 0-1 floating point. Leave out <ids> to set it for all elements.
toggle-progress
Toggles the timeline progress mode on/off. Progress mode is an always visible thin version of timeline with no text labels. It can be configured using the progress* config options.
toggle-title
Toggles the top bar title between main and alternative title's. This can also be done by clicking on the top bar.
Only relevant if top bar is enabled, top_bar_alt_title is configured, and top_bar_alt_title_place is toggle.
flash-ui
Command(s) to briefly flash the whole UI. Elements are revealed for a second and then fade away.
To flash individual elements, you can use: flash-timeline, flash-progress, flash-top-bar, flash-volume, flash-speed, flash-pause-indicator, decide-pause-indicator
There's also a flash-elements <ids> message you can use to flash one or more specific elements. Example:
script-message-to uosc flash-elements timeline,speed
Available element IDs: timeline, progress, controls, volume, top_bar, speed, pause_indicator
This is useful in combination with other commands that modify values represented by flashed elements, for example: flashing volume element when changing the volume.
You can use it in your bindings like so:
space cycle pause; script-binding uosc/flash-pause-indicator
right seek 5
left seek -5
shift+right seek 30; script-binding uosc/flash-timeline
shift+left seek -30; script-binding uosc/flash-timeline
m no-osd cycle mute; script-binding uosc/flash-volume
up no-osd add volume 10; script-binding uosc/flash-volume
down no-osd add volume -10; script-binding uosc/flash-volume
[ no-osd add speed -0.25; script-binding uosc/flash-speed
] no-osd add speed 0.25; script-binding uosc/flash-speed
\ no-osd set speed 1; script-binding uosc/flash-speed
> script-binding
