uosc
Feature-rich minimalist proximity-based UI for MPV player.
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.conf` file.
- Configurable controls bar.
- Fast and efficient thumbnails with [thumbfast](https://github.com/po5/thumbfast) integration.
- UIs for:
- Selecting subtitle/audio/video track.
- [Downloading subtitles](#download-subtitles) from [Open Subtitles](https://www.opensubtitles.com).
- 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_step` seconds per scroll.
- Volume bar: change volume by `volume_step` per scroll.
- Speed bar: change speed by `speed_step` per scroll.
- Just hovering video with no UI widget below cursor: your configured wheel bindings from `input.conf`.
- 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](https://github.com/tomasklaen/uosc/wiki) to extend, or use uosc to render their menus.
[Changelog](https://github.com/tomasklaen/uosc/releases).
## Install
1. These commands will install or update **uosc** and place a default `uosc.conf` file into `script-opts` if it doesn't exist already.
### Windows
_Optional, needed to run a remote script the first time if not enabled already:_
```powershell
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
```
Run:
```powershell
irm https://raw.githubusercontent.com/tomasklaen/uosc/HEAD/installers/windows.ps1 | iex
```
_**NOTE**: If this command is run in an mpv installation directory with `portable_config`, it'll install there instead of `AppData`._
_**NOTE2**: The downloaded archive might trigger false positives in some antiviruses. This is explained in [FAQ below](#why-is-the-release-reported-as-malicious-by-some-antiviruses)._
### Linux & macOS
_Requires **curl** and **unzip**._
```sh
/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/mpv
```
To install into any of these locations, make sure the ones above it don't exist.
### Manual
1. Download & extract [`uosc.zip`](https://github.com/tomasklaen/uosc/releases/latest/download/uosc.zip) into your mpv config directory. (_See the [documentation of mpv config locations](https://mpv.io/manual/master/#files)._)
2. If you don't have it already, download & extract [`uosc.conf`](https://github.com/tomasklaen/uosc/releases/latest/download/uosc.conf) into `script-opts` inside your mpv config directory. It contains all of uosc options along with their default values and documentation.
2. **OPTIONAL**: `mpv.conf` tweaks to better integrate with **uosc**:
```config
# 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
```
3. **OPTIONAL**: To have thumbnails in timeline, install [thumbfast](https://github.com/po5/thumbfast). No other step necessary, **uosc** integrates with it seamlessly.
4. **OPTIONAL**: If the UI feels sluggish/slow while playing video, you can remedy this _a bit_ by placing this in your `mpv.conf`:
```config
video-sync=display-resample
```
Though 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](https://go.dev/) 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`](https://github.com/tomasklaen/uosc/blob/HEAD/src/uosc.conf) file ([download](https://github.com/tomasklaen/uosc/releases/latest/download/uosc.conf)).
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+f` or `\` - In case `menu_type_to_search` config option is disabled, these two trigger the menu search instead.
- `ctrl+backspace` - Delete search query by word.
- `shift+backspace` - Clear search query.
- Holding `alt` while 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.
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