summaryrefslogtreecommitdiffstats
path: root/DOCS
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-15 18:09:28 +0100
committerwm4 <wm4@nowhere>2020-02-15 18:29:44 +0100
commitc92c08edc671e64c31d98584e709b0f712864772 (patch)
tree7895910f80f81c11493fcf546c9fdbf77f4856e4 /DOCS
parent1d53a8f2e725cb9e3e71a9ca70feb880747d782f (diff)
downloadmpv-c92c08edc671e64c31d98584e709b0f712864772.tar.bz2
mpv-c92c08edc671e64c31d98584e709b0f712864772.tar.xz
edl: add mechanism for delay loading streams
Add something that will access an URL embedded in EDL only when the track it corresponds to is actually selected. This is meant to help with ytdl_hook.lua and to improve loading speeds. In theory, all this stuff is available to any mpv user, but discourage using it, as it's so specialized towards ytdl_hook.lua, that there's danger we'll just break this once ytdl_hook.lua stops using it, or similar. Mostly untested.
Diffstat (limited to 'DOCS')
-rw-r--r--DOCS/edl-mpv.rst72
1 files changed, 72 insertions, 0 deletions
diff --git a/DOCS/edl-mpv.rst b/DOCS/edl-mpv.rst
index 495b27279e..ec60d09ccc 100644
--- a/DOCS/edl-mpv.rst
+++ b/DOCS/edl-mpv.rst
@@ -195,6 +195,78 @@ example as above::
Note that ``!new_stream`` must be the first header. Whether the parser accepts
(i.e. ignores) or rejects other headers before that is implementation specific.
+Track metadata
+==============
+
+The special ``track_meta`` header can set some specific metadata fields of the
+current ``!new_stream`` partition. The tags are applied to all tracks within
+the partition. It is not possible to set the metadata for individual tracks (the
+feature was needed only for single-track media).
+
+It provides following parameters change track metadata:
+
+``lang``
+ Set the language tag.
+
+``title``
+ Set the title tag.
+
+``byterate``
+ Number of bytes per second this stream uses. (Purely informational.)
+
+Example::
+
+ # mpv EDL v0
+ !track_meta,lang=bla,title=blabla
+ file.mkv
+ !new_stream
+ !track_meta,title=ducks
+ sub.srt
+
+If ``file.mkv`` has an audio and a video stream, both will use ``blabla`` as
+title. The subtitle stream will use ``ducks`` as title.
+
+The ``track_meta`` header is not part of the core EDL format. It may be changed
+or removed at any time, depending on mpv's internal requirements.
+
+Delayed media opening
+=====================
+
+The special ``delay_open`` header can be used to open the media URL of the
+stream only when the track is selected for the first time. This is supposed to
+be an optimization to speed up opening of a remote stream if there are many
+tracks for whatever reasons.
+
+This has various tricky restrictions, and also will defer failure to open a
+stream to "later". By design, it's supposed to be used for single-track streams.
+
+Using multiple segments requires you to specify all offsets and durations (also
+it was never tested whether it works at all). Interaction with ``mp4_dash`` may
+be strange.
+
+This has the following parameters:
+
+``media_type``
+ Required. Must be set to ``video``, ``audio``, or ``sub``. (Other tracks in
+ the opened URL are ignored.)
+
+``codec``
+ The mpv codec name that is expected. Although mpv tries to initialize a
+ decoder with it currently (and will fail track selection if it does not
+ initialize successfully), it is not used for decoding - decoding still uses
+ the information retrieved from opening the actual media information, and may
+ be a different codec (you should try to avoid this, of course). Defaults to
+ ``null``.
+
+ Above also applies for similar fields such as ``w``. These fields are
+ mostly to help with user track pre-selection.
+
+``w``, ``h``
+ For video codecs: expected video size. See ``codec`` for details.
+
+The ``delay_open`` header is not part of the core EDL format. It may be changed
+or removed at any time, depending on mpv's internal requirements.
+
Timestamp format
================