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

Defaults to 360p #184

Open
JamesRBrown opened this issue Jun 29, 2021 · 4 comments
Open

Defaults to 360p #184

JamesRBrown opened this issue Jun 29, 2021 · 4 comments

Comments

@JamesRBrown
Copy link

ytdl does not default to highest quality, it defaults to 360p, and it doesn't seem to want to take any sort of parameter to tell it to do differently.

It would help if the documentation or the built in help explained how quality is supposed to specified.

Regardless, I have downloaded a number of 1080p and up videos, and they all come out as 360p.

@JamesRBrown
Copy link
Author

Looking into this more, ytdl is taking the top object off of the info.formats array. Which is pretty random. Often times it's the smallest mp4 file, sometimes it's a 'webm' file. I haven't found where this decision is being made in the code yet. But that does seem to be the problem. This video for instance returns webm: https://www.youtube.com/watch?v=ifTZLtJDoaU

@redbrain
Copy link

item 0 is almost always itag 18, which is the best format that contains both video and audio for a given youtube link.
getting a higher quality video wouldn't have audio, so ffmpeg would be required to merge the two sources.

@JamesRBrown
Copy link
Author

JamesRBrown commented Aug 15, 2021

Well, not really. I wrote a function to filter out streams which don't contain both audio and video, then I sorted them based off of width, with widest descending, then returned the itag off the top of the stack. The best quality version of most youtube videos, which have both audio and video, is almost always 720p. Item 0 is usually 360p mp4, and sometimes it's even webm video only (no audio). So, defaulting to item 0 is far from reliable, and it's not necessary, as it's relatively trivial to simply filter and sort for the actual desired default (highest available quality with both audio and video streams). I've thought about making a pull request for my upgrades, and I might if anyone besides me cares about this sort of thing.

@redbrain
Copy link

The best quality version of most youtube videos, which have both audio and video, is almost always 720p.

That's surprising but great! Please consider submitting a PR; a higher base resolution, if reliable, would be a great addition.

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

No branches or pull requests

2 participants