-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mpv slow download speed? #8655
Comments
If it's specifically on youtube links and some others, see #5806 and ytdl-org/youtube-dl#11476 |
The problem is youtube ,cr , viki.com etc... everything I tried has the same problem? |
That's because those all use youtube-dl because they are not direct links? |
The problem is not youtube-dl it is with mpv! |
This is neither a youtube-dl nor an mpv issue. If you use download through the same URL in FFmpeg as in mpv and FFmpeg is also throttled, the problem/feature request belongs in FFmpeg, not mpv, as already explained in the links I mentioned. |
I did a little research myself ytdl-org/youtube-dl#15384 (comment) https://github.com/yt-dlp/yt-dlp and I don't know how much correct I am but with aria2 the download speed can be increased if I'm right with So if Im right? Edit:Would something like this work in the mpv.conf? |
you can't use an external downloaded with our youtube-dl lua script. youtube-dl returns an url to us and ffmpeg is doing the rest. it never downloads anything on disk. if you want to use it you have to use youtube-dl on it's own and play the resulting file on the disk with mpv or pipe it to mpv. |
İt would be great if mpv could use aria2c for sites like CR and viki.com since yt-dl does send ffmpeg to download and speed is really slow! Could I make request like this? İs it possible? |
i am not sure if this is something we want in our youtube-dl script. though that's not up to me. like mentioned before and the other issues, this is something ffmpeg should add. |
I want to say all the things below for it just to be only idea or request. I hope that this maybe will happen someday.I thank you for your help and understand it not only for you to decide but There is this yt-dlc fork yt-dlp that does support aria2c as the external downloader for DASH(mpd) and HLS(m3u8) formats. |
youtube-dl literally has the same aria2c support. Those forks of it obviously have it too. |
It's also possible that mpv fills the cache quickly, and then it keeps downloading at a rate which matches the playback speed. To test: play with To increase the cache, for instance to 1G (the default is 150M forward), use |
But when I try to download CR with youtube-dl it isn't using aria2c it uses ffmpeg? Are you sure that youtube-dl does support aria2c as the external downloader for DASH(mpd) and HLS(m3u8) formats? |
|
This only work in the beginning later it goes down to slow speed again but thanks. |
This issue reads like trying to walkthrough my mom in sending a WhatsApp text message: it goes nowhere. |
Sorry for my bad English I probably couldn't explained right. |
@erickyun's solution with yt-dlp worked great for me, thank you! @garoto if you could take some time from coming up with snarky zingers, you'd realize that the issue that actual users are having is that YouTube playback with MPV is unusable. To that end, @erickyun's solution works fine, unless the point is to strictly and pedantically adhere to "the point of the initial question", which, even then, I'm sure @erickyun is more qualified to speak on, as he was the one who asked the question. |
Hi all! Just want to share I have the same problem, can't play a youtube video with mpv. It's buffering all the time :/ I was googling around and ended up in youtube-viewer (https://github.com/trizen/youtube-viewer). I tested it and I can play a 1080p video without problems, so it's not a problem of my laptop or internet connection. Writing this so that people are aware the problem is ongoing. |
TL;DR: use yt-dlp instead of youtube-dl. |
Hello, After reading this thread, i want to do a summary, to check if i understand things correctly:
Is my understanding correct? In order to not have issues with buffering, we were suggested to 1. download a video fully using yt-dlp, 2. open that video file in mpv 3. watch without buffering. My next question is: is there a possibility to instruct mpv to download via yt-dlp directly, and not via ffmpeg, and somehow pass the "download in progress" video stream from yt-dlp to ffmpeg or to mpv to do the rest of the processing? Basically, what i'm saying is: can we sidestep ffmpeg from downloading the video and leave this task to yt-dlp instead? For the record, i have 1 GBps up and down, and when i download with yt-dlp ( |
Youtube now throttles requests of more than 10MB at a time, yt-dlp works around it by making many requests of 10MB using Selecting HLS streams with You can also let yt-dlp do the downloading by piping its standard output to mpv, e.g. with this zsh script: yt-dlp --get-title --get-url $1 | IFS=$'\n' read -d '' title video audio
mpv --force-media-title=$title --audio-file=<(yt-dlp --http-chunk-size 10M -o - $audio) <(yt-dlp --http-chunk-size 10M -o - $video) But this breaks seeking to timestamps that haven't been cached yet, and doesn't set the chapter list or subtitles. The lower the resolution you request the more you are throttled, so lowering the resolution doesn't let you download faster. |
Thank you for this advice. I always watched 720p60 with ~600kB speed. But after switching to 720p30 stream that contains both video and audio the speed is now ~5mB (max speed of my wifi connection) |
Try this to unlock full ISP speeds |
Thanks! My old options were |
Just a small update for the script by @pc00per
No seeking or chapters but it utilizes the network max speed. |
@piyushgarg btw I bash aliased all those commands
|
Is it possible to use it in |
Really hope ffmpeg is updated to support this eventually. |
#12254 I realize that this sounds definitely not like an ffmpeg problem, since ffmpeg's job is encoding and decoding, not splitting requests into pieces to bypass video service limitations. |
That's such a crutch...
But in any case for streaming broadcasts neither this option nor the option with separate audio stream loading is not suitable and mpv should load via yt-dlp instead of ffmpeg itself by default! |
FFmpeg feature request: https://trac.ffmpeg.org/ticket/10381 |
Made a simple program to act as a proxy and modify Range header before it gets to ffmpeg: https://gist.github.com/ftk/253347b2c9a53bbd6087f086970106b6 |
Is it really true that this has to be implemented in ffmpeg? For the first request you just set |
I tried How would you detect the chunks in an mpv script? If that was possible I assume the offsets could be updated with |
I'm not holding my breath as ffmpeg is very slow to evolve nowadays, could takes another century not even joking. Honestly we would rather do our own implement instead. |
This is the best solution honestly, I take this over ffmpeg unforesee fixes any day. Thanks for sharing! |
Ok coomer. |
I don't know how to do this in mpv, but ffmpeg already exposes everything you need to implement ranged requests, so in principle it's possible. It would be of help if any mpv developers could comment on this. |
13 months passed, no response. I would love to believe or even believe in ffmpeg.
I'm not sure if it's possible with lua ? Because unless you heavily modify mpv's lua capability, it can't send/recv network requests, you have to install LuaRocks' LuaSocket which most users can't, unless mpv decices to make LuaSocket built-in, honestly this ain't a bad idea, like at all who care about small non-existence security issues for people who install script carelessly ? |
mpv doesn't have to do any network-related operation: as I said, it's enough to set the |
I still don't understand, using Or I misunderstand your idea ? Are we going to write a new feature for mpv or are we going to write a plugin ? |
I don't know what |
Good working solution after many-long-unfortunate googling and ffmpeg/mpv tweaking. This should get more recognition. Thanks very much for making mpv+yt streaming painless finally. |
Тоже пришел по такому пути. Как это использовать? |
Some sites throttle requests, but throttling can be avoided with many small range requests. yt-dlp implements a "http_chunk_size" key in its -J output to inform us of the ideal size. With the appropriate[1] FFmpeg addition, we can properly implement this now, which greatly speeds up how fast YouTube videos get loaded into the cache by mpv. Should the FFmpeg that mpv is built against lack the max_request_size AVOption, then this will silently not do anything new, so no version checks are needed. Fixes mpv-player#8655. [1]: https://patchwork.ffmpeg.org/project/ffmpeg/patch/[email protected]/
mpv is downloading slow with every stream link?
My internet speed is normally 10MiB/s but mpv I'm getting 600-900KiB/s ?
Nornally downloading with youtube-dl Im getting fast speed but with mpv the speed is slow?
Edit:
I noticed when seek forward or backward the speed goes to 7MiB/s and then it goes fast down to 600-900KiB/s ?
The text was updated successfully, but these errors were encountered: