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

Does -f bestvideo prefer vp9 over other codecs? Same question for bestaudio and opus #20514

Closed
ZYinMD opened this issue Mar 31, 2019 · 2 comments
Closed

Comments

@ZYinMD
Copy link

@ZYinMD ZYinMD commented Mar 31, 2019

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2019.03.18. 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 2019.03.18

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

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

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


For youtube.com, I currently do this:
-f bestvideo[height<=?1080]+bestaudio/best.

On top of [height<=?1080], there are 3 more settings I want to do, but I think they're already the default? Just want to double check:

  1. For vcodec, prefer vp9 over bestvideo, but only when same resolutions exist
  2. For acodec, prefer opus > vorbis > bestaudio
  3. When combination of vp9 + opus/vorbis are used, use .webm as container.

If they're not the default, I'd like the configure them manually. In that case, I'd hope to get some help in this thread before it's closed, because I'm not confident in the complicated selectors I wrote myself.
Thanks!

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 31, 2019

1, 2. vcodec and acodec are not considered by formats sorting. What is considered is media file extension but it does not really matter since base quality metadata is checked first. Only if base quality metadata is equal then media file extension is processed and it does not prefer free formats. This can be changed with --prefer-free-formats.
3. If formats being merged are compatible the container will be the original one otherwise - mkv. vp9, opus and vorbis are compatible thus merged as webm.

@dstftw dstftw closed this Mar 31, 2019
@ytdl-org ytdl-org deleted a comment from Hrxn Mar 31, 2019
@ZYinMD
Copy link
Author

@ZYinMD ZYinMD commented Mar 31, 2019

Thanks @Hrxn and @dstftw for your answers, so if I pass in -f bestvideo and --prefer-free-formats at the same time, will I get VP9 over AVC?

If no, can I manually do something like -f bestvideo[height=1080][vcodec*=VP9]+bestaudio/bestvideo[height<=?1080]+bestaudio/best ? I'm not confident in what I write.

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
2 participants
You can’t perform that action at this time.