-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Change default value of --ytdl-format to include DASH #1321
Comments
First of all, I think that sticking with nothing -> Secondly, as you already mentioned, DASH support should be considered only experimental at this point, and even if we fake the duration for display purposes, stuff like seeking remains broken (very slow). So I'm completely against using DASH formats by default unless DASH can be properly handled. Thirdly, yes, the documentation could be improved a bit, I'll look into that. |
Also: While you might want to get 1080p via DASH, you certainly still want the normal 720p (or 360p respectively) video which is still available on youtube, not 720p DASH, as at least right now that would be a straight downgrade. |
Would be cool to be able to set --max-quality at mpv's config or lua-settings/ytdl-hook.conf and keep youtube-dl.conf with the --max-quality appropriate for downloads. As I have limited bandwidth, I can barely handle 1080p30 streamed, but I like watching some gameplay at 1080p60 if available so I set youtube-dl.conf with "--max-quality 137" and whenever I want to download something to watch later, I use "--max-quality 299" as arg so I get 1080p60 to watch at leisure. |
Just put |
Wouldn't that need to be 137+bestaudio/best? Also, that's not fully the same thing as --max-quality, because this wouldn't pick up 720p60 for instance. |
Like with this video, for example. |
A couple of points:
vs.
|
I personally went with using
on youtube-dl.conf (for downloads) and
on mpv/config |
Here is a list of all youtube-dl formats: So far I believe this is the most complete list of video formats in descending resolution order: |
Isn't DASH enabled by default now in youtube-dl with 'best' as format? |
youtube-dl changed defaults to "bestvideo+bestaudio/best". Since mp4 dash videos still aren't fully supported, the defaults in mpv were changed to just "best". |
At least the ffmpeg mp4 demuxer needs to be fixed before we can do this. |
Nonono. Don't specify YouTube format codec numbers individually! I'm writing here because this post is the highest Google result for "mpv youtube 720p", and all of the methods above are terrible. This is a more advanced way: It picks the best format it can find (up to but not above 1080p), chooses 30fps or lower (since 60fps just leads to dropped frames and stutter on my computer), and lastly it also ignores the stupid VP9 codec.
If you want to limit it to 720p30 or lower, use this instead:
No matter what you do, I highly recommend using one of these lines in your mpv.conf. Otherwise it always picks the highest-quality version, which may mean 4K @ 60 fps = hell for your CPU to decode, and a total waste of bandwidth! |
That's a pretty good config for most people, except for that fps part (you have to pretty old computer or your GPU acceleration isn't working properly if you can't play 60 fps even in H264?). Also, at least for me H264 is automatically preferred, so that For live videos, 60 fps isn't supported by youtube-dl and Youtube itself doesn't support higher than 1080p for live streaming. |
@tp0 Yeah I run with software-based CPU decoding on a 6-year old Core i7, where 60 fps @ 1080p leads to dropped frames and stutter. I could use GPU decoding but then I'd miss out on many mpv filters. Many people with older computers would want the fps options. Others would want to remove it. Just take out the [fps<=?30] part. As for H264 being preferred by default: Nope. Look at https:/rg3/youtube-dl/blob/master/youtube_dl/extractor/youtube.py (search for the word "vp9"). The "preference" strength of vp9 and h264 is identical, so it might possibly pick a vp9 stream if one is listed earlier in the metadata for a video. I don't know if they've got any more code to prefer h264 over vp9 in there, but it really doesn't look like it to me. So that is why I blocked out vp9 just to be sure. Because I hate that dumb, CPU-inefficient and ugly-looking codec. All the best looking encoders and most efficient software decoders are written for H264. |
I really don’t believe this is your CPU’s fault, especially not with YouTube’s streams, unless you’re doing some sort of unreasonable filtering. After all, a Phenom II manages fine, at least for H.264 (never tried VP9 on that particular machine, but I agree that it’s pretty crappy). Also, you can use GPU decoding with filters by using one of the |
In my case vp9 was picked by default. SteveJobzniak's solution solved the problem. |
Setting `ytdl-format` to `best[height<=768]` (like I did) was a regression from the default (`bestvideo+bestaudio/best`): it prevents youtube-dl from using separate sources for video and audio. (It also seems 1080p and higher resolutions aren't available on YouTube that way, though I'm only using 720p on my laptop.) See [1] and [2]. [1]: mpv-player/mpv#1321 [2]: mpv-player/mpv@78caf6ae8634b9fe9589187d8f
Hello, thanks to all for sharing the solution. I have a similar issue but the phenomenon is different : But with this movie, the video is lagging a lot and the audio is totally not synchronized : So I have changed my config file into : After this setting, the second video runs better, but is still lagging a bit with no sync between audio/video. So I have changed my config file into : Now, both video run perfectly. I guess the solution was to pass the vp9 codec into 30fps.
How to set up such condition please ? Thank you ! |
Hello , i would like to prefer vp9 over mp4, how could i achieve that (withouth excluding mp4)? |
I would like to suggest switching the default value of --ytdl-format from what we use currently (nothing, which falls back to youtube-dl's default of “best” - which might be worth documenting, incidentally) to the value “bestvideo+bestaudio/best”.
The reason youtube-dl ignores stuff like DASH by default is because it's a tool designed to download the files, and using bestvideo+bestaudio forces it to download first the entire video, then the entire audio, then mux them together using ffmpeg. This problem does not apply to us since we just directly stream either way.
The difference this would make is that it would effectively enable DASH video/audio for youtube, giving casual users of mpv easy access to 1080p videos by default, which would be an actual serious advantage over quvi.
The drawbacks are that DASH support is currently suboptimal w.r.t duration due to bugs in ffmpeg, so I would expect at least a quick client-side workaround that lets us display, if nothing else, an accurate progress bar on the OSD.
Whether this specific proposal gets granted or denied, it would be a good idea to add more documentation about this parameter. For example, it doesn't mention the special formats “bestvideo” and “bestaudio” (which will include DASH formats), nor the operator “a+b” for effectively playing two streams at the same time, nor the operator “/” for falling back to different versions.
The text was updated successfully, but these errors were encountered: