mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.53k stars 2.92k forks source link

Loading super slow at fragmented video streaming platforms #13393

Open KebabLord opened 9 months ago

KebabLord commented 9 months ago

Important Information

Provide following Information:

Reproduction steps

Standard playing which is naturally slow: mpv https://odnoklassniki.ru/videoembed/2252983175846 Playing with concurrent fragments set to 5, expected to be faster but same buffering speed: mpv https://odnoklassniki.ru/videoembed/2252983175846 --ytdl-raw-options=concurrent-fragments=5

Expected behavior

By default yt-dlp loads fragments one by one, which is super slow on some fragmented streaming services such as ok.ru. Naturally, as a result, mpv also plays this videos really slow. This is not the fault of mpv.

But when you add --concurrent-fragments=5 parameter to yt-dlp, the download speed increases 5 times! So i'm passing this parameter to mpv using --ytdl-raw-options but it doesn't affect anything. I expected it to load the video as fast as yt-dlp does. It's really annoying because on each fragment load, the video freezes for a second.

I think this parameter should be fixed and set to something higher than 1 by default since it'll increase mpv's performance and buffering speed too.

Log file

I uploaded 2 log files,for both scenarios.

mpv https://odnoklassniki.ru/videoembed/2252983175846 --log-file=standard_mode.txt --length=10
mpv https://odnoklassniki.ru/videoembed/2252983175846 --ytdl-raw-options=concurrent-fragments=5 --log-file=concurrent_mode.txt --length=10

standard_mode.txt concurrent_mode.txt

Sample files

https://odnoklassniki.ru/videoembed/2252983175846

christoph-heinrich commented 9 months ago

yt-dlp is used to extract data, but the downloading itself isn't handled by yt-dlp. That' why that parameter doesn't help.

KebabLord commented 9 months ago

@christoph-heinrich mpv fetching fragments concurrently would be a great feature since it would really boost the buffering speed on some streaming platforms. This feature even should be enabled by default.

Since yt-dlp supports extracting multiple fragment data at once, it doesn't sound impossible to implement this feature. I'd create the PR myself but i don't have experience with multi tasking on C

guidocella commented 9 months ago

yt-dlp --concurrent-fragments 5 -o - https://odnoklassniki.ru/videoembed/2252983175846 | mpv -