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

yt-dl does not always pull the 'best' version by default, or even when commanded. #18203

Closed
LTIOfficial opened this Issue Nov 16, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@LTIOfficial
Copy link

LTIOfficial commented Nov 16, 2018

  • I've verified and I assure that I'm running youtube-dl 2018.11.07

  • 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

  • Bug report (encountered problems with youtube-dl)


It appears that yt-dl is not always pulling the 'best' version by default, or even when commanded.

# youtube-dl -F w7q6Nevfm_M
[youtube] w7q6Nevfm_M: Downloading webpage
[youtube] w7q6Nevfm_M: Downloading video info webpage
[youtube] w7q6Nevfm_M: Downloading MPD manifest
[youtube] w7q6Nevfm_M: Downloading MPD manifest
[info] Available formats for w7q6Nevfm_M:
format code  extension  resolution note
139          m4a        audio only DASH audio   53k , m4a_dash container, mp4a.40.5@ 48k (22050Hz), 5.85MiB
140          m4a        audio only DASH audio  132k , m4a_dash container, mp4a.40.2@128k (44100Hz), 15.59MiB
160          mp4        256x144    DASH video  108k , mp4_dash container, avc1.4d400b, 25fps, video only
133          mp4        426x240    DASH video  242k , mp4_dash container, avc1.4d400c, 25fps, video only
134          mp4        640x360    DASH video  274k , mp4_dash container, avc1.4d401e, 25fps, video only, 14.45MiB
136          mp4        1280x720   DASH video 1125k , mp4_dash container, avc1.4d401f, 25fps, video only, 57.78MiB
135          mp4        854x480    DASH video 1155k , mp4_dash container, avc1.4d4014, 25fps, video only
17           3gp        176x144    small , mp4v.20.3, mp4a.40.2@ 24k, 8.39MiB
36           3gp        320x180    small , mp4v.20.3, mp4a.40.2, 24.85MiB
18           mp4        640x360    medium , avc1.42001E, mp4a.40.2@ 96k, 42.89MiB
43           webm       640x360    medium , vp8.0, vorbis@128k, 46.31MiB
22           mp4        1280x720   hd720 , avc1.64001F, mp4a.40.2@192k (best)

For the longest time, I fully assumed that a command for a merged version of the 'best mp4' and 'best m4a' would produce an absolute 'best video possible' end result, but that's not the case here (or with many other videos).

# youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' w7q6Nevfm_M
[youtube] w7q6Nevfm_M: Downloading webpage
[youtube] w7q6Nevfm_M: Downloading video info webpage
[youtube] w7q6Nevfm_M: Downloading MPD manifest
[youtube] w7q6Nevfm_M: Downloading MPD manifest
[dashsegments] Total fragments: 202
[download] Destination: /files/public/ytdl/Peter Joseph 'Train of Thought' ZDay 2017-w7q6Nevfm_M**.f135**.mp4
[download] 100% of 34.89MiB in 02:52
[dashsegments] Total fragments: 207
[download] Destination: /files/public/ytdl/Peter Joseph 'Train of Thought' ZDay 2017-w7q6Nevfm_M**.f140**.m4a
[download] 100% of 15.59MiB in 00:27
[ffmpeg] Merging formats into "/files/public/ytdl/Peter Joseph 'Train of Thought' ZDay 2017-w7q6Nevfm_M.mp4"

According to the -F readout, .f136 is the 'best' separate video, not .f135. So why didn't it grab .f136 instead? Additionally, .f22 appears to have the best video and audio already in single-file form.

So I tested the defaults to see what it would grab:

# youtube-dl w7q6Nevfm_M
[youtube] w7q6Nevfm_M: Downloading webpage
[youtube] w7q6Nevfm_M: Downloading video info webpage
[youtube] w7q6Nevfm_M: Downloading MPD manifest
[youtube] w7q6Nevfm_M: Downloading MPD manifest
[dashsegments] Total fragments: 202
[download] Destination: /files/public/ytdl/Peter Joseph 'Train of Thought' ZDay 2017-w7q6Nevfm_M**.f135**.mp4
[download] 100% of 34.89MiB in 02:52
[dashsegments] Total fragments: 207
[download] Destination: /files/public/ytdl/Peter Joseph 'Train of Thought' ZDay 2017-w7q6Nevfm_M**.f140**.m4a
[download] 100% of 15.59MiB in 00:27
[ffmpeg] Merging formats into "/files/public/ytdl/Peter Joseph 'Train of Thought' ZDay 2017-w7q6Nevfm_M.mp4"

Same deal. It tries to grab the apparent 'second best' of the individual, separate components, fully ignoring the higher quality 'single-file' option that's available (.f22).

The only way to get the truly 'best' version of this, and many others, is to specifically call for it:

# youtube-dl -f 22 w7q6Nevfm_M
[youtube] w7q6Nevfm_M: Downloading webpage
[youtube] w7q6Nevfm_M: Downloading video info webpage
[youtube] w7q6Nevfm_M: Downloading MPD manifest
[youtube] w7q6Nevfm_M: Downloading MPD manifest
[download] Destination: /files/public/ytdl/Peter Joseph 'Train of Thought' ZDay 2017-w7q6Nevfm_M.mp4
[download] 100% of 143.21MiB in 00:27

The problem here is that automating the task (where there can be no review of the # youtube-dl -F xxxxxxxxx results ) becomes a bit of a crapshoot, where we end up with only 'some' of the videos satisfying the need for truly 'best' versions.

Is there a way to instruct yt-dl to make a determination of 'true best' by comparing the best complete video with the best individual components (i.e. make it a little smarter)?

@dstftw

This comment has been minimized.

Copy link
Collaborator

dstftw commented Nov 16, 2018

Bitrate is preferred over height.

@dstftw dstftw closed this Nov 16, 2018

@dstftw dstftw added the duplicate label Nov 16, 2018

@LTIOfficial

This comment has been minimized.

Copy link

LTIOfficial commented Nov 16, 2018

It appears to me that .f22 has the highest bitrate (mp4a.40.2@192k) compared to either of the audio-only options (mp4a.40.5@ 48k or mp4a.40.2@128k), while it's video component is HD720, as opposed to .f135's lesser 480 format. yt-dl also has .f22 marked as (best), but then ignores that when using the defaults.

Which is why I'm still asking:
Is there a way to instruct yt-dl to make a determination of 'true best' by comparing the best complete video with the best individual components (i.e. make it a little smarter)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment