Below you will find pages that utilize the taxonomy term “Mpv”
Bilibili Danmaku Integration for mpv on macOS
Introduction
Bilibili provides Danmaku in an XML format that mpv cannot natively render. Furthermore, Bilibili’s AI subtitles often use non-standard language tags (like ai-zh), which can lead to “null” tracks or rendering errors in older mpv kernels (like the one used in IINA).
Thankfully, yt-dlp allows us to extract and download these Danmaku and AI subtitles; danmaku2ass(deveoped by @m13253) provides a brilliant solution to convert XML files to ASS subtitles.
Solution to the Failure to Pass Cookies into yt-dlp When Using mpv
Issue Description
When using mpv to play videos from Bilibili, users may encounter issues where mpv fails to pass cookies to yt-dlp correctly, regardless of whether the cookies are already in Netscape format, leading to error messages like the following:
→ mpv --cookies-file="~/bilibili_cookies.txt" --ytdl-raw-options=format=100028+30280 https://www.bilibili.com/video/BV1HMH7z4ES4
[ytdl_hook] ERROR: [BiliBili] BV1HMH7z4ES4: Requested format is not available. Use --list-formats for a list of available formats
[ytdl_hook] youtube-dl failed: unexpected error occurred
Failed to recognize file format.
The format 100028+30280 is a valid format on Bilibili, but only extractable when the user is logged in, which requires the correct cookies to be passed to yt-dlp, which is the default backend for mpv to handle online video playback.