2013-10-15 20:27:08 +00:00
|
|
|
ON SCREEN CONTROLLER
|
|
|
|
====================
|
|
|
|
|
|
|
|
The On Screen Controller (short: OSC) is a minimal GUI integrated with mpv to
|
|
|
|
offer basic mouse-controllability. It is intended to make interaction easier
|
|
|
|
for new users and to enable precise and direct seeking.
|
|
|
|
|
2015-06-17 17:37:25 +00:00
|
|
|
The OSC is enabled by default if mpv was compiled with Lua support. It can be
|
2013-10-17 22:32:07 +00:00
|
|
|
disabled entirely using the ``--osc=no`` option.
|
2013-10-15 21:46:12 +00:00
|
|
|
|
2013-10-15 20:27:08 +00:00
|
|
|
Using the OSC
|
|
|
|
-------------
|
|
|
|
|
|
|
|
By default, the OSC will show up whenever the mouse is moved inside the
|
|
|
|
player window and will hide if the mouse is not moved outside the OSC for
|
|
|
|
0.5 seconds or if the mouse leaves the window.
|
|
|
|
|
|
|
|
The Interface
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
2013-10-15 21:22:52 +00:00
|
|
|
::
|
|
|
|
|
2017-04-17 13:17:05 +00:00
|
|
|
+---------+----------+------------------------------------------+----------+
|
|
|
|
| pl prev | pl next | title | cache |
|
|
|
|
+------+--+---+------+---------+-----------+------+-------+-----+-----+----+
|
|
|
|
| play | skip | skip | time | seekbar | time | audio | sub | vol | fs |
|
|
|
|
| | back | frwd | elapsed | | left | | | | |
|
|
|
|
+------+------+------+---------+-----------+------+-------+-----+-----+----+
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
|
2016-10-06 23:19:34 +00:00
|
|
|
pl prev
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
|
|
|
left-click play previous file in playlist
|
2016-10-08 00:43:23 +00:00
|
|
|
right-click show playlist
|
2013-10-15 20:27:08 +00:00
|
|
|
shift+L-click show playlist
|
|
|
|
============= ================================================
|
|
|
|
|
2016-10-06 23:19:34 +00:00
|
|
|
pl next
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
|
|
|
left-click play next file in playlist
|
2016-10-08 00:43:23 +00:00
|
|
|
right-click show playlist
|
2013-10-15 20:27:08 +00:00
|
|
|
shift+L-click show playlist
|
|
|
|
============= ================================================
|
|
|
|
|
2016-10-06 23:19:34 +00:00
|
|
|
title
|
2017-03-27 16:44:24 +00:00
|
|
|
| Displays current media-title, filename, or custom title
|
2013-10-15 21:22:52 +00:00
|
|
|
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
2017-03-27 16:40:48 +00:00
|
|
|
left-click show playlist position and length and full title
|
|
|
|
right-click show filename
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
|
|
|
|
2016-10-06 23:19:34 +00:00
|
|
|
cache
|
|
|
|
| Shows current cache fill status
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
play
|
|
|
|
============= ================================================
|
|
|
|
left-click toggle play/pause
|
|
|
|
============= ================================================
|
|
|
|
|
2016-10-06 23:19:34 +00:00
|
|
|
skip back
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
2016-10-06 23:19:34 +00:00
|
|
|
left-click go to beginning of chapter / previous chapter
|
2016-10-08 00:43:23 +00:00
|
|
|
right-click show chapters
|
2016-10-06 23:19:34 +00:00
|
|
|
shift+L-click show chapters
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
|
|
|
|
|
|
|
skip frwd
|
|
|
|
============= ================================================
|
|
|
|
left-click go to next chapter
|
2016-10-08 00:43:23 +00:00
|
|
|
right-click show chapters
|
2013-10-15 20:27:08 +00:00
|
|
|
shift+L-click show chapters
|
|
|
|
============= ================================================
|
|
|
|
|
2016-10-06 23:19:34 +00:00
|
|
|
time elapsed
|
|
|
|
| Shows current playback position timestamp
|
|
|
|
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
2016-10-06 23:19:34 +00:00
|
|
|
left-click toggle displaying timecodes with milliseconds
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
|
|
|
|
|
|
|
seekbar
|
|
|
|
| Indicates current playback position and position of chapters
|
2013-10-15 21:22:52 +00:00
|
|
|
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
|
|
|
left-click seek to position
|
|
|
|
============= ================================================
|
|
|
|
|
2016-10-06 23:19:34 +00:00
|
|
|
time left
|
|
|
|
| Shows remaining playback time timestamp
|
2013-10-15 21:22:52 +00:00
|
|
|
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
2016-10-06 23:19:34 +00:00
|
|
|
left-click toggle between total and remaining time
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
|
|
|
|
2016-10-06 23:19:34 +00:00
|
|
|
audio and sub
|
|
|
|
| Displays selected track and amount of available tracks
|
2013-10-15 21:22:52 +00:00
|
|
|
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
2016-10-06 23:19:34 +00:00
|
|
|
left-click cycle audio/sub tracks forward
|
|
|
|
right-click cycle audio/sub tracks backwards
|
|
|
|
shift+L-click show available audio/sub tracks
|
2013-10-15 20:27:08 +00:00
|
|
|
============= ================================================
|
|
|
|
|
2017-04-17 13:17:05 +00:00
|
|
|
vol
|
|
|
|
============= ================================================
|
|
|
|
left-click toggle mute
|
|
|
|
mouse wheel volume up/down
|
|
|
|
============= ================================================
|
|
|
|
|
|
|
|
fs
|
|
|
|
============= ================================================
|
|
|
|
left-click toggle fullscreen
|
|
|
|
============= ================================================
|
|
|
|
|
2014-09-01 02:25:57 +00:00
|
|
|
Key Bindings
|
|
|
|
~~~~~~~~~~~~
|
2014-03-20 21:49:31 +00:00
|
|
|
|
2014-09-01 02:25:57 +00:00
|
|
|
These key bindings are active by default if nothing else is already bound to
|
|
|
|
these keys. In case of collision, the function needs to be bound to a
|
2014-12-05 18:08:24 +00:00
|
|
|
different key. See the `Script Commands`_ section.
|
2014-05-23 11:24:27 +00:00
|
|
|
|
|
|
|
============= ================================================
|
2016-02-09 12:07:00 +00:00
|
|
|
del Cycles visibility between never / auto (mouse-move) / always
|
2014-05-23 11:24:27 +00:00
|
|
|
============= ================================================
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
Configuration
|
|
|
|
-------------
|
|
|
|
|
2014-05-23 11:24:27 +00:00
|
|
|
The OSC offers limited configuration through a config file
|
2017-12-13 17:37:42 +00:00
|
|
|
``script-opts/osc.conf`` placed in mpv's user dir and through the
|
2014-12-14 23:31:30 +00:00
|
|
|
``--script-opts`` command-line option. Options provided through the command-line
|
2014-05-23 11:24:27 +00:00
|
|
|
will override those from the config file.
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
Config Syntax
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The config file must exactly follow the following syntax::
|
|
|
|
|
|
|
|
# this is a comment
|
2014-05-23 11:24:27 +00:00
|
|
|
optionA=value1
|
|
|
|
optionB=value2
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
``#`` can only be used at the beginning of a line and there may be no
|
|
|
|
spaces around the ``=`` or anywhere else.
|
|
|
|
|
2014-05-23 11:24:27 +00:00
|
|
|
Command-line Syntax
|
|
|
|
~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
To avoid collisions with other scripts, all options need to be prefixed with
|
|
|
|
``osc-``.
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
2014-12-14 23:31:30 +00:00
|
|
|
--script-opts=osc-optionA=value1,osc-optionB=value2
|
2014-05-23 11:24:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
Configurable Options
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2013-10-15 20:27:08 +00:00
|
|
|
|
2016-10-23 16:21:08 +00:00
|
|
|
``layout``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: bottombar
|
|
|
|
|
|
|
|
The layout for the OSC. Currently available are: box, slimbox,
|
2016-10-30 10:28:42 +00:00
|
|
|
bottombar and topbar. Default pre-0.21.0 was 'box'.
|
2016-10-23 16:21:08 +00:00
|
|
|
|
|
|
|
``seekbarstyle``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: bar
|
|
|
|
|
2019-06-01 21:21:15 +00:00
|
|
|
Sets the style of the playback position marker and overall shape
|
|
|
|
of the seekbar: ``bar``, ``diamond`` or ``knob``.
|
|
|
|
|
|
|
|
``seekbarhandlesize``
|
|
|
|
Default: 0.6
|
|
|
|
|
|
|
|
Size ratio of the seek handle if ``seekbarstyle`` is set to ``dimaond``
|
|
|
|
or ``knob``. This is relative to the full height of the seekbar.
|
2016-10-23 16:21:08 +00:00
|
|
|
|
2017-10-20 18:59:18 +00:00
|
|
|
``seekbarkeyframes``
|
|
|
|
Default: yes
|
|
|
|
|
|
|
|
Controls the mode used to seek when dragging the seekbar. By default,
|
|
|
|
keyframes are used. If set to false, exact seeking on mouse drags
|
|
|
|
will be used instead. Keyframes are preferred, but exact seeks may be
|
|
|
|
useful in cases where keyframes cannot be found. Note that using exact
|
|
|
|
seeks can potentially make mouse dragging much slower.
|
|
|
|
|
2019-06-01 21:21:15 +00:00
|
|
|
``seekrangestyle``
|
|
|
|
Default: inverted
|
|
|
|
|
|
|
|
Display seekable ranges on the seekbar. ``bar`` shows them on the full
|
|
|
|
height of the bar, ``line`` as a thick line and ``inverted`` as a thin
|
|
|
|
line that is inverted over playback position markers. ``none`` will hide
|
|
|
|
them. Additionally, ``slider`` will show a permanent handle inside the seekbar
|
|
|
|
with cached ranges marked inside. Note that these will look differently
|
|
|
|
based on the seekbarstyle option. Also, ``slider`` does not work with
|
|
|
|
``seekbarstyle`` set to ``bar``.
|
|
|
|
|
|
|
|
``seekrangeseparate``
|
|
|
|
Default: yes
|
|
|
|
|
|
|
|
Controls whether to show line-style seekable ranges on top of the
|
|
|
|
seekbar or separately if ``seekbarstyle`` is set to ``bar``.
|
|
|
|
|
|
|
|
``seekrangealpha``
|
|
|
|
Default: 200
|
|
|
|
|
|
|
|
Alpha of the seekable ranges, 0 (opaque) to 255 (fully transparent).
|
|
|
|
|
2016-10-23 16:21:08 +00:00
|
|
|
``deadzonesize``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: 0.5
|
|
|
|
|
|
|
|
Size of the deadzone. The deadzone is an area that makes the mouse act
|
2016-10-30 10:28:42 +00:00
|
|
|
like leaving the window. Movement there won't make the OSC show up and
|
|
|
|
it will hide immediately if the mouse enters it. The deadzone starts
|
|
|
|
at the window border opposite to the OSC and the size controls how much
|
|
|
|
of the window it will span. Values between 0.0 and 1.0, where 0 means the
|
|
|
|
OSC will always popup with mouse movement in the window, and 1 means the
|
|
|
|
OSC will only show up when the mouse hovers it. Default pre-0.21.0 was 0.
|
2016-10-23 16:21:08 +00:00
|
|
|
|
|
|
|
``minmousemove``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: 0
|
|
|
|
|
|
|
|
Minimum amount of pixels the mouse has to move between ticks to make
|
2016-10-30 10:28:42 +00:00
|
|
|
the OSC show up. Default pre-0.21.0 was 3.
|
2016-10-23 16:21:08 +00:00
|
|
|
|
2013-10-15 20:27:08 +00:00
|
|
|
``showwindowed``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: yes
|
|
|
|
|
|
|
|
Enable the OSC when windowed
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
``showfullscreen``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: yes
|
|
|
|
|
|
|
|
Enable the OSC when fullscreen
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
``scalewindowed``
|
2016-10-27 16:18:21 +00:00
|
|
|
Default: 1.0
|
2016-10-26 21:55:27 +00:00
|
|
|
|
2016-10-27 16:18:21 +00:00
|
|
|
Scale factor of the OSC when windowed.
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
``scalefullscreen``
|
2016-10-27 16:18:21 +00:00
|
|
|
Default: 1.0
|
2016-10-26 21:55:27 +00:00
|
|
|
|
|
|
|
Scale factor of the OSC when fullscreen
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
``scaleforcedwindow``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: 2.0
|
|
|
|
|
|
|
|
Scale factor of the OSC when rendered on a forced (dummy) window
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
``vidscale``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: yes
|
|
|
|
|
|
|
|
Scale the OSC with the video
|
|
|
|
``no`` tries to keep the OSC size constant as much as the window size allows
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
``valign``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: 0.8
|
|
|
|
|
|
|
|
Vertical alignment, -1 (top) to 1 (bottom)
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
``halign``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: 0.0
|
|
|
|
|
|
|
|
Horizontal alignment, -1 (left) to 1 (right)
|
2013-10-15 20:27:08 +00:00
|
|
|
|
2016-10-10 21:53:33 +00:00
|
|
|
``barmargin``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: 0
|
|
|
|
|
|
|
|
Margin from bottom (bottombar) or top (topbar), in pixels
|
2016-10-10 21:53:33 +00:00
|
|
|
|
2013-10-17 22:32:07 +00:00
|
|
|
``boxalpha``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: 80
|
|
|
|
|
|
|
|
Alpha of the background box, 0 (opaque) to 255 (fully transparent)
|
2013-10-17 22:32:07 +00:00
|
|
|
|
2013-10-15 20:27:08 +00:00
|
|
|
``hidetimeout``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: 500
|
|
|
|
|
|
|
|
Duration in ms until the OSC hides if no mouse movement, must not be
|
2016-10-30 10:28:42 +00:00
|
|
|
negative
|
2013-10-15 20:27:08 +00:00
|
|
|
|
|
|
|
``fadeduration``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: 200
|
|
|
|
|
|
|
|
Duration of fade out in ms, 0 = no fade
|
2014-11-13 09:19:28 +00:00
|
|
|
|
2017-03-27 16:44:24 +00:00
|
|
|
``title``
|
|
|
|
Default: ${media-title}
|
|
|
|
|
|
|
|
String that supports property expansion that will be displayed as
|
|
|
|
OSC title.
|
2017-03-27 16:46:11 +00:00
|
|
|
ASS tags are escaped, and newlines and trailing slashes are stripped.
|
2017-03-27 16:44:24 +00:00
|
|
|
|
2016-10-05 15:47:24 +00:00
|
|
|
``tooltipborder``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: 1
|
|
|
|
|
|
|
|
Size of the tooltip outline when using bottombar or topbar layouts
|
2016-10-05 15:47:24 +00:00
|
|
|
|
2015-06-19 11:33:06 +00:00
|
|
|
``timetotal``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: no
|
|
|
|
|
|
|
|
Show total time instead of time remaining
|
2015-06-19 11:33:06 +00:00
|
|
|
|
|
|
|
``timems``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: no
|
|
|
|
|
|
|
|
Display timecodes with milliseconds
|
2015-06-19 11:33:06 +00:00
|
|
|
|
2016-02-09 12:07:00 +00:00
|
|
|
``visibility``
|
2016-10-26 21:55:27 +00:00
|
|
|
Default: auto (auto hide/show on mouse move)
|
|
|
|
|
|
|
|
Also supports ``never`` and ``always``
|
2016-02-09 12:07:00 +00:00
|
|
|
|
2017-04-02 18:17:26 +00:00
|
|
|
``boxmaxchars``
|
|
|
|
Default: 80
|
|
|
|
|
|
|
|
Max chars for the osc title at the box layout. mpv does not measure the
|
|
|
|
text width on screen and so it needs to limit it by number of chars. The
|
|
|
|
default is conservative to allow wide fonts to be used without overflow.
|
|
|
|
However, with many common fonts a bigger number can be used. YMMV.
|
|
|
|
|
osc: add feature to bottombar to not cover the video
Normally I use the OSC like this: not at all, but have a key binding
that does "cycle osc" to show it. And in that case, I don't really want
it to overlap the damn video.
I could use the zoom/pan options to move the video out of the way, but
this is also sort of annoying. Likewise, you could write a script or so
which does this automatically if the OSC appears, but that's still
annoying, and computing values for these options such that the video is
moved correctly is tricky.
So I added a bunch of options that set explicit video borders (previous
commit), and a option for the OSC to use them (this commit).
Disabled by default, since I'm afraid this is too awkward and
unpolished, especially with OSC default settings.
I'm also using "osc-visibility=always". Effectively, making the OSC
appear will box the video, and making it disappear (by unloading
osc.lua) will restore the video back to normal.
2019-06-15 16:02:54 +00:00
|
|
|
``boxvideo``
|
|
|
|
Default: no
|
|
|
|
|
|
|
|
Whether to overlay the osc over the video (``no``), or to box the video
|
|
|
|
within the areas not covered by the osc (``yes``). If this option is set,
|
|
|
|
the osc may overwrite the ``--video-margin-ratio-*`` options, even if the
|
|
|
|
user has set them. (It will not overwrite them if all of them are set to
|
|
|
|
default values.)
|
|
|
|
|
|
|
|
Currently, this is supported for the ``bottombar`` layout only. The other
|
|
|
|
layouts do not change if this option is set.
|
|
|
|
|
|
|
|
The border is static and appears even if the OSC is configured to appear
|
|
|
|
only on mouse interaction. If the OSC is invisible, the border is simply
|
|
|
|
filled with the background color (black by default).
|
|
|
|
|
|
|
|
This currently still makes the OSC overlap with subtitles (if the
|
|
|
|
``--sub-use-margins`` option is set to ``yes``, the default). This may be
|
|
|
|
fixed later.
|
|
|
|
|
2014-05-23 11:24:27 +00:00
|
|
|
Script Commands
|
2014-03-20 21:49:31 +00:00
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The OSC script listens to certain script commands. These commands can bound
|
|
|
|
in ``input.conf``, or sent by other scripts.
|
|
|
|
|
2014-12-29 17:26:22 +00:00
|
|
|
``osc-message``
|
|
|
|
Show a message on screen using the OSC. First argument is the message,
|
|
|
|
second the duration in seconds.
|
|
|
|
|
2016-02-09 12:07:00 +00:00
|
|
|
``osc-visibility``
|
|
|
|
Controls visibility mode ``never`` / ``auto`` (on mouse move) / ``always``
|
|
|
|
and also ``cycle`` to cycle between the modes
|
2014-03-20 21:49:31 +00:00
|
|
|
|
2014-05-23 11:24:27 +00:00
|
|
|
Example
|
2014-03-20 21:49:31 +00:00
|
|
|
|
2014-05-23 11:24:27 +00:00
|
|
|
You could put this into ``input.conf`` to hide the OSC with the ``a`` key and
|
2016-02-09 12:07:00 +00:00
|
|
|
to set auto mode (the default) with ``b``::
|
2014-03-20 21:49:31 +00:00
|
|
|
|
2016-05-09 18:39:33 +00:00
|
|
|
a script-message osc-visibility never
|
|
|
|
b script-message osc-visibility auto
|
2014-03-20 21:49:31 +00:00
|
|
|
|
2016-10-23 21:20:08 +00:00
|
|
|
``osc-playlist``, ``osc-chapterlist``, ``osc-tracklist``
|
|
|
|
Shows a limited view of the respective type of list using the OSC. First
|
|
|
|
argument is duration in seconds.
|
|
|
|
|