mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Loading super slow at fragmented video streaming platforms

Open KebabLord opened this issue 1 year ago • 3 comments

Important Information

Provide following Information:

  • mpv version: 0.35.1

  • Platform and Version: Win11, Win10, Debian 12

  • Source of the mpv binary: Source forge (for exe), APT for linux

  • If known which version of mpv introduced the problem

  • GPU model, driver and version: 1050ti

  • Possible screenshot or video of visual glitches

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

KebabLord avatar Feb 02 '24 07:02 KebabLord

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

christoph-heinrich avatar Feb 02 '24 08:02 christoph-heinrich

@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

KebabLord avatar Feb 03 '24 16:02 KebabLord

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

guidocella avatar Feb 03 '24 18:02 guidocella