mirror of
https://github.com/mpv-player/mpv
synced 2025-03-02 20:28:02 +00:00
ytdl_hook: add script opt for using manifest URLs
Disable by default.
This feature was added in 7eb342757
, which allowed stream selection
in runtime. Problem with this atm is that FFmpeg will try to demux
every first packet of every track leading to noticeable delay opening
the URL.
This option can be changed to enabled by default or removed when
HLS/DASH demuxers are improved upstream.
This commit is contained in:
parent
664e8fe66a
commit
57228b6581
@ -560,6 +560,10 @@ Program Behavior
|
||||
which mpv should not use with youtube-dl. The patterns are matched after
|
||||
the ``http(s)://`` part of the URL.
|
||||
|
||||
The `use_manifests` script option makes mpv use the master manifest URL for
|
||||
formats like HLS and DASH, if available, allowing for video/audio selection
|
||||
in runtime. It's disabled ("no") by default for performance reasons.
|
||||
|
||||
``^`` matches the beginning of the URL, ``$`` matches its end, and you
|
||||
should use ``%`` before any of the characters ``^$()%|,.[]*+-?`` to match
|
||||
that character.
|
||||
|
@ -4,7 +4,8 @@ local options = require 'mp.options'
|
||||
|
||||
local o = {
|
||||
exclude = "",
|
||||
try_ytdl_first = false
|
||||
try_ytdl_first = false,
|
||||
use_manifests = false
|
||||
}
|
||||
options.read_options(o)
|
||||
|
||||
@ -279,7 +280,7 @@ local function add_single_video(json)
|
||||
local reqfmts = json["requested_formats"]
|
||||
|
||||
-- prefer manifest_url if present
|
||||
if valid_manifest(json) then
|
||||
if o.use_manifests and valid_manifest(json) then
|
||||
local mpd_url = reqfmts and reqfmts[1]["manifest_url"] or
|
||||
json["manifest_url"]
|
||||
if not mpd_url then
|
||||
|
Loading…
Reference in New Issue
Block a user