Skip to content
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

Provide a way to choose the best resolution #11686

Closed
utack opened this issue Jan 11, 2017 · 11 comments
Closed

Provide a way to choose the best resolution #11686

utack opened this issue Jan 11, 2017 · 11 comments

Comments

@utack
Copy link

@utack utack commented Jan 11, 2017

Hi,
currently there seems to be no way of choosing the best resolution video.
Example: I'd like vp9 where possible from Youtube, but would take a 480p H264 stream over the 360p VP9 stream.
Is there a method to achieve this?
If not, it would be great if you could provide something to pick the best resolution video.

Thank you

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.01.10. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.01.10

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other
@jdmoore0883
Copy link

@jdmoore0883 jdmoore0883 commented Jan 11, 2017

try running:
youtube-dl -f bestvideo "<YOUTUBE_URL>"

@utack
Copy link
Author

@utack utack commented Jan 11, 2017

That works, but unfortunately it ignores the codec preference. For cases where 1080p H264 and VP9 are available it chooses H264

@shizeeg
Copy link
Contributor

@shizeeg shizeeg commented Jan 11, 2017

try to add --prefer-free-formats to your youtube-dl command line parameters

@utack
Copy link
Author

@utack utack commented Jan 11, 2017

Unfortunately the prefer free formats option applied to youtube-dl in mpv still chooses the 360p version

@linglung
Copy link

@linglung linglung commented Jan 12, 2017

You want to select best available format? why didn't use youtube-dl -F to check it first before downloading? then pick -f number

@utack
Copy link
Author

@utack utack commented Jan 12, 2017

You want to select best available format? why didn't use youtube-dl -F to check it first before downloading? then pick -f number

Thanks for letting me know, but I read the docs and realized that works
Unfortunately it does not solve the problem the format stream should be able to automatically sort out the one that is best by certain criteria, like for example has the highest resolution. I watch 30+ youtube videos a day starting mpv and youtube-dl from a browser plugin, sorting them out manually is not an option

@shizeeg
Copy link
Contributor

@shizeeg shizeeg commented Jan 12, 2017

Unfortunately the prefer free formats option applied to youtube-dl in mpv still chooses the 360p version

@utack you can pass youtube-dl parameters using mpv's --ytdl-raw-options or --ytdl-format like that:
$ mpv --ytdl-format=bestvideo --ytdl-raw-options='--prefer-free-formats='
take a note of final =

you may also like to put all that in ~/.config/mpv/mpv.conf w/o leading --:
# ~/.config/mpv/mpv.conf
ytdl-format=bestvideo
ytdl-raw-options='--prefer-free-formats='
# end of mpv.conf

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Feb 3, 2017

I'd like vp9 where possible from Youtube, but would take a 480p H264 stream over the 360p VP9 stream.

Sounds like you want to compare resolutions first and then video codecs. That's a missing feature, see #6018. As of now you can use a hardcoded list of known itags as the format filter. See _formats table in youtube_dl/extractor/youtube.py for known itags.

@yan12125 yan12125 closed this Feb 3, 2017
@fireattack
Copy link

@fireattack fireattack commented Feb 20, 2017

@yan12125 Is there any way to compare resolution first, then video bitrate (I don't care about codecs)? Because you know, sometimes the higher resolution ones have lower bitrates.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Feb 20, 2017

Not possible.

@vikdotdev
Copy link

@vikdotdev vikdotdev commented Feb 16, 2019

Is there any way to compare resolution first, then video bitrate (I don't care about codecs)? Because you know, sometimes the higher resolution ones have lower bitrates.

@dstftw it's been quite some time, is this still true as of today? Are there workarounds (ignoring bitrate altogether)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.