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

-f bestvideo doesn't always download best quality video from Youtube. #24655

Closed
ilovelinux opened this issue Apr 6, 2020 · 3 comments
Closed

-f bestvideo doesn't always download best quality video from Youtube. #24655

ilovelinux opened this issue Apr 6, 2020 · 3 comments

Comments

@ilovelinux
Copy link

@ilovelinux ilovelinux commented Apr 6, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.03.24
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Description

Video: https://www.youtube.com/watch?v=GTcM7ydgAwo
Command: youtube-dl -f bestvideo https://www.youtube.com/watch?v=GTcM7ydgAwo

Today I was downloading that video from Youtube. I thought that -f bestvideo would have considered the video encoding but it doesn't seem to do it. In fact that video has a lot of differen formats but we will focus on the best two:

248          webm       1920x1080  1080p 2642k , vp9, 30fps, video only, 89.18MiB
137          mp4        1920x1080  1080p 4330k , avc1.640028, 30fps, video only, 82.31MiB

Webm has lower bitrate because it uses vp9 and it should be bettter than 137 but youtube-dl chose 137.

I would expect -f bestvideo to choose the webm since it's heavier and it's encoded with vp9 instead of mp4.

@Hrxn
Copy link

@Hrxn Hrxn commented Apr 7, 2020

You must put something like this into your youtube-dl.conf:

--format "(bestvideo[vcodec=vp9.2]/bestvideo[vcodec=vp9][fps>30]/bestvideo[vcodec=vp9][height>=1080]/bestvideo[fps>30]/bestvideo[height>720])+(bestaudio[acodec=opus]/bestaudio)/best"

This enforces preference for VP9

Edit

I would expect -f bestvideo to choose the webm since it's heavier and it's encoded with vp9 instead of mp4.

You're obviously right, but just look at the two listed formats in your example above. Compare file size and bitrate, this does not make really sense, but that's what is returned by YT. Apparently not always correct.

@ilovelinux
Copy link
Author

@ilovelinux ilovelinux commented Apr 7, 2020

I did know how to force vp9 codec, I was just reporting that even if VP9 encoded file is smaller and has lower bitrate, should be preferred to AV1. Thank you anyway!

@Hrxn
Copy link

@Hrxn Hrxn commented Apr 8, 2020

Preferred to MP4/AVC you mean?

But otherwise I agree, the automatic format selection should maybe updated so that VP9 takes precedence, after all it's the preferred format by YouTube as well, and while transition has been slow, it's the better optimized format for now..

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.