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

[YouTube] How does best format selection work; how are the stream properties (like ABR) determined? #22709

Closed
RevSnowfox opened this issue Oct 14, 2019 · 3 comments

Comments

@RevSnowfox
Copy link

@RevSnowfox RevSnowfox commented Oct 14, 2019

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

Hi! I would like to ask for elaboration from the main developers on two technical questions;

  1. How does the best and bestvideo/bestaudio format options work? What technical parameters youtube-dl considers when selecting the best formats, especially with YouTube?

  2. Considering formats and their properties listed on YouTube, what sources/methods youtube-dl uses to enumerate stream properties? I'm aware of the hardcoded stream descriptions in the YouTube extractor code, but how were those values determined in the first place? For example, youtube-dl lists ABR (average bitrate) values for each video/audio stream format (which is not necessarily indicative of the subjective perceptive quality of a stream), but ultimately what is the source of those ABR values?

Thank you for any answers in advance!

@RevSnowfox RevSnowfox added the question label Oct 14, 2019
@dstftw dstftw closed this Oct 14, 2019
@dstftw dstftw added the duplicate label Oct 14, 2019
@RevSnowfox
Copy link
Author

@RevSnowfox RevSnowfox commented Oct 14, 2019

Duplicate of what exactly? There is literally no issue or question ticket that details the technicalities of format selection in youtube-dl, aside from vague mentions about youtube-dl "preferring higher bitrates".

Bitrates from what source? How it is determined? What is the source of the hardcoded ABR values in the YouTube extractor code?

@Hrxn
Copy link

@Hrxn Hrxn commented Oct 14, 2019

There is literally no issue or question ticket that details the technicalities of format selection in youtube-dl, aside from vague mentions about youtube-dl "preferring higher bitrates".

Well no, these questions come up occasionally.

All values as provided by YouTube.

@RevSnowfox
Copy link
Author

@RevSnowfox RevSnowfox commented Oct 14, 2019

If the ABR values are provided at the time of scraping a given YouTube page, why are they in the extractor code? Or does this mean those ABR values were obtained previously in another way from YouTube? (Because if so, other tools might access those values if they are changed on YouTube's end. Obviously ABR values are just guidelines for the transcoding processes YouTube does in the back-end, but still.)

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