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] "bestvideo" doesn't choose the actual best video in rare cases #12198

Closed
fireattack opened this issue Feb 20, 2017 · 3 comments
Closed

[YouTube] "bestvideo" doesn't choose the actual best video in rare cases #12198

fireattack opened this issue Feb 20, 2017 · 3 comments
Labels

Comments

@fireattack
Copy link

@fireattack fireattack commented Feb 20, 2017

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 that [x])
  • Use Preview tab to see how your issue will actually look like

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

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

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

D:\YouTube>youtube-dl https://www.youtube.com/watch?v=iMhwshjSauo -v -F
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=iMhwshjSauo', '-v',
 '-F']
[debug] Encodings: locale cp936, fs mbcs, out cp936, pref cp936
[debug] youtube-dl version 2017.02.17
[debug] Python version 3.4.4 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-83133-ge664730
[debug] Proxy map: {}
[youtube] iMhwshjSauo: Downloading webpage
[youtube] iMhwshjSauo: Downloading video info webpage
[youtube] iMhwshjSauo: Extracting video information
[youtube] {43} signature length 82.1.0, html5 player en_US-vflg9Wu9U
[youtube] {18} signature length 82.1.0, html5 player en_US-vflg9Wu9U
[youtube] {36} signature length 82.1.0, html5 player en_US-vflg9Wu9U
[youtube] {17} signature length 82.1.0, html5 player en_US-vflg9Wu9U
[youtube] iMhwshjSauo: Downloading MPD manifest
[info] Available formats for iMhwshjSauo:
format code  extension  resolution note
140          m4a        audio only DASH audio  129k , m4a_dash container, mp4a.4
0.2@128k (44100Hz)
134          mp4        540x360    DASH video  106k , avc1.4d401e, 30fps, video
only
160          mp4        216x144    DASH video  108k , avc1.4d400b, 30fps, video
only
135          mp4        720x480    DASH video  198k , avc1.4d401e, 30fps, video
only
133          mp4        360x240    DASH video  242k , avc1.4d400c, 30fps, video
only
17           3gp        176x144    small , mp4v.20.3, mp4a.40.2@ 24k
36           3gp        320x214    small , mp4v.20.3, mp4a.40.2
18           mp4        540x360    medium , avc1.42001E, mp4a.40.2@ 96k
43           webm       640x360    medium , vp8.0, vorbis@128k (best)

Description of your issue, suggested solution and other information

It seems the bestvideo option purely chooses the format based on the bitrate. However, in rare cases, a higher quality/resolution video may have lower bitrates.

In this very example (note: video may not be available in the US), since the video is a still frame, the 480p DASH video ended up with only 198 kbps, while the 240p DASH video became 242 kbps, albeit having lower quality. And as a result, the bestvideo parameter chose the latter instead of the former that has better quality.

I think it's better to use resolution as an indicator of quality. At least on YouTube (IIRC), a higher resolution DASH video will always have better quality and is closer to the original file, since YouTube doesn't upscale videos.

@dstftw dstftw closed this Feb 20, 2017
@dstftw dstftw added the duplicate label Feb 20, 2017
@fireattack
Copy link
Author

@fireattack fireattack commented Feb 20, 2017

Wait a sec, something is weirder than I thought.

D:\YouTube>youtube-dl https://www.youtube.com/watch?v=iMhwshjSauo -f 135
[youtube] iMhwshjSauo: Downloading webpage
[youtube] iMhwshjSauo: Downloading video info webpage
[youtube] iMhwshjSauo: Extracting video information
[youtube] iMhwshjSauo: Downloading MPD manifest
[dashsegments] Total fragments: 45
[download] Destination: CoCo - はんぶん不思議 (CoCo1番!)-iMhwshjSauo.mp4
[download] 100% of 3.18MiB in 00:38

D:\YouTube>youtube-dl https://www.youtube.com/watch?v=iMhwshjSauo -f bestvideo
[youtube] iMhwshjSauo: Downloading webpage
[youtube] iMhwshjSauo: Downloading video info webpage
[youtube] iMhwshjSauo: Extracting video information
[youtube] iMhwshjSauo: Downloading MPD manifest
[dashsegments] Total fragments: 45
[download] Destination: CoCo - はんぶん不思議 (CoCo1番!)-iMhwshjSauo.mp4
[download] 100% of 973.70KiB in 00:33

As you can see here, the "bestvideo" (133 mp4 360x240 one) is only 973.70KiB. Its actual bitrate is 32.2 kbps (reported by mediainfo).

And the 480p one has a filesize of 3.18MiB, with actual bitrate 112 kbps.

So in short, all these bitrates are wrong to begin with.

@Hrxn
Copy link

@Hrxn Hrxn commented Feb 20, 2017

Not necessarily wrong..

A better (i.e. more efficient) video encoding allows the same quality with a much lower bitrate, that's the point.

@fireattack
Copy link
Author

@fireattack fireattack commented Feb 20, 2017

Not necessarily, yeah. But in this particular case, the problem is bitrate is totally wrong to begin with

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.