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-dl not selecting best format #5769

Closed
2011 opened this issue May 21, 2015 · 2 comments
Closed

youtube-dl not selecting best format #5769

2011 opened this issue May 21, 2015 · 2 comments

Comments

@2011
Copy link

@2011 2011 commented May 21, 2015

https://www.youtube.com/watch?v=pyUCR-Sfenc is no longer a live video (5754), but....

youtube-dl -F 'https://www.youtube.com/watch?v=pyUCR-Sfenc'
[youtube] pyUCR-Sfenc: Downloading webpage
[youtube] pyUCR-Sfenc: Extracting video information
[youtube] pyUCR-Sfenc: Downloading DASH manifest
[info] Available formats for pyUCR-Sfenc:
format code extension resolution note
171 webm audio only DASH audio 139k , audio@128k (44100Hz), 159.52MiB
140 m4a audio only DASH audio 139k , m4a_dash container, aac @128k (44100Hz), 185.59MiB
141 m4a audio only DASH audio 267k , m4a_dash container, aac @256k (44100Hz), 372.56MiB
160 mp4 256x144 DASH video 154k , 13fps, video only, 157.25MiB
278 webm 256x144 DASH video 178k , webm container, VP9, 13fps, video only, 145.32MiB
133 mp4 426x240 DASH video 288k , 25fps, video only, 352.05MiB
242 webm 426x240 DASH video 374k , 25fps, video only, 311.60MiB
134 mp4 640x360 DASH video 629k , 25fps, video only, 776.31MiB
243 webm 640x360 DASH video 641k , 25fps, video only, 591.01MiB
244 webm 854x480 DASH video 1115k , 25fps, video only, 1.05GiB
135 mp4 854x480 DASH video 1146k , 25fps, video only, 1.42GiB
136 mp4 1280x720 DASH video 2268k , 25fps, video only, 2.80GiB
247 webm 1280x720 DASH video 2309k , 25fps, video only, 2.16GiB
17 3gp 176x144
36 3gp 320x240
5 flv 400x240
43 webm 640x360
18 mp4 640x360
22 mp4 1280x720 (best)

$ youtube-dl 'https://www.youtube.com/watch?v=pyUCR-Sfenc'
[youtube] pyUCR-Sfenc: Downloading webpage
[youtube] pyUCR-Sfenc: Extracting video information
[youtube] pyUCR-Sfenc: Downloading DASH manifest
WARNING: You have requested formats incompatible for merge. The formats will be merged into mkv
[download] Destination: title_altered_by_me.f247.webm
[download] 100% of 2.16GiB in 32:07
[download] Destination: title_altered_by_me.f141.m4a
[download] 100% of 372.56MiB in 05:24
[ffmpeg] Merging formats into "title_altered_by_me.mkv"
Deleting original file title_altered_by_me.f247.webm (pass -k to keep)
Deleting original file title_altered_by_me.f141.m4a (pass -k to keep)

Not sure if I am a fan of (what seems of be the strategy now) getting the best audio and best video and merging them (although that does work for a large percentage of videos), but choosing webm video over an equal resolution mp4 can never be right. The "old" best format, is still quite a bit better than either of them, though:

$ youtube-dl -f 22 'https://www.youtube.com/watch?v=pyUCR-Sfenc'
[youtube] pyUCR-Sfenc: Downloading webpage
[youtube] pyUCR-Sfenc: Extracting video information
[youtube] pyUCR-Sfenc: Downloading DASH manifest
[download] Destination: title_altered_by_me.mp4
[download] 100% of 3.92GiB in 56:48

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 21, 2015

but choosing webm video over an equal resolution mp4 can never be right

webm has higher bitrate.
Apart from this particular case (higher bitrate of video in 22 than bestvideo, however lower bitrate of audio than in bestaudio), old-best-format is usually worse than -f bestvideo+bestaudio, both video and audio streams. Moreover non DASH videos provide not so much metadata to guess quality beforehand to compare with DASH. You can always force old behaviour with -f best.

@dstftw dstftw closed this May 21, 2015
@2011
Copy link
Author

@2011 2011 commented May 22, 2015

@dstftw thanks for the reply.

I understand that the non-DASH videos don't have as much metadata, which can make quality comparisons (without actually downloading the files) impractical.

I was looking at the file sizes as a proxy for bitrate, so I missed that the webm (247) supposedly has a slightly higher bitrate than the similar mp4 (136). What I am missing (especially in this case), is a comprehension of how the mp4 can be almost a third larger and yet have a lower bitrate.

My understanding is that bitrate is simply file size (in bytes) divided by duration (in seconds) times eight, so the larger file must have a higher bitrate.

I don't know what data youtube-dl gets from youtube, and what it computes, but something seems wrong to me somewhere.

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