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 format selection `vcodec=vp9` falsely selects HDR `vp9.2` #20882

Closed
ddelange opened this issue Apr 28, 2019 · 1 comment
Closed

Youtube format selection `vcodec=vp9` falsely selects HDR `vp9.2` #20882

ddelange opened this issue Apr 28, 2019 · 1 comment
Labels

Comments

@ddelange
Copy link

@ddelange ddelange commented Apr 28, 2019

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2019.04.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

Verbose log

youtube-dl -v -f "(bestvideo[vcodec=vp9,height<=2160]/bestvideo[vcodec!=vp9.2,height<=2160])+(bestaudio[acodec=opus]/bestaudio)/best[height<=2160]" -i https://www.youtube.com/watch?v=ESxIaJWUtAs
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-f', u'(bestvideo[vcodec=vp9,height<=2160]/bestvideo[vcodec!=vp9.2,height<=2160])+(bestaudio[acodec=opus]/bestaudio)/best[height<=2160]', u'-i', u'https://www.youtube.com/watch?v=ESxIaJWUtAs']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.04.24
[debug] Python version 2.7.13 (CPython) - Darwin-12.5.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.4.1, ffprobe 3.4.1
[debug] Proxy map: {}
[youtube] ESxIaJWUtAs: Downloading webpage
[youtube] ESxIaJWUtAs: Downloading video info webpage
[debug] Invoking downloader on u'https://r4---sn-4g5e6nl7.googlevideo.com/videoplayback?id=o-ACkzsVUz8QLa9sSimX2BFEXdZYr9i80PZA7wzv8jltYS&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C271%2C278%2C313%2C330%2C331%2C332%2C333%2C334%2C335%2C336%2C337&itag=337&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-4g5e6nl7%2Csn-5hnednlr&ms=au%2Conr&mv=m&pl=22&ei=9-PFXK7dDYKOgQfJp5OQCw&initcwndbps=1531250&mime=video%2Fwebm&gir=yes&clen=78146927&dur=29.695&lmt=1545380439738475&mt=1556472708&fvip=4&keepalive=yes&c=WEB&txp=2211222&ip=31.16.253.220&ipbits=0&expire=1556494423&sparams=ip%2Cipbits%2Cexpire%2Cid%2Caitags%2Csource%2Crequiressl%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cei%2Cinitcwndbps%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&signature=EE9DEAB8FCAFAF77834CBEDB55CCDA4D1C85099A.2DED8350EEEF8AF47A5A64B3D1CC6C581DF4D1E5&key=yt8&ratebypass=yes'
[download] Resuming download at byte 14517802
[download] Destination: Planet Earth II - Hummingbirds (HDR - 4K - 5.1)-ESxIaJWUtAs.f337.webm

Description

When trying to download videos from Youtube, I prefer using the vp9 video codec due to its size. However, HDR videos (vp9.2 codec) are of course much bigger, and are therefore unwanted. What I want is to download is the webm format (but not HDR), and mp4 format if webm is not available.

To achieve this, I want to use the format selection (for 2160p) "(bestvideo[vcodec=vp9,height<=2160]/bestvideo[vcodec!=vp9.2,height<=2160])+(bestaudio[acodec=opus]/bestaudio)/best[height<=2160]". But as can be seen above, this downloads 337 (vp9.2), while I exprected 313 (vp9). It looks like the vcodec= keyword does a simple 'contains', instead of an exact match, resulting in the wrong format being downloaded. When I remove the format selection up to the first /, the result is the same (337 being downloaded).

It gets even weirder: when I change the first 2160 to 1080, format 137 gets downloaded, which is not the expected (incorrect) 1080p HDR, but the 1080p mp4 (which is <=1080 yet avc1.640028 codec. Intended behaviour would be downloading 248 in this case.

What is going wrong here?

[info] Available formats for ESxIaJWUtAs:
format code  extension  resolution note
249          webm       audio only DASH audio   51k , opus @ 50k, 179.12KiB
250          webm       audio only DASH audio   67k , opus @ 70k, 236.21KiB
171          webm       audio only DASH audio  123k , vorbis@128k, 422.59KiB
140          m4a        audio only DASH audio  130k , m4a_dash container, mp4a.40.2@128k, 471.50KiB
251          webm       audio only DASH audio  134k , opus @160k, 470.61KiB
256          m4a        audio only DASH audio  196k , m4a_dash container, mp4a.40.5, 712.58KiB
258          m4a        audio only DASH audio  389k , m4a_dash container, mp4a.40.2, 1.38MiB
278          webm       256x144    144p   94k , webm container, vp9, 24fps, video only, 331.51KiB
160          mp4        256x144    144p  127k , avc1.4d400c, 24fps, video only, 445.23KiB
330          webm       256x144    144p HDR  132k , vp9.2, 24fps, video only, 390.57KiB
242          webm       426x240    240p  204k , vp9, 24fps, video only, 692.59KiB
331          webm       426x240    240p HDR  225k , vp9.2, 24fps, video only, 646.24KiB
133          mp4        426x240    240p  280k , avc1.4d4015, 24fps, video only, 970.33KiB
243          webm       640x360    360p  373k , vp9, 24fps, video only, 1.21MiB
332          webm       640x360    360p HDR  481k , vp9.2, 24fps, video only, 1.45MiB
134          mp4        640x360    360p  642k , avc1.4d401e, 24fps, video only, 1.97MiB
244          webm       854x480    480p  721k , vp9, 24fps, video only, 2.14MiB
333          webm       854x480    480p HDR  883k , vp9.2, 24fps, video only, 2.69MiB
135          mp4        854x480    480p 1291k , avc1.4d401e, 24fps, video only, 3.82MiB
247          webm       1280x720   720p 1409k , vp9, 24fps, video only, 4.05MiB
334          webm       1280x720   720p HDR 1986k , vp9.2, 24fps, video only, 6.38MiB
248          webm       1920x1080  1080p 2339k , vp9, 24fps, video only, 7.02MiB
136          mp4        1280x720   720p 2392k , avc1.4d401f, 24fps, video only, 7.01MiB
335          webm       1920x1080  1080p HDR 3583k , vp9.2, 24fps, video only, 11.72MiB
137          mp4        1920x1080  1080p 4160k , avc1.640028, 24fps, video only, 12.59MiB
271          webm       2560x1440  1440p 6741k , vp9, 24fps, video only, 20.09MiB
336          webm       2560x1440  1440p HDR 9840k , vp9.2, 24fps, video only, 31.60MiB
313          webm       3840x2160  2160p 12960k , vp9, 24fps, video only, 38.17MiB
337          webm       3840x2160  2160p HDR 22367k , vp9.2, 24fps, video only, 74.53MiB
18           mp4        640x360    medium , avc1.42001E, mp4a.40.2@ 96k, 2.46MiB
43           webm       640x360    medium , vp8.0, vorbis@128k, 2.96MiB
22           mp4        1280x720   hd720 , avc1.64001F, mp4a.40.2@192k (best)
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 28, 2019

Invalid syntax: each selector must be in separate brackets, not single brackets separated by ,.

@dstftw dstftw closed this Apr 28, 2019
@dstftw dstftw added the invalid label Apr 28, 2019
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.