Skip to content

ytdl_hook: pass a default format again - #18468

Merged
kasper93 merged 2 commits into
mpv-player:masterfrom
kasper93:ytdl-fix
Sep 13, 2026
Merged

kasper93 merged 2 commits into
mpv-player:masterfrom
kasper93:ytdl-fix

Conversation

@kasper93

Copy link
Copy Markdown
Member

No description provided.

This is a revert of a6f3236 with bestvideo* added. Dropping the
default format was meant to follow yt-dlp's `bv*+ba/b`, but yt-dlp only
selects that when it finds ffmpeg to merge the tracks. Otherwise it
falls back to `best`, a muxed format, which is most of the time is not
optimal selection.
Since ffd3ae1 hls, and later dash, were opened by libavformat itself
from the URL, so the manifest mpv already fetched for probing was fetched
a second time. Back then the HLS demuxer copied the user agent and
cookies from its own URLContext for the nested requests and there was no
io_open hook to intercept them, so this was the only way to get the
network options onto the nested requests. Both are gone, the nested
requests go through nested_io_open() since 02756c3.

Wrap the stream as for every other format, libavformat parses the
manifest from it and opens only the nested URLs itself.
Comment thread player/lua/ytdl_hook.lua
Comment thread DOCS/man/options.rst
@sfan5

sfan5 commented Sep 11, 2026

Copy link
Copy Markdown
Member

yt-dlp's bv*+ba/b, but yt-dlp only selects that when it finds ffmpeg to merge the tracks.

Couldn't this be considered a yt-dlp bug? If I'm passing --dump-json it's sort of implied that I'm not interested in letting it handle the merging/etc. so ffmpeg auto-detection shouldn't matter.

@kasper93

Copy link
Copy Markdown
Member Author

yt-dlp's bv*+ba/b, but yt-dlp only selects that when it finds ffmpeg to merge the tracks.

Couldn't this be considered a yt-dlp bug? If I'm passing --dump-json it's sort of implied that I'm not interested in letting it handle the merging/etc. so ffmpeg auto-detection shouldn't matter.

It could, but good luck changing that. yt-dlp is designed primarily as downloading too, not external extractor. There are many assumptions made that does not really apply to mpv. It doesn't even have real api.

@kasper93
kasper93 merged commit 13a4bfb into mpv-player:master Sep 13, 2026
43 of 54 checks passed
@kasper93
kasper93 deleted the ytdl-fix branch September 13, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants