1
mirror of https://github.com/mpv-player/mpv synced 2024-10-30 04:46:41 +01:00

stream_lavf: add support for data URIs

Only FFmpeg supports them and they need to be in the format data://
like other protocols or prefixed with ffmpeg:// or lavf://.

Closes #4058
This commit is contained in:
Ricardo Constantino 2017-01-25 15:33:05 +00:00
parent 39adaf3dcc
commit d303ebd9b6
No known key found for this signature in database
GPG Key ID: EFD16019AE4FF531
3 changed files with 6 additions and 1 deletions

View File

@ -673,6 +673,10 @@ PROTOCOLS
either aliases to documented protocols, or are just redirections to either aliases to documented protocols, or are just redirections to
protocols implemented and documented in FFmpeg. protocols implemented and documented in FFmpeg.
``data:`` is supported in FFmpeg (not in Libav), but needs to be in the
format ``data://``. This is done to avoid ambiguity with filenames. You
can also prefix it with ``lavf://`` or ``ffmpeg://``.
``ytdl://...`` ``ytdl://...``
By default, the youtube-dl hook script (enabled by default for mpv CLI) 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 only looks at http URLs. Prefixing an URL with ``ytdl://`` forces it to

View File

@ -295,7 +295,7 @@ mp.add_hook("on_load", 10, function ()
msg.debug("streamurl: " .. streamurl) msg.debug("streamurl: " .. streamurl)
mp.set_property("stream-open-filename", streamurl) mp.set_property("stream-open-filename", streamurl:gsub("^data:", "data://", 1))
mp.set_property("file-local-options/force-media-title", json.title) mp.set_property("file-local-options/force-media-title", json.title)

View File

@ -416,6 +416,7 @@ const stream_info_t stream_info_ffmpeg = {
.protocols = (const char *const[]){ .protocols = (const char *const[]){
"rtmp", "rtsp", "http", "https", "mms", "mmst", "mmsh", "mmshttp", "rtp", "rtmp", "rtsp", "http", "https", "mms", "mmst", "mmsh", "mmshttp", "rtp",
"httpproxy", "hls", "rtmpe", "rtmps", "rtmpt", "rtmpte", "rtmpts", "srtp", "httpproxy", "hls", "rtmpe", "rtmps", "rtmpt", "rtmpte", "rtmpts", "srtp",
"data",
NULL }, NULL },
.can_write = true, .can_write = true,
.is_safe = true, .is_safe = true,