summaryrefslogtreecommitdiffstats
path: root/DOCS/man/mpv.rst
diff options
context:
space:
mode:
Diffstat (limited to 'DOCS/man/mpv.rst')
-rw-r--r--DOCS/man/mpv.rst683
1 files changed, 541 insertions, 142 deletions
diff --git a/DOCS/man/mpv.rst b/DOCS/man/mpv.rst
index bcf36b5be1..7a4c0b64d0 100644
--- a/DOCS/man/mpv.rst
+++ b/DOCS/man/mpv.rst
@@ -43,6 +43,9 @@ The following listings are not necessarily complete. See ``etc/input.conf`` for
a list of default bindings. User ``input.conf`` files and Lua scripts can
define additional key bindings.
+See also ``--input-test`` for interactive binding details by key, and the
+`stats`_ built-in script for key bindings list (including print to terminal).
+
Keyboard Control
----------------
@@ -159,6 +162,9 @@ L
Ctrl + and Ctrl -
Adjust audio delay (A/V sync) by +/- 0.1 seconds.
+Shift+g and Shift+f
+ Adjust subtitle font size by +/- 10%.
+
u
Switch between applying no style overrides to SSA/ASS subtitles, and
overriding them almost completely with the normal subtitle style. See
@@ -223,6 +229,12 @@ i and I
file such as codec, framerate, number of dropped frames and so on. See
`STATS`_ for more information.
+del
+ Cycle OSC visibility between never / auto (mouse-move) / always
+
+\`
+ Show the console. (ESC closes it again. See `CONSOLE`_.)
+
(The following keys are valid only when using a video output that supports the
corresponding adjustment.)
@@ -238,16 +250,16 @@ corresponding adjustment.)
7 and 8
Adjust saturation.
-Alt+0 (and command+0 on OSX)
+Alt+0 (and command+0 on macOS)
Resize video window to half its original size.
-Alt+1 (and command+1 on OSX)
+Alt+1 (and command+1 on macOS)
Resize video window to its original size.
-Alt+2 (and command+2 on OSX)
+Alt+2 (and command+2 on macOS)
Resize video window to double its original size.
-command + f (OSX only)
+command + f (macOS only)
Toggle fullscreen (see also ``--fs``).
(The following keys are valid if you have a keyboard with multimedia keys.)
@@ -268,10 +280,19 @@ in the mpv git repository.
Mouse Control
-------------
-button 3 and button 4
- Seek backward/forward 1 minute.
+Left double click
+ Toggle fullscreen on/off.
-button 5 and button 6
+Right click
+ Toggle pause on/off.
+
+Forward/Back button
+ Skip to next/previous entry in playlist.
+
+Wheel up/down
+ Seek forward/backward 10 seconds.
+
+Wheel left/right
Decrease/increase volume.
@@ -299,7 +320,7 @@ Legacy option syntax
--------------------
The ``--option=value`` syntax is not strictly enforced, and the alternative
-legacy syntax ``-option value`` and ``--option value`` will also work. This is
+legacy syntax ``-option value`` and ``-option=value`` will also work. This is
mostly for compatibility with MPlayer. Using these should be avoided. Their
semantics can change any time in the future.
@@ -309,9 +330,15 @@ because ``--fs`` is a flag option that requires no parameter. If an option
changes and its parameter becomes optional, then a command line using the
alternative syntax will break.
-Currently, the parser makes no difference whether an option starts with ``--``
-or a single ``-``. This might also change in the future, and ``--option value``
-might always interpret ``value`` as filename in order to reduce ambiguities.
+Until mpv 0.31.0, there was no difference whether an option started with ``--``
+or a single ``-``. Newer mpv releases strictly expect that you pass the option
+value after a ``=``. For example, before ``mpv --log-file f.txt`` would write
+a log to ``f.txt``, but now this command line fails, as ``--log-file`` expects
+an option value, and ``f.txt`` is simply considered a normal file to be played
+(as in ``mpv f.txt``).
+
+The future plan is that ``-option value`` will not work anymore, and options
+with a single ``-`` behave the same as ``--`` options.
Escaping spaces and other special characters
--------------------------------------------
@@ -366,6 +393,9 @@ It is started with ``%`` and has the following format::
``mpv --vf=foo:option1=%`expr length "$NAME"`%"$NAME" test.avi``
+Note: where applicable with JSON-IPC, ``%n%`` is the length in UTF-8 bytes,
+after decoding the JSON data.
+
Suboptions passed to the client API are also subject to escaping. Using
``mpv_set_option_string()`` is exactly like passing ``--name=data`` to the
command line (but without shell processing of the string). Some options
@@ -403,18 +433,28 @@ need to escape special characters. To work this around, the path can be
additionally wrapped in the fixed-length syntax, e.g. ``%n%string_of_length_n``
(see above).
-Some mpv options interpret paths starting with ``~``. Currently, the prefix
-``~~/`` expands to the mpv configuration directory (usually ``~/.config/mpv/``).
+Some mpv options interpret paths starting with ``~``.
+Currently, the prefix ``~~home/`` expands to the mpv configuration directory
+(usually ``~/.config/mpv/``).
``~/`` expands to the user's home directory. (The trailing ``/`` is always
-required.) There are the following paths as well:
+required.) The following paths are currently recognized:
================ ===============================================================
Name Meaning
================ ===============================================================
-``~~home/`` same as ``~~/``
+``~~/`` If the subpath exists in any of the mpv's config directories
+ the path of the existing file/dir is returned. Otherwise this
+ is equivalent to ``~~home/``.
+ Note that if --no-config is used ``~~/foobar`` will resolve to
+ ``foobar`` which can be unexpected.
+``~/`` user home directory root (similar to shell, ``$HOME``)
+``~~home/`` mpv config dir (for example ``~/.config/mpv/``)
``~~global/`` the global config path, if available (not on win32)
-``~~osxbundle/`` the OSX bundle resource path (OSX only)
-``~~desktop/`` the path to the desktop (win32, OSX)
+``~~osxbundle/`` the macOS bundle resource path (macOS only)
+``~~desktop/`` the path to the desktop (win32, macOS)
+``~~exe_dir/`` win32 only: the path to the directory containing the exe (for
+ config file purposes; ``$MPV_HOME`` overrides it)
+``~~old_home/`` do not use
================ ===============================================================
@@ -463,79 +503,105 @@ List Options
------------
Some options which store lists of option values can have action suffixes. For
-example, you can set a ``,``-separated list of filters with ``--vf``, but the
-option also allows you to append filters with ``--vf-append``.
+example, the ``--display-tags`` option takes a ``,``-separated list of tags, but
+the option also allows you to append a single tag with ``--display-tags-append``,
+and the tag name can for example contain a literal ``,`` without the need for
+escaping.
-Options for filenames do not use ``,`` as separator, but ``:`` (Unix) or ``;``
-(Windows).
+String list and path list options
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+String lists are separated by ``,``. The strings are not parsed or interpreted
+by the option system itself. However, most
+
+Path or file list options use ``:`` (Unix) or ``;`` (Windows) as separator,
+instead of ``,``.
+
+They support the following operations:
============= ===============================================
Suffix Meaning
============= ===============================================
--add Append 1 or more items (may become alias for -append)
--append Append single item (avoids need for escaping)
--clr Clear the option
--del Delete an existing item by integer index
--pre Prepend 1 or more items
--set Set a list of items
--toggle Append an item, or remove if if it already exists
+-set Set a list of items (using the list separator, escaped with backslash)
+-append Append single item (does not interpret escapes)
+-add Append 1 or more items (same syntax as -set)
+-pre Prepend 1 or more items (same syntax as -set)
+-clr Clear the option (remove all items)
+-remove Delete item if present (does not interpret escapes)
+-del Delete 1 or more items by integer index (deprecated)
+-toggle Append an item, or remove if if it already exists (no escapes)
============= ===============================================
-Although some operations allow specifying multiple ``,``-separated items, using
-this is strongly discouraged and deprecated, except for ``-set``.
+``-append`` is meant as a simple way to append a single item without having
+to escape the argument (you may still need to escape on the shell level).
-Without suffix, the action taken is normally ``-set``.
+Key/value list options
+~~~~~~~~~~~~~~~~~~~~~~
-Some options (like ``--sub-file``, ``--audio-file``, ``--glsl-shader``) are
-aliases for the proper option with ``-append`` action. For example,
-``--sub-file`` is an alias for ``--sub-files-append``.
+A key/value list is a list of key/value string pairs. In programming languages,
+this type of data structure is often called a map or a dictionary. The order
+normally does not matter, although in some cases the order might matter.
-Some options only support a subset of the above.
+They support the following operations:
-Options of this type can be changed at runtime using the ``change-list``
-command, which takes the suffix as separate operation parameter.
+============= ===============================================
+Suffix Meaning
+============= ===============================================
+-set Set a list of items (using ``,`` as separator)
+-append Append a single item (escapes for the key, no escapes for the value)
+-add Append 1 or more items (same syntax as -set)
+-remove Delete item by key if present (does not interpret escapes)
+============= ===============================================
-Playing DVDs
-------------
+Keys are unique within the list. If an already present key is set, the existing
+key is removed before the new value is appended.
+
+If you want to pass a value without interpreting it for escapes or ``,``, it is
+recommended to use the ``-add`` variant. When using libmpv, prefer using
+``MPV_FORMAT_NODE_MAP``; when using a scripting backend or the JSON IPC, use an
+appropriate structured data type.
+
+Prior to mpv 0.33, ``:`` was also recognized as separator by ``-set``.
-DVDs can be played with the ``dvd://[title]`` syntax. The optional
-title specifier is a number which selects between separate video
-streams on the DVD. If no title is given (``dvd://``) then the longest
-title is selected automatically by the library. This is usually what
-you want. mpv does not support DVD menus.
-
-DVDs which have been copied on to a hard drive or other mounted
-filesystem (by e.g. the ``dvdbackup`` tool) are accommodated by
-specifying the path to the local copy: ``--dvd-device=PATH``.
-Alternatively, running ``mpv PATH`` should auto-detect a DVD directory
-tree and play the longest title.
-
-.. note:: DVD library choices
-
- mpv uses a different default DVD library than MPlayer. MPlayer
- uses libdvdread by default, and mpv uses libdvdnav by default.
- Both libraries are developed in parallel, but libdvdnav is
- intended to support more sophisticated DVD features such as menus
- and multi-angle playback. mpv uses libdvdnav for files specified
- as either ``dvd://...`` or ``dvdnav://...``. To use libdvdread,
- which will produce behavior more like MPlayer, specify
- ``dvdread://...`` instead. Some users have experienced problems
- when using libdvdnav, in which playback gets stuck in a DVD menu
- stream. These problems are reported to go away when auto-selecting
- the title (``dvd://`` rather than ``dvd://1``) or when using
- libdvdread (e.g. ``dvdread://0``). There are also outstanding bugs
- in libdvdnav with seeking backwards and forwards in a video
- stream. Specify ``dvdread://...`` to fix such problems.
-
-.. note:: DVD subtitles
-
- DVDs use image-based subtitles. Image subtitles are implemented as
- a bitmap video stream which can be superimposed over the main
- movie. mpv's subtitle styling and positioning options and keyboard
- shortcuts generally do not work with image-based subtitles.
- Exceptions include options like ``--stretch-dvd-subs`` and
- ``--stretch-image-subs-to-screen``.
+Filter options
+~~~~~~~~~~~~~~
+This is a very complex option type for the ``--af`` and ``--vf`` options only.
+They often require complicated escaping. See `VIDEO FILTERS`_ for details. They
+support the following operations:
+
+============= ===============================================
+Suffix Meaning
+============= ===============================================
+-set Set a list of filters (using ``,`` as separator)
+-append Append single filter
+-add Append 1 or more filters (same syntax as -set)
+-pre Prepend 1 or more filters (same syntax as -set)
+-clr Clear the option (remove all filters)
+-remove Delete filter if present
+-del Delete 1 or more filters by integer index or filter label (deprecated)
+-toggle Append a filter, or remove if if it already exists
+-help Pseudo operation that prints a help text to the terminal
+============= ===============================================
+
+General
+~~~~~~~
+
+Without suffix, the operation used is normally ``-set``.
+
+Although some operations allow specifying multiple items, using this is strongly
+discouraged and deprecated, except for ``-set``. There is a chance that
+operations like ``-add`` and ``-pre`` will work like ``-append`` and accept a
+single, unescaped item only (so the ``,`` separator will not be interpreted and
+is passed on as part of the value).
+
+Some options (like ``--sub-file``, ``--audio-file``, ``--glsl-shader``) are
+aliases for the proper option with ``-append`` action. For example,
+``--sub-file`` is an alias for ``--sub-files-append``.
+
+Options of this type can be changed at runtime using the ``change-list``
+command, which takes the suffix (without the ``-``) as separate operation
+parameter.
CONFIGURATION FILES
===================
@@ -562,7 +628,7 @@ setting them to *no*. Even suboptions can be specified in this way.
# Use GPU-accelerated video output by default.
vo=gpu
# Use quotes for text that can contain spaces:
- status-msg="Time: ${time-pos}"
+ term-status-msg="Time: ${time-pos}"
Escaping spaces and special characters
--------------------------------------
@@ -648,30 +714,272 @@ or at runtime with the ``apply-profile <name>`` command.
# you can also include other profiles
profile=big-cache
+Runtime profiles
+----------------
-Auto profiles
--------------
+Profiles can be set at runtime with ``apply-profile`` command. Since this
+operation is "destructive" (every item in a profile is simply set as an
+option, overwriting the previous value), you can't just enable and disable
+profiles again.
-Some profiles are loaded automatically. The following example demonstrates this:
+As a partial remedy, there is a way to make profiles save old option values
+before overwriting them with the profile values, and then restoring the old
+values at a later point using ``apply-profile <profile-name> restore``.
-.. admonition:: Auto profile loading
+This can be enabled with the ``profile-restore`` option, which takes one of
+the following options:
+
+ ``default``
+ Does nothing, and nothing can be restored (default).
+
+ ``copy``
+ When applying a profile, copy the old values of all profile options to a
+ backup before setting them from the profile. These options are reset to
+ their old values using the backup when restoring.
+
+ Every profile has its own list of backed up values. If the backup
+ already exists (e.g. if ``apply-profile name`` was called more than
+ once in a row), the existing backup is no changed. The restore operation
+ will remove the backup.
+
+ It's important to know that restoring does not "undo" setting an option,
+ but simply copies the old option value. Consider for example ``vf-add``,
+ appends an entry to ``vf``. This mechanism will simply copy the entire
+ ``vf`` list, and does _not_ execute the inverse of ``vf-add`` (that
+ would be ``vf-remove``) on restoring.
+
+ Note that if a profile contains recursive profiles (via the ``profile``
+ option), the options in these recursive profiles are treated as if they
+ were part of this profile. The referenced profile's backup list is not
+ used when creating or using the backup. Restoring a profile does not
+ restore referenced profiles, only the options of referenced profiles (as
+ if they were part of the main profile).
+
+ ``copy-equal``
+ Similar to ``copy``, but restore an option only if it has the same value
+ as the value effectively set by the profile. This tries to deal with
+ the situation when the user does not want the option to be reset after
+ interactively changing it.
+
+.. admonition:: Example
::
- [protocol.dvd]
- profile-desc="profile for dvd:// streams"
- alang=en
+ [something]
+ profile-restore=copy-equal
+ vf-add=rotate=90
+
+ Then running these commands will result in behavior as commented:
+
+ ::
+
+ set vf vflip
+ apply-profile something
+ vf-add=hflip
+ apply-profile something
+ # vf == vflip,rotate=90,hflip,rotate=90
+ apply-profile something restore
+ # vf == vflip
+
+Conditional auto profiles
+-------------------------
+
+Profiles which have the ``profile-cond`` option set are applied automatically
+if the associated condition matches (unless auto profiles are disabled). The
+option takes a string, which is interpreted as Lua condition. If evaluating the
+expression returns true, the profile is applied, if it returns false, it is
+ignored. This Lua code execution is not sandboxed.
+
+Any variables in condition expressions can reference properties. If an
+identifier is not already defined by Lua or mpv, it is interpreted as property.
+For example, ``pause`` would return the current pause status. You cannot
+reference properties with ``-`` this way since that would denote a subtraction,
+but if the variable name contains any ``_`` characters, they are turned into
+``-``. For example, ``playback_time`` would return the property
+``playback-time``.
+
+A more robust way to access properties is using ``p.property_name`` or
+``get("property-name", default_value)``. The automatic variable to property
+magic will break if a new identifier with the same name is introduced (for
+example, if a function named ``pause()`` were added, ``pause`` would return a
+function value instead of the value of the ``pause`` property).
+
+Note that if a property is not available, it will return ``nil``, which can
+cause errors if used in expressions. These are logged in verbose mode, and the
+expression is considered to be false.
+
+Whenever a property referenced by a profile condition changes, the condition
+is re-evaluated. If the return value of the condition changes from false or
+error to true, the profile is applied.
+
+This mechanism tries to "unapply" profiles once the condition changes from true
+to false. If you want to use this, you need to set ``profile-restore`` for the
+profile. Another possibility it to create another profile with an inverse
+condition to undo the other profile.
+
+Recursive profiles can be used. But it is discouraged to reference other
+conditional profiles in a conditional profile, since this can lead to tricky
+and unintuitive behavior.
+
+.. admonition:: Example
+
+ Make only HD video look funny:
+
+ ::
+
+ [something]
+ profile-desc=HD video sucks
+ profile-cond=width >= 1280
+ hue=-50
+
+ If you want the profile to be reverted if the condition goes to false again,
+ you can set ``profile-restore``:
+
+ ::
+
+ [something]
+ profile-desc=Mess up video when entering fullscreen
+ profile-cond=fullscreen
+ profile-restore=copy
+ vf-add=rotate=90
+
+ This appends the ``rotate`` filter to the video filter chain when entering
+ fullscreen. When leaving fullscreen, the ``vf`` option is set to the value
+ it had before entering fullscreen. Note that this would also remove any
+ other filters that were added during fullscreen mode by the user. Avoiding
+ this is trickier, and could for example be solved by adding a second profile
+ with an inverse condition and operation:
+
+ ::
+
+ [something]
+ profile-cond=fullscreen
+ vf-add=@rot:rotate=90
+
+ [something-inv]
+ profile-cond=not fullscreen
+ vf-remove=@rot
+
+.. warning::
+
+ Every time an involved property changes, the condition is evaluated again.
+ If your condition uses ``p.playback_time`` for example, the condition is
+ re-evaluated approximately on every video frame. This is probably slow.
+
+This feature is managed by an internal Lua script. Conditions are executed as
+Lua code within this script. Its environment contains at least the following
+things:
+
+``(function environment table)``
+ Every Lua function has an environment table. This is used for identifier
+ access. There is no named Lua symbol for it; it is implicit.
+
+ The environment does "magic" accesses to mpv properties. If an identifier
+ is not already defined in ``_G``, it retrieves the mpv property of the same
+ name. Any occurrences of ``_`` in the name are replaced with ``-`` before
+ reading the property. The returned value is as retrieved by
+ ``mp.get_property_native(name)``. Internally, a cache of property values,
+ updated by observing the property is used instead, so properties that are
+ not observable will be stuck at the initial value forever.
+
+ If you want to access properties, that actually contain ``_`` in the name,
+ use ``get()`` (which does not perform transliteration).
+
+ Internally, the environment table has a ``__index`` meta method set, which
+ performs the access logic.
+
+``p``
+ A "magic" table similar to the environment table. Unlike the latter, this
+ does not prefer accessing variables defined in ``_G`` - it always accesses
+ properties.
+
+``get(name [, def])``
+ Read a property and return its value. If the property value is ``nil`` (e.g.
+ if the property does not exist), ``def`` is returned.
+
+ This is superficially similar to ``mp.get_property_native(name)``. An
+ important difference is that this accesses the property cache, and enables
+ the change detection logic (which is essential to the dynamic runtime
+ behavior of auto profiles). Also, it does not return an error value as
+ second return value.
- [extension.flv]
- profile-desc="profile for .flv files"
- vf=flip
+ The "magic" tables mentioned above use this function as backend. It does not
+ perform the ``_`` transliteration.
+
+In addition, the same environment as in a blank mpv Lua script is present. For
+example, ``math`` is defined and gives access to the Lua standard math library.
+
+.. warning::
+
+ This feature is subject to change indefinitely. You might be forced to
+ adjust your profiles on mpv updates.
+
+Legacy auto profiles
+--------------------
+
+Some profiles are loaded automatically using a legacy mechanism. The following
+example demonstrates this:
+
+.. admonition:: Auto profile loading
+
+ ::
+
+ [extension.mkv]
+ profile-desc="profile for .mkv files"
+ vf=vflip
The profile name follows the schema ``type.name``, where type can be
``protocol`` for the input/output protocol in use (see ``--list-protocols``),
and ``extension`` for the extension of the path of the currently played file
(*not* the file format).
-This feature is very limited, and there are no other auto profiles.
+This feature is very limited, and is considered soft-deprecated. Use conditional
+auto profiles.
+
+Using mpv from other programs or scripts
+========================================
+
+There are three choices for using mpv from other programs or scripts:
+
+ 1. Calling it as UNIX process. If you do this, *do not parse terminal output*.
+ The terminal output is intended for humans, and may change any time. In
+ addition, terminal behavior itself may change any time. Compatibility
+ cannot be guaranteed.
+
+ Your code should work even if you pass ``--no-terminal``. Do not attempt
+ to simulate user input by sending terminal control codes to mpv's stdin.
+ If you need interactive control, using ``--input-ipc-server`` is
+ recommended. This gives you access to the `JSON IPC`_ over unix domain
+ sockets (or named pipes on Windows).
+
+ Depending on what you do, passing ``--no-config`` or ``--config-dir`` may
+ be a good idea to avoid conflicts with the normal mpv user configuration
+ intended for CLI playback.
+
+ Using ``--input-ipc-server`` is also suitable for purposes like remote
+ control (however, the IPC protocol itself is not "secure" and not
+ intended to be so).
+
+ 2. Using libmpv. This is generally recommended when mpv is used as playback
+ backend for a completely different application. The provided C API is
+ very close to CLI mechanisms and the scripting API.
+
+ Note that even though libmpv has different defaults, it can be configured
+ to work exactly like the CLI player (except command line parsing is
+ unavailable).
+
+ See `EMBEDDING INTO OTHER PROGRAMS (LIBMPV)`_.
+
+ 3. As a user script (`LUA SCRIPTING`_, `JAVASCRIPT`_, `C PLUGINS`_). This is
+ recommended when the goal is to "enhance" the CLI player. Scripts get
+ access to the entire client API of mpv.
+
+ This is the standard way to create third-party extensions for the player.
+
+All these access the client API, which is the sum of the various mechanisms
+provided by the player core, as documented here: `OPTIONS`_,
+`List of Input Commands`_, `Properties`_, `List of events`_ (also see C API),
+`Hooks`_.
TAKING SCREENSHOTS
==================
@@ -705,8 +1013,8 @@ listed.
- ``AV:`` or ``V:`` (video only) or ``A:`` (audio only)
- The current time position in ``HH:MM:SS`` format (``playback-time`` property)
-- The total file duration (absent if unknown) (``length`` property)
-- Playback speed, e.g. `` x2.0``. Only visible if the speed is not normal. This
+- The total file duration (absent if unknown) (``duration`` property)
+- Playback speed, e.g. ``x2.0``. Only visible if the speed is not normal. This
is the user-requested speed, and not the actual speed (usually they should
be the same, unless playback is too slow). (``speed`` property.)
- Playback percentage, e.g. ``(13%)``. How much of the file has been played.
@@ -731,17 +1039,15 @@ listed.
- Dropped frames, e.g. ``Dropped: 4``. Shows up only if the count is not 0. Can
grow if the video framerate is higher than that of the display, or if video
rendering is too slow. May also be incremented on "hiccups" and when the video
- frame couldn't be displayed on time. (``vo-drop-frame-count`` property.)
+ frame couldn't be displayed on time. (``frame-drop-count`` property.)
If the decoder drops frames, the number of decoder-dropped frames is appended
to the display as well, e.g.: ``Dropped: 4/34``. This happens only if
decoder frame dropping is enabled with the ``--framedrop`` options.
- (``drop-frame-count`` property.)
-- Cache state, e.g. ``Cache: 2s+134KB``. Visible if the stream cache is enabled.
+ (``decoder-frame-drop-count`` property.)
+- Cache state, e.g. ``Cache: 2s/134KB``. Visible if the stream cache is enabled.
The first value shows the amount of video buffered in the demuxer in seconds,
- the second value shows the sum of the demuxer forward cache size and the
- *additional* data buffered in the stream cache in kilobytes.
- (``demuxer-cache-duration``, ``demuxer-cache-state``, ``cache-used``
- properties.)
+ the second value shows the estimated size of the buffered amount in kilobytes.
+ (``demuxer-cache-duration`` and ``demuxer-cache-state`` properties.)
LOW LATENCY PLAYBACK
@@ -802,10 +1108,10 @@ PROTOCOLS
``ytdl://...``
- By default, the youtube-dl hook script (enabled by default for mpv CLI)
- only looks at http URLs. Prefixing an URL with ``ytdl://`` forces it to
- be always processed by the script. This can also be used to invoke special
- youtube-dl functionality like playing a video by ID or invoking search.
+ By default, the youtube-dl hook script only looks at http(s) URLs. Prefixing
+ an URL with ``ytdl://`` forces it to be always processed by the script. This
+ can also be used to invoke special youtube-dl functionality like playing a
+ video by ID or invoking search.
Keep in mind that you can't pass youtube-dl command line options by this,
and you have to use ``--ytdl-raw-options`` instead.
@@ -816,7 +1122,7 @@ PROTOCOLS
``smb://PATH``
- Play a path from Samba share.
+ Play a path from Samba share. (Requires FFmpeg support.)
``bd://[title][/device]`` ``--bluray-device=PATH``
@@ -830,29 +1136,15 @@ PROTOCOLS
``bluray://`` is an alias.
-``dvd://[title|[starttitle]-endtitle][/device]`` ``--dvd-device=PATH``
+``dvd://[title][/device]`` ``--dvd-device=PATH``
Play a DVD. DVD menus are not supported. If no title is given, the longest
- title is auto-selected.
+ title is auto-selected. Without ``--dvd-device``, it will probably try
+ to open an actual optical drive, if available and implemented for the OS.
``dvdnav://`` is an old alias for ``dvd://`` and does exactly the same
thing.
-``dvdread://...:``
-
- Play a DVD using the old libdvdread code. This is what MPlayer and
- older mpv versions used for ``dvd://``. Use is discouraged. It's
- provided only for compatibility and for transition, and to work
- around outstanding dvdnav bugs (see "DVD library choices" above).
-
-``tv://[channel][/input_id]`` ``--tv-...``
-
- Analogue TV via V4L. Also useful for webcams. (Linux only.)
-
-``pvr://`` ``--pvr-...``
-
- PVR. (Linux only.)
-
``dvb://[cardnumber@]channel`` ``--dvbin-...``
Digital TV via DVB. (Linux only.)
@@ -876,9 +1168,17 @@ PROTOCOLS
demuxer name, and ``options`` is the (pseudo-)filename passed to the
demuxer.
- For example, ``mpv av://lavfi:mandelbrot`` makes use of the libavfilter
- wrapper included in libavdevice, and will use the ``mandelbrot`` source
- filter to generate input data.
+ .. admonition:: Example
+
+ ::
+
+ mpv av://v4l2:/dev/video0 --profile=low-latency --untimed
+
+ This plays video from the first v4l input with nearly the lowest latency
+ possible. It's a good replacement for the removed ``tv://`` input.
+ Using ``--untimed`` is a hack to output a captured frame immediately,
+ instead of respecting the input framerate. (There may be better ways to
+ handle this in the future.)
``avdevice://`` is an alias.
@@ -917,6 +1217,34 @@ PROTOCOLS
Stitch together parts of multiple files and play them.
+``slice://start[-end]@URL``
+
+ Read a slice of a stream.
+
+ ``start`` and ``end`` represent a byte range and accept
+ suffixes such as ``KiB`` and ``MiB``. ``end`` is optional.
+
+ if ``end`` starts with ``+``, it is considered as offset from ``start``.
+
+ Only works with seekable streams.
+
+ Examples::
+
+ mpv slice://1g-2g@cap.ts
+
+ This starts reading from cap.ts after seeking 1 GiB, then
+ reads until reaching 2 GiB or end of file.
+
+ mpv slice://1g-+2g@cap.ts
+
+ This starts reading from cap.ts after seeking 1 GiB, then
+ reads until reaching 3 GiB or end of file.
+
+ mpv slice://100m@appending://cap.ts
+
+ This starts reading from cap.ts after seeking 100MiB, then
+ reads until end of file.
+
``null://``
Simulate an empty file. If opened for writing, it will discard all data.
@@ -945,15 +1273,14 @@ Currently this happens only in the following cases:
or file associations provided by desktop environments)
- if started from explorer.exe on Windows (technically, if it was started on
Windows, and all of the stdout/stderr/stdin handles are unset)
-- started out of the bundle on OSX
+- started out of the bundle on macOS
- if you manually use ``--player-operation-mode=pseudo-gui`` on the command line
This mode applies options from the builtin profile ``builtin-pseudo-gui``, but
-only if these haven't been set in the user's config file or on the command line.
-Also, for compatibility with the old pseudo-gui behavior, the options in the
-``pseudo-gui`` profile are applied unconditionally. In addition, the profile
-makes sure to enable the pseudo-GUI mode, so that ``--profile=pseudo-gui``
-works like in older mpv releases. The profiles are currently defined as follows:
+only if these haven't been set in the user's config file or on the command line,
+which is the main difference to using ``--profile=builtin-pseudo-gui``.
+
+The profile is currently defined as follows:
::
@@ -962,6 +1289,14 @@ works like in older mpv releases. The profiles are currently defined as follows:
force-window=yes
idle=once
screenshot-directory=~~desktop/
+
+The ``pseudo-gui`` profile exists for compatibility. The options in the
+``pseudo-gui`` profile are applied unconditionally. In addition, the profile
+makes sure to enable the pseudo-GUI mode, so that ``--profile=pseudo-gui``
+works like in older mpv releases:
+
+::
+
[pseudo-gui]
player-operation-mode=pseudo-gui
@@ -972,6 +1307,50 @@ works like in older mpv releases. The profiles are currently defined as follows:
change, and not apply your additional settings, and/or use a different
profile name.
+Linux desktop issues
+====================
+
+This subsection describes common problems on the Linux desktop. None of these
+problems exist on systems like Windows or macOS.
+
+Disabling Screensaver
+---------------------
+
+By default, mpv tries to disable the OS screensaver during playback (only if
+a VO using the OS GUI API is active). ``--stop-screensaver=no`` disables this.
+
+A common problem is that Linux desktop environments ignore the standard
+screensaver APIs on which mpv relies. In particular, mpv uses the Screen Saver
+extension (XSS) on X11, and the idle-inhibit on Wayland.
+
+GNOME is one of the worst offenders, and ignores even the now widely supported
+idle-inhibit protocol. (This is either due to a combination of malice and
+incompetence, but since implementing this protocol would only take a few lines
+of code, it is most likely the former. You will also notice how GNOME advocates
+react offended whenever their sabotage is pointed out, which indicates either
+hypocrisy, or even worse ignorance.)
+
+Such incompatible desktop environments (i.e. which ignore standards) typically
+require using a DBus API. This is ridiculous in several ways. The immediate
+practical problem is that it would require adding a quite unwieldy dependency
+for a DBus library, somehow integrating its mainloop into mpv, and other
+generally unacceptable things.
+
+However, since mpv does not officially support GNOME, this is not much of a
+problem. If you are one of those miserable users who want to use mpv on GNOME,
+report a bug on the GNOME issue tracker:
+https://gitlab.gnome.org/groups/GNOME/-/issues
+
+Alternatively, you may be able to write a Lua script that calls the
+``xdg-screensaver`` command line program. (By the way, this a command line
+program is an utterly horrible kludge that tries to identify your DE, and then
+tries to send the correct DBus command via a DBus CLI tool.) If you find the
+idea of having to write a script just so your screensaver doesn't kick in
+ridiculous, do not use GNOME, or use GNOME video software instead of mpv (good
+luck).
+
+Before mpv 0.33.0, the X11 backend ran ``xdg-screensaver reset`` in 10 second
+intervals when not paused. This hack was removed in 0.33.0.
.. include:: options.rst
@@ -991,6 +1370,8 @@ works like in older mpv releases. The profiles are currently defined as follows:
.. include:: stats.rst
+.. include:: console.rst
+
.. include:: lua.rst
.. include:: javascript.rst
@@ -1014,10 +1395,6 @@ behavior of mpv.
``$HOME/.mpv`` is always added to the list of config search paths with a
lower priority.
-``XDG_CONFIG_DIRS``
- If set, XDG-style system configuration directories are used. Otherwise,
- the UNIX convention (``PREFIX/etc/mpv/``) is used.
-
``MPV_HOME``
Directory where mpv looks for user settings. Overrides ``HOME``, and mpv
will try to load the config file as ``$MPV_HOME/mpv.conf``.
@@ -1028,7 +1405,11 @@ behavior of mpv.
of ``--v`` options passed to the command line.
``MPV_LEAK_REPORT``
- If set to ``1``, enable internal talloc leak reporting.
+ If set to ``1``, enable internal talloc leak reporting. If set to another
+ value, disable leak reporting. If unset, use the default, which normally is
+ ``0``. If mpv was built with ``--enable-ta-leak-report``, the default is
+ ``1``. If leak reporting was disabled at compile time (``NDEBUG`` in
+ custom ``CFLAGS``), this environment variable is ignored.
``LADSPA_PATH``
Specifies the search path for LADSPA plugins. If it is unset, fully
@@ -1138,6 +1519,28 @@ For Windows-specifics, see `FILES ON WINDOWS`_ section.
in default configuration will use ``/usr/local/etc/mpv/`` as config
directory, while most Linux distributions will set it to ``/etc/mpv/``).
+``~/.config/mpv``
+ The standard configuration directory. This can be overridden by environment
+ variables, in ascending order:
+
+ :1: If ``$XDG_CONFIG_HOME`` is set, then the derived configuration directory
+ will be ``$XDG_CONFIG_HOME/mpv``.
+ :2: If ``$MPV_HOME`` is set, then the derived configuration directory will be
+ ``$MPV_HOME``.
+
+ If this directory, nor the original configuration directory (see below) do
+ not exist, mpv tries to create this directory automatically.