2012-09-27 01:20:12 +00:00
|
|
|
INPUT.CONF
|
|
|
|
==========
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
The input.conf file consists of a list of key bindings, for example::
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
s screenshot # take a screenshot with the s key
|
2012-09-27 01:20:12 +00:00
|
|
|
|
|
|
|
Each line maps a key to an input command. Keys are specified with their literal
|
|
|
|
value (upper case if combined with ``Shift``), or a name for special keys. For
|
|
|
|
example, ``a`` maps to the ``a`` key without shift, and ``A`` maps to ``a``
|
|
|
|
with shift.
|
|
|
|
|
|
|
|
A list of special keys can be obtained with
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``mpv --input-keylist``
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
In general, keys can be combined with ``Shift``, ``Ctrl`` and ``Alt``::
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
ctrl+q quit
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2012-10-23 23:06:00 +00:00
|
|
|
**mpv** can be started in input test mode, which displays key bindings and the
|
2013-07-08 16:02:14 +00:00
|
|
|
commands they're bound to on the OSD, instead of executing the commands::
|
2012-10-23 23:06:00 +00:00
|
|
|
|
2013-07-21 16:06:27 +00:00
|
|
|
mpv --input-test --demuxer=rawvideo --demuxer-rawvideo=w=1280:h=720 /dev/zero
|
2012-10-23 23:06:00 +00:00
|
|
|
|
|
|
|
(Commands which normally close the player will not work in this mode, and you
|
|
|
|
must kill **mpv** externally to make it exit.)
|
|
|
|
|
2013-07-07 18:37:47 +00:00
|
|
|
General Input Command Syntax
|
2012-09-27 01:20:12 +00:00
|
|
|
----------------------------
|
|
|
|
|
2013-07-08 17:27:45 +00:00
|
|
|
``[Shift+][Ctrl+][Alt+][Meta+]<key> [{<section>}] [<prefixes>] <command> (<argument>)* [; <command>]``
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-12-01 05:23:39 +00:00
|
|
|
Note that by default, the right Alt key can be used to create special
|
|
|
|
characters, and thus does not register as a modifier. The option
|
|
|
|
``--no-right-alt-gr`` changes this behavior.
|
|
|
|
|
2012-09-27 01:20:12 +00:00
|
|
|
Newlines always start a new binding. ``#`` starts a comment (outside of quoted
|
|
|
|
string arguments). To bind commands to the ``#`` key, ``SHARP`` can be used.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``<key>`` is either the literal character the key produces (ASCII or Unicode
|
2013-09-10 13:09:24 +00:00
|
|
|
character), or a symbolic name (as printed by ``--input-keylist``).
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``<section>`` (braced with ``{`` and ``}``) is the input section for this
|
|
|
|
command.
|
2013-06-23 00:31:51 +00:00
|
|
|
|
2012-09-27 01:20:12 +00:00
|
|
|
Arguments are separated by whitespace. This applies even to string arguments.
|
|
|
|
For this reason, string arguments should be quoted with ``"``. Inside quotes,
|
2013-07-08 16:02:14 +00:00
|
|
|
C-style escaping can be used.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 17:27:45 +00:00
|
|
|
You can bind multiple commands to one key. For example:
|
|
|
|
|
|
|
|
| a show_text "command 1" ; show_text "command 2"
|
|
|
|
|
2013-07-07 18:37:47 +00:00
|
|
|
List of Input Commands
|
2012-09-27 01:20:12 +00:00
|
|
|
----------------------
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``ignore``
|
2012-09-27 01:20:12 +00:00
|
|
|
Use this to "block" keys that should be unbound, and do nothing. Useful for
|
|
|
|
disabling default bindings, without disabling all bindings with
|
options: drop --opt:subopt option names
For all suboptions, "flat" options were available by separating the
parent option and the sub option with ":", e.g. "--rawvideo:w=123". Drop
this syntax and use "-" as separator. This means even suboptions are
available as normal options now, e.g. "--rawvideo-w=123". The old syntax
doesn't work anymore.
Note that this is completely separate from actual suboptions. For
example, "-rawvideo w=123:h=123" still works. (Not that this syntax is
worth supporting, but it's needed anyway, for for other things like vf
and vo suboptions.)
As a consequence of this change, we also have to add new "no-" prefixed
options for flag suboptions, so that "--no-input-default-bindings"
works. ("--input-no-default-bindings" also works as a consequence of
allowing "-input no-default-bindings" - they are handled by the same
underlying option.)
For --input, always use the full syntax in the manpage. There exist
suboptions other than --input (like --tv, --rawvideo, etc.), but since
they might be handled differently in the future, don't touch these yet.
M_OPT_PREFIXED becomes the default, so remove it. As a minor unrelated
cleanup, get rid of M_OPT_MERGE too and use the OPT_SUBSTRUCT() macro in
some places.
Unrelated: remove the duplicated --tv:buffersize option, fix a typo in
changes.rst.
2013-02-21 21:10:21 +00:00
|
|
|
``--no-input-default-bindings``.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``seek <seconds> [relative|absolute|absolute-percent|- [default-precise|exact|keyframes]]``
|
2012-09-27 01:20:12 +00:00
|
|
|
Change the playback position. By default, seeks by a relative amount of
|
|
|
|
seconds.
|
|
|
|
|
|
|
|
The second argument sets the seek mode:
|
|
|
|
|
|
|
|
relative (default)
|
|
|
|
Seek relative to current position (a negative value seeks backwards).
|
|
|
|
absolute
|
|
|
|
Seek to a given time.
|
|
|
|
absolute-percent
|
2012-10-23 23:06:00 +00:00
|
|
|
Seek to a given percent position.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
|
|
|
The third argument defines how exact the seek is:
|
|
|
|
|
|
|
|
default-precise (default)
|
|
|
|
Follow the default behavior as set by ``--hr-seek``, which by default
|
|
|
|
does imprecise seeks (like ``keyframes``).
|
|
|
|
exact
|
|
|
|
Always do exact/hr/precise seeks (slow).
|
|
|
|
keyframes
|
|
|
|
Always restart playback at keyframe boundaries (fast).
|
|
|
|
|
2013-12-01 01:07:32 +00:00
|
|
|
``revert_seek``
|
|
|
|
Undoes the ``seek`` command, and some other commands that seek (but not
|
|
|
|
necessarily all of them). Calling this command once will jump to the
|
|
|
|
playback position before the seek. Calling it a second time undoes the
|
|
|
|
``revert_seek`` command itself.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``frame_step``
|
2012-11-15 13:25:20 +00:00
|
|
|
Play one frame, then pause.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``frame_back_step``
|
core: add backstep support
Allows stepping back one frame via the frame_back_step inout command,
bound to "," by default.
This uses the precise seeking facility, and a perfect frame index built
on the fly. The index is built during playback and precise seeking, and
contains (as of this commit) the last 100 displayed or skipped frames.
This index is used to find the PTS of the previous frame, which is then
used as target for a precise seek. If no PTS is found, the core attempts
to do a seek before the current frame, and skip decoded frames until the
current frame is reached; this will create a sufficient index and the
normal backstep algorithm can be applied.
This can be rather slow. The worst case for backstepping is about the
same as the worst case for precise seeking if the previous frame can be
deduced from the index. If not, the worst case will be twice as slow.
There's also some minor danger that the index is incorrect in case
framedropping is involved. For framedropping due to --framedrop, this
problem is ignored (use of --framedrop is discouraged anyway). For
framedropping during precise seeking (done to make it faster), we try
to not add frames to the index that are produced when this can happen.
I'm not sure how well that works (or if the logic is sane), and it's
sure to break with some video filters. In the worst case, backstepping
might silently skip frames if you backstep after a user-initiated
precise seek. (Precise seeks to do indexing are not affected.)
Likewise, video filters that somehow change timing of frames and do not
do this in a deterministic way (i.e. if you seek to a position, frames
with different timings are produced than when the position is reached
during normal playback) will make backstepping silently jump to the
wrong frame. Enabling/disabling filters during playback (like for
example deinterlacing) will have similar bad effects.
2013-04-24 17:31:48 +00:00
|
|
|
Go back by one frame, then pause. Note that this can be very slow (it tries
|
|
|
|
to be precise, not fast), and sometimes fails to behave as expected. How
|
|
|
|
well this works depends on whether precise seeking works correctly (e.g.
|
|
|
|
see the ``--hr-seek-demuxer-offset`` option). Video filters or other video
|
|
|
|
postprocessing that modifies timing of frames (e.g. deinterlacing) should
|
|
|
|
usually work, but might make backstepping silently behave incorrectly in
|
|
|
|
corner cases.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
This does not work with audio-only playback.
|
core: add backstep support
Allows stepping back one frame via the frame_back_step inout command,
bound to "," by default.
This uses the precise seeking facility, and a perfect frame index built
on the fly. The index is built during playback and precise seeking, and
contains (as of this commit) the last 100 displayed or skipped frames.
This index is used to find the PTS of the previous frame, which is then
used as target for a precise seek. If no PTS is found, the core attempts
to do a seek before the current frame, and skip decoded frames until the
current frame is reached; this will create a sufficient index and the
normal backstep algorithm can be applied.
This can be rather slow. The worst case for backstepping is about the
same as the worst case for precise seeking if the previous frame can be
deduced from the index. If not, the worst case will be twice as slow.
There's also some minor danger that the index is incorrect in case
framedropping is involved. For framedropping due to --framedrop, this
problem is ignored (use of --framedrop is discouraged anyway). For
framedropping during precise seeking (done to make it faster), we try
to not add frames to the index that are produced when this can happen.
I'm not sure how well that works (or if the logic is sane), and it's
sure to break with some video filters. In the worst case, backstepping
might silently skip frames if you backstep after a user-initiated
precise seek. (Precise seeks to do indexing are not affected.)
Likewise, video filters that somehow change timing of frames and do not
do this in a deterministic way (i.e. if you seek to a position, frames
with different timings are produced than when the position is reached
during normal playback) will make backstepping silently jump to the
wrong frame. Enabling/disabling filters during playback (like for
example deinterlacing) will have similar bad effects.
2013-04-24 17:31:48 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``set <property> "<value>"``
|
2012-09-27 01:20:12 +00:00
|
|
|
Set the given property to the given value.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``add <property> [<value>]``
|
2012-09-27 01:20:12 +00:00
|
|
|
Add the given value to the property. On overflow or underflow, clamp the
|
2013-07-08 16:02:14 +00:00
|
|
|
property to the maximum. If ``<value>`` is omitted, assume ``1``.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``cycle <property> [up|down]``
|
2012-10-12 07:21:26 +00:00
|
|
|
Cycle the given property. ``up`` and ``down`` set the cycle direction. On
|
2012-09-27 01:20:12 +00:00
|
|
|
overflow, set the property back to the minimum, on underflow set it to the
|
2012-10-12 07:21:26 +00:00
|
|
|
maximum. If ``up`` or ``down`` is omitted, assume ``up``.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-10-31 22:23:38 +00:00
|
|
|
``multiply <property> <factor>``
|
|
|
|
Multiplies the value of a property with the numeric factor.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``screenshot [subtitles|video|window|- [single|each-frame]]``
|
2012-09-27 01:20:12 +00:00
|
|
|
Take a screenshot.
|
|
|
|
|
|
|
|
First argument:
|
|
|
|
|
2012-10-20 21:58:02 +00:00
|
|
|
<subtitles> (default)
|
|
|
|
Save the video image, in its original resolution, and with subtitles.
|
|
|
|
Some video outputs may still include the OSD in the output under certain
|
|
|
|
circumstances.
|
|
|
|
<video>
|
|
|
|
Like ``subtitles``, but typically without OSD or subtitles. The exact
|
|
|
|
behavior depends on the selected video output.
|
|
|
|
<window>
|
2012-10-21 10:33:18 +00:00
|
|
|
Save the contents of the mpv window. Typically scaled, with OSD and
|
2012-10-20 21:58:02 +00:00
|
|
|
subtitles. The exact behavior depends on the selected video output, and
|
|
|
|
if no support is available, this will act like ``video``.
|
|
|
|
|
|
|
|
Second argument:
|
|
|
|
|
2012-09-27 01:20:12 +00:00
|
|
|
<single> (default)
|
|
|
|
Take a single screenshot.
|
|
|
|
<each-frame>
|
|
|
|
Take a screenshot each frame. Issue this command again to stop taking
|
|
|
|
screenshots.
|
|
|
|
|
2013-07-08 18:34:26 +00:00
|
|
|
``screenshot_to_file "<filename>" [subtitles|video|window]``
|
|
|
|
Take a screenshot and save it to a given file. The format of the file will
|
|
|
|
be guessed by the extension (and ``--screenshot-format`` is ignored - the
|
|
|
|
behavior when the extension is missing or unknown is arbitrary).
|
|
|
|
|
|
|
|
The second argument is like the first argument to ``screenshot``.
|
|
|
|
|
|
|
|
This command tries to never overwrite files. If the file already exists,
|
|
|
|
it fails.
|
|
|
|
|
|
|
|
Like all input command parameters, the filename is subject to property
|
|
|
|
expansion as described in `Property Expansion`_.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``playlist_next [weak|force]``
|
2012-09-27 01:20:12 +00:00
|
|
|
Go to the next entry on the playlist.
|
|
|
|
|
|
|
|
weak (default)
|
|
|
|
If the last file on the playlist is currently played, do nothing.
|
|
|
|
force
|
|
|
|
Terminate playback if there are no more files on the playlist.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``playlist_prev [weak|force]``
|
2012-09-27 01:20:12 +00:00
|
|
|
Go to the previous entry on the playlist.
|
|
|
|
|
|
|
|
weak (default)
|
|
|
|
If the first file on the playlist is currently played, do nothing.
|
|
|
|
force
|
|
|
|
Terminate playback if the first file is being played.
|
|
|
|
|
2014-02-24 22:59:51 +00:00
|
|
|
``loadfile "<file>" [replace|append [options]]``
|
2012-09-27 01:20:12 +00:00
|
|
|
Load the given file and play it.
|
|
|
|
|
|
|
|
Second argument:
|
|
|
|
|
|
|
|
<replace> (default)
|
|
|
|
Stop playback of the current file, and play the new file immediately.
|
|
|
|
<append>
|
|
|
|
Append the file to the playlist.
|
|
|
|
|
2014-02-24 22:59:51 +00:00
|
|
|
The third argument is a list of options and values which should be set
|
|
|
|
while the file is playing. It is of the form ``opt1=value1,opt2=value2,..``.
|
|
|
|
Not all options can be changed this way. Some options require a restart
|
|
|
|
of the player.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``loadlist "<playlist>" [replace|append]``
|
2012-09-27 01:20:12 +00:00
|
|
|
Load the given playlist file (like ``--playlist``).
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``playlist_clear``
|
2012-09-27 01:20:12 +00:00
|
|
|
Clear the playlist, except the currently played file.
|
|
|
|
|
2013-11-28 18:13:48 +00:00
|
|
|
``playlist_remove current|<index>``
|
2013-07-02 11:17:50 +00:00
|
|
|
Remove the playlist entry at the given index. Index values start counting
|
2013-11-28 18:13:48 +00:00
|
|
|
with 0. The special value ``current`` removes the current entry. Note that
|
|
|
|
removing the current entry also stops playback and starts playing the next
|
|
|
|
entry.
|
2013-07-02 11:17:50 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``playlist_move <index1> <index2>``
|
2013-07-02 11:17:50 +00:00
|
|
|
Move the playlist entry at index1, so that it takes the place of the
|
|
|
|
entry index2. (Paradoxically, the moved playlist entry will not have
|
|
|
|
the index value index2 after moving if index1 was lower than index2,
|
|
|
|
because index2 refers to the target entry, not the index the entry
|
|
|
|
will have after moving.)
|
|
|
|
|
2013-11-29 22:36:44 +00:00
|
|
|
``run "command" "arg1" "arg2" ...``
|
2013-12-07 18:28:49 +00:00
|
|
|
(Unix only)
|
2013-11-29 22:36:44 +00:00
|
|
|
Run the given command. Unlike in MPlayer/mplayer2 and earlier versions of
|
|
|
|
mpv (0.2.x and older), this doesn't call the shell. Instead, the command
|
|
|
|
is run directly, with each argument passed separately. Each argument is
|
|
|
|
expanded like in `Property Expansion`_. Note that there is a static limit
|
|
|
|
of (as of this writing) 10 arguments (this limit could be raised on demand).
|
|
|
|
|
2013-12-14 18:56:02 +00:00
|
|
|
The program is run in a detached way. mpv doesn't wait until the command
|
|
|
|
is completed, but continues playback right after spawning it.
|
|
|
|
|
2013-11-29 22:36:44 +00:00
|
|
|
To get the old behavior, use ``/bin/sh`` and ``-c`` as the first two
|
|
|
|
arguments.
|
|
|
|
|
|
|
|
.. admonition:: Example
|
|
|
|
|
|
|
|
``run "/bin/sh" "-c" "echo ${title} > /tmp/playing"``
|
|
|
|
|
|
|
|
This is not a particularly good example, because it doesn't handle
|
|
|
|
escaping, and a specially prepared file might allow an attacker to
|
|
|
|
execute arbitrary shell commands. It is recommended to write a small
|
|
|
|
shell script, and call that with ``run``.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``quit [<code>]``
|
2012-09-27 01:20:12 +00:00
|
|
|
Exit the player using the given exit code.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``quit_watch_later``
|
core: add playback resume feature (manual/opt-in)
A "watch later" command is now mapped to Shift+Q. This quits the player
and stores the playback state in a config file in ~/.mpv/watch_later/.
When calling the player with the same file again, playback is resumed
at that time position.
It's also possible to make mpv save playback state always on quit with
the --save-position-on-quit option. Likewise, resuming can be disabled
with the --no-resume-playback option.
This also attempts to save some playback parameters, like fullscreen
state or track selection. This will unconditionally override config
settings and command line options (which is probably not what you would
expect, but in general nobody will really care about this). Some things
are not backed up, because that would cause various problems. Additional
subtitle files, video filters, etc. are not stored because that would be
too hard and fragile. Volume/mute state are not stored because it would
mess up if the system mixer is used, or if the system mixer was
readjusted in the meantime.
Basically, the tradeoff between perfect state restoration and
complexity/fragility makes it not worth to attempt to implement
it perfectly, even if the result is a little bit inconsistent.
2013-05-05 17:37:29 +00:00
|
|
|
Exit player, and store current playback position. Playing that file later
|
|
|
|
will seek to the previous position on start.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``sub_add "<file>"``
|
|
|
|
Load the given subtitle file. It is not selected as current subtitle after
|
2012-09-27 01:20:12 +00:00
|
|
|
loading.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``sub_remove [<id>]``
|
2012-11-15 19:26:52 +00:00
|
|
|
Remove the given subtitle track. If the ``id`` argument is missing, remove
|
|
|
|
the current track. (Works on external subtitle files only.)
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``sub_reload [<id>]``
|
2012-11-15 19:26:52 +00:00
|
|
|
Reload the given subtitle tracks. If the ``id`` argument is missing, remove
|
|
|
|
the current track. (Works on external subtitle files only.)
|
|
|
|
|
|
|
|
This works by unloading and re-adding the subtitle track.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``sub_step <skip>``
|
|
|
|
Change subtitle timing such, that the subtitle event after the next
|
|
|
|
``<skip>`` subtitle events is displayed. ``<skip>`` can be negative to step
|
|
|
|
backwards.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-10-02 19:05:04 +00:00
|
|
|
``sub_seek <skip>``
|
|
|
|
Seek to the next (skip set to 1) or the previous (skip set to -1) subtitle.
|
|
|
|
This is similar to ``sub_step``, except that it seeks video and audio
|
|
|
|
instead of adjusting the subtitle delay.
|
|
|
|
|
|
|
|
Like with ``sub_step``, this works with external text subtitles only. For
|
|
|
|
embedded text subtitles (like with Matroska), this works only with subtitle
|
|
|
|
events that have already been displayed.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``osd [<level>]``
|
|
|
|
Toggle OSD level. If ``<level>`` is specified, set the OSD mode
|
2012-09-27 01:20:12 +00:00
|
|
|
(see ``--osd-level`` for valid values).
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``print_text "<string>"``
|
2013-06-08 16:04:36 +00:00
|
|
|
Print text to stdout. The string can contain properties (see
|
2013-07-08 16:02:14 +00:00
|
|
|
`Property Expansion`_).
|
2012-10-11 00:24:13 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``show_text "<string>" [<duration>|- [<level>]]``
|
2012-09-27 01:20:12 +00:00
|
|
|
Show text on the OSD. The string can contain properties, which are expanded
|
2013-07-08 16:02:14 +00:00
|
|
|
as described in `Property Expansion`_. This can be used to show playback
|
2013-06-08 16:04:36 +00:00
|
|
|
time, filename, and so on.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
<duration>
|
|
|
|
The time in ms to show the message for. By default, it uses the same
|
|
|
|
value as ``--osd-duration``.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
<level>
|
|
|
|
The minimum OSD level to show the text at (see ``--osd-level``).
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``show_progress``
|
2012-09-27 01:20:12 +00:00
|
|
|
Show the progress bar, the elapsed time and the total duration of the file
|
|
|
|
on the OSD.
|
|
|
|
|
2013-07-07 18:37:47 +00:00
|
|
|
Input Commands that are Possibly Subject to Change
|
2013-05-18 09:29:52 +00:00
|
|
|
--------------------------------------------------
|
|
|
|
|
2013-07-22 12:43:58 +00:00
|
|
|
``af set|add|toggle|del|clr "filter1=params,filter2,..."``
|
|
|
|
Change audio filter chain. See ``vf`` command.
|
2013-05-18 09:29:52 +00:00
|
|
|
|
2013-07-22 12:43:58 +00:00
|
|
|
``vf set|add|toggle|del|clr "filter1=params,filter2,..."``
|
2013-05-18 09:44:17 +00:00
|
|
|
Change video filter chain.
|
|
|
|
|
|
|
|
The first argument decides what happens:
|
|
|
|
|
|
|
|
set
|
|
|
|
Overwrite the previous filter chain with the new one.
|
|
|
|
|
|
|
|
add
|
|
|
|
Append the new filter chain to the previous one.
|
|
|
|
|
|
|
|
toggle
|
|
|
|
Check if the given filter (with the exact parameters) is already
|
|
|
|
in the video chain. If yes, remove the filter. If no, add the filter.
|
|
|
|
(If several filters are passed to the command, this is done for
|
|
|
|
each filter.)
|
|
|
|
|
|
|
|
del
|
|
|
|
Remove the given filters from the video chain. Unlike in the other
|
|
|
|
cases, the second parameter is a comma separated list of filter names
|
|
|
|
or integer indexes. ``0`` would denote the first filter. Negative
|
|
|
|
indexes start from the last filter, and ``-1`` denotes the last
|
|
|
|
filter.
|
|
|
|
|
2013-07-22 12:43:58 +00:00
|
|
|
clr
|
|
|
|
Remove all filters. Note that like the other sub-commands, this does
|
|
|
|
not control automatically inserted filters.
|
|
|
|
|
2013-05-22 21:19:57 +00:00
|
|
|
You can assign labels to filter by prefixing them with ``@name:`` (where
|
2013-07-08 16:02:14 +00:00
|
|
|
``name`` is a user-chosen arbitrary identifier). Labels can be used to
|
2013-05-22 21:19:57 +00:00
|
|
|
refer to filters by name in all of the filter chain modification commands.
|
|
|
|
For ``add``, using an already used label will replace the existing filter.
|
|
|
|
|
2013-08-03 11:54:02 +00:00
|
|
|
The ``vf`` command shows the list of requested filters on the OSD after
|
|
|
|
changing the filter chain. This is roughly equivalent to
|
|
|
|
``show_text ${vf}``. Note that auto-inserted filters for format conversion
|
|
|
|
are not shown on the list, only what was requested by the user.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
.. admonition:: Example for input.conf
|
2013-05-18 09:44:17 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
- ``a vf set flip`` turn video upside-down on the ``a`` key
|
|
|
|
- ``b vf set ""`` remove all video filters on ``b``
|
|
|
|
- ``c vf toggle lavfi=gradfun`` toggle debanding on ``c``
|
2013-05-18 09:44:17 +00:00
|
|
|
|
2013-11-29 23:18:24 +00:00
|
|
|
``cycle_values ["!reverse"] <property> "<value1>" "<value2>" ...``
|
|
|
|
Cycle through a list of values. Each invocation of the command will set the
|
|
|
|
given property to the next value in the list. The command maintains an
|
|
|
|
internal counter which value to pick next, and which is initially 0. It is
|
|
|
|
reset to 0 once the last value is reached.
|
|
|
|
|
|
|
|
The internal counter is associated using the property name and the value
|
|
|
|
list. If multiple commands (bound to different keys) use the same name
|
|
|
|
and value list, they will share the internal counter.
|
|
|
|
|
|
|
|
The special argument ``!reverse`` can be used to cycle the value list in
|
|
|
|
reverse. Compared with a command that just lists the value in reverse, this
|
|
|
|
command will actually share the internal counter with the forward-cycling
|
|
|
|
key binding.
|
|
|
|
|
|
|
|
Note that there is a static limit of (as of this writing) 10 arguments
|
|
|
|
(this limit could be raised on demand).
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``enable_section "<section>" [default|exclusive]``
|
2013-06-22 23:28:28 +00:00
|
|
|
Enable all key bindings in the named input section.
|
|
|
|
|
|
|
|
The enabled input sections form a stack. Bindings in sections on the top of
|
|
|
|
the stack are preferred to lower sections. This command puts the section
|
2013-07-08 16:02:14 +00:00
|
|
|
on top of the stack. If the section was already on the stack, it is
|
|
|
|
implicitly removed beforehand. (A section cannot be on the stack more than
|
|
|
|
once.)
|
2013-06-22 23:28:28 +00:00
|
|
|
|
|
|
|
If ``exclusive`` is specified as second argument, all sections below the
|
|
|
|
newly enabled section are disabled. They will be re-enabled as soon as
|
2013-07-08 16:02:14 +00:00
|
|
|
all exclusive sections above them are removed.
|
2013-06-22 23:28:28 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``disable_section "<section>"``
|
2013-06-22 23:28:28 +00:00
|
|
|
Disable the named input section. Undoes ``enable_section``.
|
|
|
|
|
2013-09-30 20:27:37 +00:00
|
|
|
``overlay_add <id> <x> <y> "<file>" <offset> "<fmt>" <w> <h> <stride>``
|
|
|
|
Add an OSD overlay sourced from raw data. This might be useful for scripts
|
|
|
|
and applications controlling mpv, and which want to display things on top
|
|
|
|
of the video window.
|
|
|
|
|
|
|
|
Overlays are usually displayed in screen resolution, but with some VOs,
|
|
|
|
the resolution is reduced to that of the video's. You can read the
|
|
|
|
``osd-width`` and ``osd-height`` properties. At least with ``--vo-xv`` and
|
|
|
|
anamorphic video (such as DVD), ``osd-par`` should be read as well, and the
|
|
|
|
overlay should be aspect-compensated. (Future directions: maybe mpv should
|
|
|
|
take care of some of these things automatically, but it's hard to tell
|
|
|
|
where to draw the line.)
|
|
|
|
|
|
|
|
``id`` is an integer between 0 and 63 identifying the overlay element. The
|
|
|
|
ID can be used to add multiple overlay parts, update a part by using this
|
|
|
|
command with an already existing ID, or to remove a part with
|
|
|
|
``overlay_remove``. Using a previously unused ID will add a new overlay,
|
|
|
|
while reusing an ID will update it. (Future directions: there should be
|
|
|
|
something to ensure different programs wanting to create overlays don't
|
|
|
|
conflict with each others, should that ever be needed.)
|
|
|
|
|
|
|
|
``x`` and ``y`` specify the position where the OSD should be displayed.
|
|
|
|
|
|
|
|
``file`` specifies the file the raw image data is read from. It can be
|
|
|
|
either a numeric UNIX file descriptor prefixed with ``@`` (e.g. ``@4``),
|
|
|
|
or a filename. The file will be mapped into memory with ``mmap()``. Some VOs
|
|
|
|
will pass the mapped pointer directly to display APIs (e.g. opengl or
|
|
|
|
vdpau), so no actual copying is involved. Truncating the source file while
|
|
|
|
the overlay is active will crash the player. You shouldn't change the data
|
|
|
|
while the overlay is active, because the data is essentially accessed at
|
|
|
|
random points. Instead, call ``overlay_add`` again (preferably with a
|
|
|
|
different memory region to prevent tearing).
|
|
|
|
|
|
|
|
``offset`` is the offset of the first pixel in the source file. It is
|
|
|
|
passed directly to ``mmap`` and is subject to certain restrictions
|
|
|
|
(see ``man mmap`` for details). In particular, this value has to be a
|
|
|
|
multiple of the system's page size.
|
|
|
|
|
|
|
|
``fmt`` is a string identifying the image format. Currently, only ``bgra``
|
|
|
|
is defined. This format has 4 bytes per pixels, with 8 bits per component.
|
|
|
|
The least significant 8 bits are blue, and the most significant 8 bits
|
|
|
|
are alpha (in little endian, the components are B-G-R-A, with B as first
|
|
|
|
byte). This uses premultiplied alpha: every color component is already
|
|
|
|
multiplied with the alpha component. This means the numeric value of each
|
|
|
|
component is equal to or smaller than the alpha component. (Violating this
|
|
|
|
rule will lead to different results with different VOs: numeric overflows
|
|
|
|
resulting from blending broken alpha values is considered something that
|
|
|
|
shouldn't happen, and consequently implementations don't ensure that you
|
|
|
|
get predictable behavior in this case.)
|
|
|
|
|
|
|
|
``w``, ``h``, and ``stride`` specify the size of the overlay. ``w`` is the
|
|
|
|
visible width of the overlay, while ``stride`` gives the width in bytes in
|
|
|
|
memory. In the simple case, and with the ``bgra`` format, ``stride==4*w``.
|
|
|
|
In general, the total amount of memory accessed is ``stride * h``.
|
|
|
|
(Technically, the minimum size would be ``stride * (h - 1) + w * 4``, but
|
|
|
|
for simplicity, the player will access all ``stride * h`` bytes.)
|
|
|
|
|
|
|
|
.. admonition:: Warning
|
|
|
|
|
|
|
|
When updating the overlay, you should prepare a second shared memory
|
|
|
|
region (e.g. make use of the offset parameter) and add this as overlay,
|
|
|
|
instead of reusing the same memory every time. Otherwise, you might
|
|
|
|
get the equivalent of tearing, when your application and mpv write/read
|
|
|
|
the buffer at the same time. Also, keep in mind that mpv might access
|
|
|
|
an overlay's memory at random times whenever it feels the need to do
|
|
|
|
so, for example when redrawing the screen.
|
|
|
|
|
|
|
|
``overlay_remove <id>``
|
|
|
|
Remove an overlay added with ``overlay_add`` and the same ID. Does nothing
|
|
|
|
if no overlay with this ID exists.
|
|
|
|
|
2014-02-17 19:23:30 +00:00
|
|
|
``script_message "<target>" "<arg1>" "<arg2>" ...``
|
|
|
|
Send a message to the client named ``<target>``, and pass it the following
|
|
|
|
list of arguments. The target can be for example a script (Lua scripts
|
|
|
|
can get their name via ``mp.get_script_name()``). What this message means,
|
|
|
|
how many arguments it takes, and what the arguments mean is fully up to
|
|
|
|
the target and the sender. Lua scripts use it to add key bindings via
|
|
|
|
input.conf.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
Undocumented commands: ``tv_start_scan``, ``tv_step_channel``, ``tv_step_norm``,
|
|
|
|
``tv_step_chanlist``, ``tv_set_channel``, ``tv_last_channel``, ``tv_set_freq``,
|
2013-12-19 20:25:40 +00:00
|
|
|
``tv_step_freq``, ``tv_set_norm``, ``dvb_set_channel`` (all of these
|
2013-07-08 16:02:14 +00:00
|
|
|
should be replaced by properties), ``stop`` (questionable use), ``get_property``
|
2013-07-22 12:43:58 +00:00
|
|
|
(?), ``vo_cmdline`` (experimental).
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-07 18:37:47 +00:00
|
|
|
Input Command Prefixes
|
2012-09-27 01:20:12 +00:00
|
|
|
----------------------
|
|
|
|
|
2013-09-10 13:09:24 +00:00
|
|
|
These prefixes are placed between key name and the actual command. Multiple
|
|
|
|
prefixes can be specified. They are separated by whitespace.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``osd-auto`` (default)
|
2012-09-27 01:20:12 +00:00
|
|
|
Use the default behavior for this command.
|
2013-07-08 16:02:14 +00:00
|
|
|
``no-osd``
|
2012-09-27 01:20:12 +00:00
|
|
|
Do not use any OSD for this command.
|
2013-07-08 16:02:14 +00:00
|
|
|
``osd-bar``
|
2012-09-27 01:20:12 +00:00
|
|
|
If possible, show a bar with this command. Seek commands will show the
|
|
|
|
progress bar, property changing commands may show the newly set value.
|
2013-07-08 16:02:14 +00:00
|
|
|
``osd-msg``
|
2012-10-23 23:06:00 +00:00
|
|
|
If possible, show an OSD message with this command. Seek command show
|
|
|
|
the current playback time, property changing commands show the newly set
|
|
|
|
value as text.
|
2013-07-08 16:02:14 +00:00
|
|
|
``osd-msg-bar``
|
2012-09-27 01:20:12 +00:00
|
|
|
Combine osd-bar and osd-msg.
|
2013-07-08 16:02:14 +00:00
|
|
|
``raw``
|
|
|
|
Do not expand properties in string arguments. (Like ``"${property-name}"``.)
|
|
|
|
``expand-properties`` (default)
|
|
|
|
All string arguments are expanded as described in `Property Expansion`_.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
|
|
|
|
2013-05-18 10:56:22 +00:00
|
|
|
All of the osd prefixes are still overridden by the global ``--osd-level``
|
|
|
|
settings.
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
Undocumented prefixes: ``pausing``, ``pausing_keep``, ``pausing_toggle``,
|
|
|
|
``pausing_keep_force``. (Should these be made official?)
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2013-07-07 18:37:47 +00:00
|
|
|
Input Sections
|
2013-06-23 00:31:51 +00:00
|
|
|
--------------
|
|
|
|
|
|
|
|
Input sections group a set of bindings, and enable or disable them at once.
|
|
|
|
In ``input.conf``, each key binding is assigned to an input section, rather
|
|
|
|
than actually having explicit text sections.
|
|
|
|
|
|
|
|
Also see ``enable_section`` and ``disable_section`` commands.
|
|
|
|
|
|
|
|
Predefined bindings:
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``default``
|
2013-06-23 00:31:51 +00:00
|
|
|
Bindings without input section are implicitly assigned to this section. It
|
|
|
|
is enabled by default during normal playback.
|
2013-07-08 16:02:14 +00:00
|
|
|
``encode``
|
2013-06-23 00:31:51 +00:00
|
|
|
Section which is active in encoding mode. It is enabled exclusively, so
|
|
|
|
that bindings in the ``default`` sections are ignored.
|
|
|
|
|
2012-09-27 01:20:12 +00:00
|
|
|
Properties
|
|
|
|
----------
|
|
|
|
|
2012-10-21 10:33:18 +00:00
|
|
|
Properties are used to set mpv options during runtime, or to query arbitrary
|
2012-09-27 01:20:12 +00:00
|
|
|
information. They can be manipulated with the ``set``/``add``/``cycle``
|
|
|
|
commands, and retrieved with ``show_text``, or anything else that uses property
|
2013-07-08 16:02:14 +00:00
|
|
|
expansion. (See `Property Expansion`_.)
|
2012-09-27 01:20:12 +00:00
|
|
|
|
2014-02-12 20:56:43 +00:00
|
|
|
The property name is annotated with RW to indicate whether the property is
|
|
|
|
generally writable.
|
|
|
|
|
|
|
|
If an option is referenced, the property will normally take/return exactly the
|
|
|
|
same values as the option. In these cases, properties are merely a way to change
|
|
|
|
an option at runtime.
|
|
|
|
|
|
|
|
``osd-level`` (RW)
|
|
|
|
See ``--osd-level``.
|
|
|
|
|
|
|
|
``osd-scale`` (RW)
|
|
|
|
OSD font size multiplicator, see ``--osd-scale``.
|
|
|
|
|
|
|
|
``loop`` (RW)
|
|
|
|
See ``--loop``.
|
|
|
|
|
|
|
|
``speed`` (RW)
|
|
|
|
See ``--speed``.
|
|
|
|
|
|
|
|
``filename``
|
|
|
|
Currently played file, with path stripped. If this is an URL, try to undo
|
|
|
|
percent encoding as well. (The result is not necessarily correct, but
|
|
|
|
looks better for display purposes. Use the ``path`` property to get an
|
|
|
|
unmodified filename.)
|
|
|
|
|
|
|
|
``path``
|
|
|
|
Full path of the currently played file.
|
|
|
|
|
|
|
|
``media-title``
|
|
|
|
If libquvi is used and libquvi returns a page title for the currently
|
|
|
|
played URL, return the page title.
|
|
|
|
|
|
|
|
Otherwise, if the currently played file has a ``title`` tag, use that.
|
|
|
|
|
2014-02-23 15:43:04 +00:00
|
|
|
Otherwise, if the media type is DVD, return the volume ID of DVD.
|
|
|
|
|
2014-02-12 20:56:43 +00:00
|
|
|
Otherwise, return the ``filename`` property.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``demuxer``
|
2014-02-12 20:56:43 +00:00
|
|
|
Name of the current demuxer. (This is useless.)
|
|
|
|
|
|
|
|
``stream-path``
|
|
|
|
Filename (full path) of the stream layer filename. (This is probably
|
|
|
|
useless. It looks like this can be different from ``filename`` only when
|
|
|
|
using e.g. ordered chapters.)
|
|
|
|
|
|
|
|
``stream-pos`` (RW)
|
|
|
|
Raw byte position in source stream.
|
|
|
|
|
|
|
|
``stream-start``
|
|
|
|
Raw start byte offset in source stream (rarely different from 0).
|
|
|
|
|
|
|
|
``stream-end``
|
|
|
|
Raw end position in bytes in source stream.
|
|
|
|
|
|
|
|
``stream-length``
|
|
|
|
Length in bytes of the source stream (``${stream-end} - ${stream-start}``).
|
|
|
|
|
|
|
|
``stream-time-pos`` (RW)
|
|
|
|
Time position in source stream. This only works for DVD and Bluray. This
|
|
|
|
is probably never different from ``time-pos``, because ``time-pos`` is
|
|
|
|
forced to this value anyway.
|
|
|
|
|
|
|
|
``length``
|
|
|
|
Length of the current file in seconds. If the length is unknown, the
|
|
|
|
property is unavailable. Note that the file duration is not always exactly
|
|
|
|
known, so this is an estimate.
|
|
|
|
|
|
|
|
``avsync``
|
|
|
|
Last A/V synchronization difference. Unavailable if audio or video is
|
|
|
|
disabled.
|
|
|
|
|
|
|
|
``percent-pos`` (RW)
|
|
|
|
Position in current file (0-100). The advantage over using this instead of
|
|
|
|
calculating it out of other properties is that it properly falls back to
|
|
|
|
estimating the playback position from the byte position, if the file
|
|
|
|
duration is not known.
|
|
|
|
|
|
|
|
``ratio-pos`` (RW)
|
|
|
|
Position in current file (0.0-1.0). higher precision that ``percent-pos``.
|
|
|
|
|
|
|
|
``time-pos`` (RW)
|
|
|
|
Position in current file in seconds.
|
|
|
|
|
2014-02-28 19:57:54 +00:00
|
|
|
``time-start``
|
|
|
|
Return the start time of the file. (Usually 0, but some kind of files,
|
|
|
|
especially transport streams, can have a different start time.)
|
|
|
|
|
2014-02-12 20:56:43 +00:00
|
|
|
``time-remaining``
|
|
|
|
Remaining length of the file in seconds. Note that the file duration is not
|
|
|
|
always exactly known, so this is an estimate.
|
|
|
|
|
|
|
|
``playtime-remaining``
|
|
|
|
``time-remaining`` scaled by the the current ``speed``.
|
|
|
|
|
|
|
|
``chapter`` (RW)
|
|
|
|
Current chapter number. The number of the first chapter is 0.
|
|
|
|
|
|
|
|
``edition`` (RW)
|
|
|
|
Current MKV edition number. Setting this property to a different value will
|
|
|
|
restart playback. The number of the first edition is 0.
|
|
|
|
|
|
|
|
``titles``
|
|
|
|
Number of DVD titles.
|
|
|
|
|
|
|
|
``chapters``
|
|
|
|
Number of chapters.
|
|
|
|
|
|
|
|
``editions``
|
|
|
|
Number of MKV editions.
|
|
|
|
|
2014-02-18 23:41:12 +00:00
|
|
|
``edition-list``
|
|
|
|
List of editions, current entry marked. Currently, the raw property value
|
|
|
|
is useless.
|
|
|
|
|
|
|
|
This has a number of sub-properties. Replace ``N`` with the 0-based edition
|
|
|
|
index.
|
|
|
|
|
|
|
|
``edition-list/count``
|
|
|
|
Number of editions. If there are no editions, this can be 0 or 1 (1
|
|
|
|
if there's a useless dummy edition).
|
|
|
|
|
|
|
|
``edition-list/N/id``
|
|
|
|
Edition ID as integer. Use this to set the ``edition`` property.
|
|
|
|
Currently, this is the same as the edition index.
|
|
|
|
|
|
|
|
``edition-list/N/default``
|
|
|
|
``yes`` if this is the default edition, ``no`` otherwise.
|
|
|
|
|
|
|
|
``edition-list/N/title``
|
|
|
|
Edition title as stored in the file. Not always available.
|
|
|
|
|
|
|
|
|
2014-02-12 20:56:43 +00:00
|
|
|
``angle`` (RW)
|
|
|
|
Current DVD angle.
|
|
|
|
|
|
|
|
``metadata``
|
|
|
|
Metadata key/value pairs. The raw property value will return a list of
|
|
|
|
key and value strings separated by ``,``. (If a key or value contains ``,``,
|
|
|
|
you're screwed.)
|
|
|
|
|
2014-02-19 15:16:42 +00:00
|
|
|
This has a number of sub-properties:
|
|
|
|
|
|
|
|
``metadata/by-key/<key>``
|
|
|
|
Value of metadata entry ``<key>``.
|
|
|
|
|
2014-02-19 15:29:04 +00:00
|
|
|
``metadata/list/count``
|
|
|
|
Number of metadata entries.
|
|
|
|
|
2014-02-21 12:19:09 +00:00
|
|
|
``metadata/list/N/key``
|
2014-02-19 15:29:04 +00:00
|
|
|
Key name of the Nth metadata entry. (The first entry is ``0``).
|
|
|
|
|
|
|
|
``metadata/list/N/value``
|
|
|
|
Value of the Nth metadata entry.
|
|
|
|
|
2014-02-19 15:16:42 +00:00
|
|
|
``metadata/<key>``
|
|
|
|
Old version of ``metadata/by-key/<key>``. Use is discouraged, because
|
|
|
|
the metadata key string could conflict with other sub-properties.
|
2014-02-12 20:56:43 +00:00
|
|
|
|
2014-02-19 15:29:04 +00:00
|
|
|
The layout of this property might be subject to change. Suggestions are
|
|
|
|
welcome how exactly this property should work.
|
|
|
|
|
2014-02-12 20:56:43 +00:00
|
|
|
``chapter-metadata``
|
2014-02-19 15:32:54 +00:00
|
|
|
Metadata of current chapter. Works similar to ``metadata`` property. IT
|
|
|
|
also allows the same access methods (using sub-properties).
|
|
|
|
|
|
|
|
Per-chapter metadata is very rare. Usually, only the chapter name
|
|
|
|
(``title``) is set.
|
|
|
|
|
|
|
|
For accessing other information, like chapter start, see the
|
|
|
|
``chapter-list`` property.
|
2014-02-12 20:56:43 +00:00
|
|
|
|
|
|
|
``pause`` (RW)
|
|
|
|
Pause status. This is usually ``yes`` or ``no``. See ``--pause``.
|
|
|
|
|
|
|
|
``cache``
|
|
|
|
Network cache fill state (0-100).
|
|
|
|
|
|
|
|
``pts-association-mode`` (RW)
|
|
|
|
See ``--pts-association-mode``.
|
|
|
|
|
|
|
|
``hr-seek`` (RW)
|
|
|
|
See ``--hr-seek``.
|
|
|
|
|
|
|
|
``volume`` (RW)
|
|
|
|
Current volume (0-100).
|
|
|
|
|
|
|
|
``mute`` (RW)
|
|
|
|
Current mute status (``yes``/``no``).
|
|
|
|
|
|
|
|
``audio-delay`` (RW)
|
|
|
|
See ``--audio-delay``.
|
|
|
|
|
|
|
|
``audio-format``
|
|
|
|
Audio format as string.
|
|
|
|
|
|
|
|
``audio-codec``
|
|
|
|
Audio codec selected for decoding.
|
|
|
|
|
|
|
|
``audio-bitrate``
|
|
|
|
Audio bitrate. This is probably a very bad guess in most cases.
|
|
|
|
|
|
|
|
``samplerate``
|
|
|
|
Audio samplerate.
|
|
|
|
|
|
|
|
``channels``
|
|
|
|
Number of audio channels. The OSD value of this property is actually the
|
|
|
|
channel layout, while the raw value returns the number of channels only.
|
|
|
|
|
|
|
|
``aid`` (RW)
|
|
|
|
Current audio track (similar to ``--aid``).
|
|
|
|
|
|
|
|
``audio`` (RW)
|
|
|
|
Alias for ``aid``.
|
|
|
|
|
|
|
|
``balance`` (RW)
|
|
|
|
Audio channel balance. (The implementation of this feature is rather odd.
|
|
|
|
It doesn't change the volumes of each channel, but instead sets up a pan
|
|
|
|
matrix to mix the the left and right channels.)
|
|
|
|
|
|
|
|
``fullscreen`` (RW)
|
|
|
|
See ``--fullscreen``.
|
|
|
|
|
|
|
|
``deinterlace`` (RW)
|
|
|
|
See ``--deinterlace``.
|
|
|
|
|
|
|
|
``colormatrix`` (RW)
|
|
|
|
See ``--colormatrix``.
|
|
|
|
|
|
|
|
``colormatrix-input-range`` (RW)
|
|
|
|
See ``--colormatrix-input-range``.
|
|
|
|
|
|
|
|
``colormatrix-output-range`` (RW)
|
|
|
|
See ``--colormatrix-output-range``.
|
|
|
|
|
|
|
|
``ontop`` (RW)
|
|
|
|
See ``--ontop``.
|
|
|
|
|
|
|
|
``border`` (RW)
|
|
|
|
See ``--border``.
|
|
|
|
|
|
|
|
``framedrop`` (RW)
|
|
|
|
See ``--framedrop``.
|
|
|
|
|
|
|
|
``gamma`` (RW)
|
|
|
|
See ``--gamma``.
|
|
|
|
|
|
|
|
``brightness`` (RW)
|
|
|
|
See ``--brightness``.
|
|
|
|
|
|
|
|
``contrast`` (RW)
|
|
|
|
See ``--contrast``.
|
|
|
|
|
|
|
|
``saturation`` (RW)
|
|
|
|
See ``--saturation``.
|
|
|
|
|
|
|
|
``hue`` (RW)
|
|
|
|
See ``--hue``.
|
|
|
|
|
|
|
|
``panscan`` (RW)
|
|
|
|
See ``--panscan``.
|
|
|
|
|
|
|
|
``video-format``
|
|
|
|
Video format as string.
|
|
|
|
|
|
|
|
``video-codec``
|
|
|
|
Video codec selected for decoding.
|
|
|
|
|
|
|
|
``video-bitrate``
|
|
|
|
Video bitrate (a bad guess).
|
|
|
|
|
|
|
|
``width``, ``height``
|
|
|
|
Video size. This uses the size of the video as decoded, or if no video
|
|
|
|
frame has been decoded yet, the (possibly incorrect) container indicated
|
|
|
|
size.
|
|
|
|
|
2014-02-15 15:42:48 +00:00
|
|
|
``video-params``
|
|
|
|
Video parameters, as output by the decoder (with overrides like aspect
|
|
|
|
etc. applied). This has a number of sub-properties:
|
|
|
|
|
|
|
|
``video-params/pixelformat``
|
|
|
|
The pixel format as string. This uses the same names as used in other
|
|
|
|
places of mpv.
|
|
|
|
|
|
|
|
``video-params/w``, ``video-params/h``
|
|
|
|
Video size as integers, with no aspect correction applied.
|
|
|
|
|
|
|
|
``video-params/dw``, ``video-params/dh``
|
|
|
|
Video size as integers, scaled for correct aspect ratio.
|
|
|
|
|
|
|
|
``video-params/aspect``
|
|
|
|
Display aspect ratio as float.
|
|
|
|
|
|
|
|
``video-params/par``
|
|
|
|
Pixel aspect ratio.
|
|
|
|
|
|
|
|
``video-params/colormatrix``
|
|
|
|
The colormatrix in use as string. (Exact values subject to change.)
|
|
|
|
|
|
|
|
``video-params/colorlevels``
|
|
|
|
The colorlevels as string. (Exact values subject to change.)
|
|
|
|
|
|
|
|
``video-params/chroma-location``
|
|
|
|
Chroma location as string. (Exact values subject to change.)
|
2014-02-12 20:56:43 +00:00
|
|
|
|
|
|
|
``dwidth``, ``dheight``
|
|
|
|
Video display size. This is the video size after filters and aspect scaling
|
|
|
|
have been applied. The actual video window size can still be different
|
|
|
|
from this.
|
|
|
|
|
2014-02-15 15:42:48 +00:00
|
|
|
``video-out-params``
|
|
|
|
Same as ``video-params``, but after video filters have been applied. If
|
|
|
|
there are no video filters in use, this will contain the same values as
|
|
|
|
``video-params``. Note that this is still not necessarily what the video
|
|
|
|
window uses, since all real VOs do their own scaling.
|
|
|
|
|
|
|
|
Has the same sub-properties as ``video-params``.
|
|
|
|
|
|
|
|
``fps``
|
|
|
|
Container FPS. This can easily contain bogus values. For videos that use
|
|
|
|
modern container formats or video codecs, this will often be incorrect.
|
|
|
|
|
2014-02-12 20:56:43 +00:00
|
|
|
``window-scale`` (RW)
|
|
|
|
Window size multiplier. Setting this will resize the video window to the
|
|
|
|
values contained in ``dwidth`` and ``dheight`` multiplied with the value
|
|
|
|
set with this property. Setting ``1`` will resize to original video size
|
|
|
|
(or to be exactly, the size the video filters output). ``2`` will set the
|
|
|
|
double size, ``0.5`` halves the size.
|
|
|
|
|
|
|
|
``aspect`` (RW)
|
|
|
|
Video aspect, see ``--aspect``.
|
|
|
|
|
|
|
|
``osd-width``, ``osd-height``
|
|
|
|
Last known OSD width (can be 0). This is needed if you want to use the
|
|
|
|
``overlay_add`` command. It gives you the actual OSD size, which can be
|
|
|
|
different from the window size in some cases.
|
|
|
|
|
|
|
|
``osd-par``
|
|
|
|
Last known OSD display pixel aspect (can be 0).
|
|
|
|
|
|
|
|
``vid`` (RW)
|
|
|
|
Current video track (similar to ``--vid``).
|
|
|
|
|
|
|
|
``video`` (RW)
|
|
|
|
Alias for ``vid``.
|
|
|
|
|
|
|
|
``video-align-x``, ``video-align-y`` (RW)
|
|
|
|
See ``--video-align-x`` and ``--video-align-y``.
|
|
|
|
|
|
|
|
``video-pan-x``, ``video-pan-y`` (RW)
|
|
|
|
See ``--video-pan-x`` and ``--video-pan-y``.
|
|
|
|
|
|
|
|
``video-zoom`` (RW)
|
|
|
|
See ``--video-zoom``.
|
|
|
|
|
|
|
|
``video-unscaled`` (W)
|
|
|
|
See ``--video-unscaled``.
|
|
|
|
|
|
|
|
``program`` (W)
|
|
|
|
Switch TS program (write-only).
|
|
|
|
|
|
|
|
``sid`` (RW)
|
|
|
|
Current subtitle track (similar to ``--sid``).
|
|
|
|
|
|
|
|
``secondary-sid`` (RW)
|
|
|
|
Secondary subtitle track (see ``--secondary-sid``).
|
|
|
|
|
|
|
|
``sub`` (RW)
|
|
|
|
Alias for ``sid``.
|
|
|
|
|
|
|
|
``sub-delay`` (RW)
|
|
|
|
See ``--sub-delay``.
|
|
|
|
|
|
|
|
``sub-pos`` (RW)
|
|
|
|
See ``--sub-pos``.
|
|
|
|
|
|
|
|
``sub-visibility`` (RW)
|
|
|
|
See ``--sub-visibility``.
|
|
|
|
|
|
|
|
``sub-forced-only`` (RW)
|
|
|
|
See ``--sub-forced-only``.
|
|
|
|
|
|
|
|
``sub-scale`` (RW)
|
|
|
|
Subtitle font size multiplicator.
|
|
|
|
|
|
|
|
``ass-use-margins`` (RW)
|
|
|
|
See ``--ass-use-margins``.
|
|
|
|
|
|
|
|
``ass-vsfilter-aspect-compat`` (RW)
|
|
|
|
See ``--ass-vsfilter-aspect-compat``.
|
|
|
|
|
|
|
|
``ass-style-override`` (RW)
|
|
|
|
See ``--ass-style-override``.
|
|
|
|
|
|
|
|
``stream-capture`` (RW)
|
|
|
|
A filename, see ``--capture``. Setting this will start capture using the
|
|
|
|
given filename. Setting it to an empty string will stop it.
|
|
|
|
|
|
|
|
``tv-brightness``, ``tv-contrast``, ``tv-saturation``, ``tv-hue`` (RW)
|
|
|
|
TV stuff.
|
|
|
|
|
|
|
|
``playlist-pos`` (RW)
|
|
|
|
Current position on playlist. The first entry is on position 0. Writing
|
|
|
|
to the property will restart playback at the written entry.
|
|
|
|
|
|
|
|
``playlist-count``
|
|
|
|
Number of total playlist entries.
|
|
|
|
|
|
|
|
``playlist``
|
|
|
|
Playlist, current entry marked. Currently, the raw property value is
|
|
|
|
useless.
|
|
|
|
|
2014-02-15 15:54:55 +00:00
|
|
|
This has a number of sub-properties. Replace ``N`` with the 0-based playlist
|
|
|
|
entry index.
|
|
|
|
|
|
|
|
``playlist/count``
|
|
|
|
Number of playlist entries (same as ``playlist-count``).
|
|
|
|
|
|
|
|
``playlist/N/filename``
|
|
|
|
Filename of the Nth entry.
|
|
|
|
|
2014-02-12 20:56:43 +00:00
|
|
|
``track-list``
|
|
|
|
List of audio/video/sub tracks, current entry marked. Currently, the raw
|
|
|
|
property value is useless.
|
|
|
|
|
2014-02-15 15:53:11 +00:00
|
|
|
This has a number of sub-properties. Replace ``N`` with the 0-based track
|
|
|
|
index.
|
|
|
|
|
|
|
|
``track-list/count``
|
|
|
|
Total number of tracks.
|
|
|
|
|
|
|
|
``track-list/N/id``
|
|
|
|
The ID as it's used for ``-sid``/``--aid``/``--vid``. This is unique
|
|
|
|
within tracks of the same type (sub/audio/video), but otherwise not.
|
|
|
|
|
|
|
|
``track-list/N/type``
|
|
|
|
String describing the media type. One of ``audio``, ``video``, ``sub``.
|
|
|
|
|
|
|
|
``track-list/N/src-id``
|
|
|
|
Track ID as used in the source file. Not always available.
|
|
|
|
|
|
|
|
``track-list/N/title``
|
|
|
|
Track title as it is stored in the file. Not always available.
|
|
|
|
|
|
|
|
``track-list/N/lang``
|
|
|
|
Track language as identified by the file. Not always available.
|
|
|
|
|
|
|
|
``track-list/N/albumart``
|
|
|
|
``yes`` if this is a video track that consists of a single picture,
|
|
|
|
``no`` or unavailable otherwise. This is used for video tracks that are
|
|
|
|
really attached pictures in audio files.
|
|
|
|
|
|
|
|
``track-list/N/default``
|
|
|
|
``yes`` if the track has the default flag set in the file, ``no``
|
|
|
|
otherwise.
|
|
|
|
|
2014-02-18 23:21:56 +00:00
|
|
|
``track-list/N/codec``
|
|
|
|
The codec name used by this track, for example ``h264``. Unavailable
|
|
|
|
in some rare cases.
|
|
|
|
|
2014-02-15 15:53:11 +00:00
|
|
|
``track-list/N/external``
|
|
|
|
``yes`` if the track is an external file, ``no`` otherwise. This is
|
|
|
|
set for separate subtitle files.
|
|
|
|
|
|
|
|
``track-list/N/external-filename``
|
|
|
|
The filename if the track is from an external file, unavailable
|
|
|
|
otherwise.
|
|
|
|
|
|
|
|
``track-list/N/selected``
|
|
|
|
``yes`` if the track is currently decoded, ``no`` otherwise.
|
|
|
|
|
2014-02-12 20:56:43 +00:00
|
|
|
``chapter-list``
|
|
|
|
List of chapters, current entry marked. Currently, the raw property value
|
|
|
|
is useless.
|
|
|
|
|
2014-02-15 15:55:40 +00:00
|
|
|
This has a number of sub-properties. Replace ``N`` with the 0-based chapter
|
|
|
|
index.
|
|
|
|
|
|
|
|
``chapter-list/count``
|
|
|
|
Number of chapters.
|
|
|
|
|
|
|
|
``chapter-list/N/title``
|
|
|
|
Chapter title as stored in the file. Not always available.
|
|
|
|
|
|
|
|
``chapter-list/N/time``
|
|
|
|
Chapter start time in seconds as float.
|
|
|
|
|
2014-02-12 20:56:43 +00:00
|
|
|
``quvi-format`` (RW)
|
|
|
|
See ``--quvi-format``. Cycling this property (``cycle``) will attempt to
|
|
|
|
cycle through known format, although currently this feature doesn't work
|
|
|
|
well at all.
|
|
|
|
|
|
|
|
``af`` (RW)
|
|
|
|
See ``--af`` and the ``af`` command.
|
|
|
|
|
|
|
|
``vf`` (RW)
|
|
|
|
See ``--vf`` and the ``vf`` command.
|
|
|
|
|
2014-02-28 19:57:54 +00:00
|
|
|
``seekable``
|
|
|
|
Return whether it's generally possible to seek in the current file.
|
|
|
|
|
2014-02-12 20:56:43 +00:00
|
|
|
``options/<name>`` (RW)
|
2014-02-25 22:59:27 +00:00
|
|
|
Read-only access to value of option ``--<name>``. Most options can be
|
|
|
|
changed at runtime by writing to this property. Note that many options
|
|
|
|
require reloading the file for changes to take effect. If there is an
|
|
|
|
equivalent property, prefer setting the property instead.
|
2013-06-08 16:04:36 +00:00
|
|
|
|
2013-07-07 18:37:47 +00:00
|
|
|
Property Expansion
|
2013-06-08 16:04:36 +00:00
|
|
|
------------------
|
|
|
|
|
|
|
|
All string arguments to input commands as well as certain options (like
|
|
|
|
``--playing-msg``) are subject to property expansion.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
.. admonition:: Example for input.conf
|
2013-06-08 16:04:36 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``i show_text "Filename: ${filename}"``
|
|
|
|
shows the filename of the current file when pressing the ``i`` key
|
2013-06-08 16:04:36 +00:00
|
|
|
|
|
|
|
Within ``input.conf``, property expansion can be inhibited by putting the
|
|
|
|
``raw`` prefix in front of commands.
|
|
|
|
|
|
|
|
The following expansions are supported:
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
``${NAME}``
|
2013-06-08 16:04:36 +00:00
|
|
|
Expands to the value of the property ``NAME``. If retrieving the property
|
|
|
|
fails, expand to an error string. (Use ``${NAME:}`` with a trailing
|
|
|
|
``:`` to expand to an empty string instead.)
|
|
|
|
If ``NAME`` is prefixed with ``=``, expand to the raw value of the property
|
2013-09-20 20:53:06 +00:00
|
|
|
(see section below).
|
2013-07-08 16:02:14 +00:00
|
|
|
``${NAME:STR}``
|
2013-06-08 16:04:36 +00:00
|
|
|
Expands to the value of the property ``NAME``, or ``STR`` if the
|
2013-07-08 16:02:14 +00:00
|
|
|
property cannot be retrieved. ``STR`` is expanded recursively.
|
2013-09-20 20:53:06 +00:00
|
|
|
``${?NAME:STR}``
|
|
|
|
Expands to ``STR`` (recursively) if the property ``NAME`` is available.
|
2013-07-08 16:02:14 +00:00
|
|
|
``${!NAME:STR}``
|
|
|
|
Expands to ``STR`` (recursively) if the property ``NAME`` cannot be
|
2013-06-08 16:04:36 +00:00
|
|
|
retrieved.
|
2013-09-20 20:53:06 +00:00
|
|
|
``${?NAME==VALUE:STR}``
|
|
|
|
Expands to ``STR`` (recursively) if the property ``NAME`` expands to a
|
|
|
|
string equal to ``VALUE``. You can prefix ``NAME`` with ``=`` in order to
|
|
|
|
compare the raw value of a property (see section below). If the property
|
|
|
|
is unavailable, or other errors happen when retrieving it, the value is
|
|
|
|
never considered equal.
|
|
|
|
Note that ``VALUE`` can't contain any of the characters ``:`` or ``}``.
|
|
|
|
Also, it is possible that escaping with ``"`` or ``%`` might be added in
|
|
|
|
the future, should the need arise.
|
|
|
|
``${!NAME==VALUE:STR}``
|
|
|
|
Same as with the ``?`` variant, but ``STR`` is expanded if the value is
|
|
|
|
not equal. (Using the same semantics as with ``?``.)
|
2013-07-08 16:02:14 +00:00
|
|
|
``$$``
|
2013-06-08 16:04:36 +00:00
|
|
|
Expands to ``$``.
|
2013-07-08 16:02:14 +00:00
|
|
|
``$}``
|
2013-06-08 16:04:36 +00:00
|
|
|
Expands to ``}``. (To produce this character inside recursive
|
|
|
|
expansion.)
|
2013-07-08 16:02:14 +00:00
|
|
|
``$>``
|
2013-06-08 16:04:36 +00:00
|
|
|
Disable property expansion and special handling of ``$`` for the rest
|
|
|
|
of the string.
|
|
|
|
|
|
|
|
In places where property expansion is allowed, C-style escapes are often
|
|
|
|
accepted as well. Example:
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
- ``\n`` becomes a newline character
|
|
|
|
- ``\\`` expands to ``\``
|
2013-06-08 16:04:36 +00:00
|
|
|
|
2013-07-07 18:37:47 +00:00
|
|
|
Raw and Formatted Properties
|
2013-06-08 16:04:36 +00:00
|
|
|
----------------------------
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
Normally, properties are formatted as human-readable text, meant to be
|
2013-06-08 16:04:36 +00:00
|
|
|
displayed on OSD or on the terminal. It is possible to retrieve an unformatted
|
|
|
|
(raw) value from a property by prefixing its name with ``=``. These raw values
|
2013-07-08 16:02:14 +00:00
|
|
|
can be parsed by other programs and follow the same conventions as the options
|
2013-06-08 16:04:36 +00:00
|
|
|
associated with the properties.
|
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
.. admonition:: Examples
|
2013-06-08 16:04:36 +00:00
|
|
|
|
2013-07-08 16:02:14 +00:00
|
|
|
- ``${time-pos}`` expands to ``00:14:23`` (if playback position is at 14
|
|
|
|
minutes 23 seconds)
|
|
|
|
- ``${=time-pos}`` expands to ``863.4`` (same time, plus 400 milliseconds -
|
|
|
|
milliseconds are normally not shown in the formatted case)
|
2013-06-08 16:04:36 +00:00
|
|
|
|
|
|
|
Sometimes, the difference in amount of information carried by raw and formatted
|
|
|
|
property values can be rather big. In some cases, raw values have more
|
|
|
|
information, like higher precision than seconds with ``time-pos``. Sometimes
|
2013-07-08 16:02:14 +00:00
|
|
|
it is the other way around, e.g. ``aid`` shows track title and language in the
|
|
|
|
formatted case, but only the track number if it is raw.
|