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 doesn't download youtube videos in proper resolution and format #20887

Closed
IoanPaleru opened this issue Apr 28, 2019 · 8 comments
Closed
Labels

Comments

@IoanPaleru
Copy link

@IoanPaleru IoanPaleru commented Apr 28, 2019

Hi, when trying to download these links: "https://www.youtube.com/watch?v=ezopeXwUukQ", "https://www.youtube.com/watch?v=1WjxBLgsQy8", and "https://www.youtube.com/watch?v=0DdPkt2QOKk" using the "-v --ignore-errors --format "best[ext=mp4][height<=720]" -o %(title)s.%(ext)s --cache-dir "C:\Users\Computer User\Music\youtube-dl and libav 11.3 files cache and downloads" --batch-file Files.txt" command, youtube-dl downloads them as 540x360 and 480x320 mp4, or 720x480 mkv files, but other youtube downloaders are able to download and convert those same files from the available streams as 720x480 mp4 files. It seems that issue is that youtube-dl isn't able to download and convert the proper available streams and merge them to create mp4 files, so is there a way to fix that? If other youtube downloaders can do that, then why can't youtube-dl? Thanks.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 28, 2019

Read FAQ on what does best mean.

@dstftw dstftw closed this Apr 28, 2019
@dstftw dstftw added the invalid label Apr 28, 2019
@IoanPaleru
Copy link
Author

@IoanPaleru IoanPaleru commented Apr 28, 2019

Hi, is there a way to merge all of these similar service requests: "#20831", "#20832", "#20887", and "#20888" into one service request? You provided me with the "--format "best[ext=mp4][height<=720]" command to use to download and convert files as 720p mp4 a while ago when I wanted help with that, because I didn't know which command to use. Everything was working fine and youtube-dl was able to download videos properly and convert them in that format until recently. Can you please tell me what command to use for youtube-dl to download videos in 720p (in this case, in the available 720x480 resolution), and mux the available streams using ffmpeg into an MP4 file? So far, I've only found out how to get youtube-dl to download the videos in the correct 720x480 available resolution, but it saves them as MKV files, and I want to find out how to get it to use ffmpeg to convert them to MP4 files. I'd really appreciate it, since the faq is very confusting for average computer users. Youtube-dl is a very good program by the way, once people know how to use it. Thank you.

@WolfganP
Copy link

@WolfganP WolfganP commented Apr 28, 2019

Use the -F param and see which formats are available for your video, then choose between availables

@IoanPaleru
Copy link
Author

@IoanPaleru IoanPaleru commented Apr 28, 2019

When using the --list-formats command, it says that there's a 720x480 MP4 video stream available. Up until recently, I was using the "--format "best[ext=mp4][height<=720]" command that dstftw gave me a while ago, and it was downloading and converting 720p mp4 files just fine, but now it isn't working anymore, it's only downloading 720x480 MKV files, or 540x360 and 480x320 MP4 files for these links: "https://www.youtube.com/watch?v=ezopeXwUukQ", "https://www.youtube.com/watch?v=1WjxBLgsQy8", and "https://www.youtube.com/watch?v=0DdPkt2QOKk". Other youtube downloaders can download and convert these files as 720x480 MP4 files just fine. What command do I use to get youtube-dl to download the 720x480 video stream, merge it with an m4a audio stream, and save it as an MP4 instead of an MKV? I'd appreciate some help if anyone knows how to do that. Let me know if you need more information. Thanks.

C:\Users\Computer User\Music\youtube-dl and libav 11.3 files cache and downloads>youtube-dl --list-formats https://www.youtube.com/watch?v=ezopeXwUukQ
[youtube] ezopeXwUukQ: Downloading webpage
[youtube] ezopeXwUukQ: Downloading video info webpage
[info] Available formats for ezopeXwUukQ:
format code extension resolution note
249 webm audio only DASH audio 59k , opus @ 50k, 3.18MiB
250 webm audio only DASH audio 76k , opus @ 70k, 4.14MiB
171 webm audio only DASH audio 122k , vorbis@128k, 7.17MiB
140 m4a audio only DASH audio 128k , m4a_dash container, mp4a.40.2@128k, 8.35MiB
251 webm audio only DASH audio 149k , opus @160k, 8.17MiB
278 webm 216x144 144p 83k , webm container, vp9, 30fps, video only, 4.97MiB
160 mp4 216x144 144p 103k , avc1.4d400c, 30fps, video only, 4.16MiB
242 webm 360x240 240p 194k , vp9, 30fps, video only, 9.73MiB
133 mp4 360x240 240p 210k , avc1.4d400d, 30fps, video only, 7.40MiB
243 webm 540x360 360p 357k , vp9, 30fps, video only, 17.27MiB
134 mp4 540x360 360p 547k , avc1.4d401e, 30fps, video only, 17.11MiB
244 webm 720x480 480p 643k , vp9, 30fps, video only, 29.90MiB
135 mp4 720x480 480p 1004k , avc1.4d401e, 30fps, video only, 34.16MiB
18 mp4 540x360 medium , avc1.42001E, mp4a.40.2@ 96k, 32.90MiB
43 webm 640x360 medium , vp8.0, vorbis@128k, 49.70MiB (best)

C:\Users\Computer User\Music\youtube-dl and libav 11.3 files cache and downloads>

C:\Users\Computer User\Music\youtube-dl and libav 11.3 files cache and downloads>youtube-dl -v --config-location "C:\Program Files (x86)\Internet\youtube-dl and libav 11.3 files"
[debug] System config: []
[debug] User config: []
[debug] Custom config: ['-v', '--ignore-errors', '--format', 'best[ext=mp4][height<=720]', '-o', '%(title)s.%(ext)s', '--cache-dir', 'C:\Users\Computer User\Music\youtube-dl and libav 11.3 files cache and downloads', '--batch-file', 'Files.txt', 'pause']
[debug] Command-line args: ['-v', '--config-location', 'C:\Program Files (x86)\Internet\youtube-dl and libav 11.3 files']
[debug] Batch file urls: ['https://www.youtube.com/watch?v=ezopeXwUukQ', 'https://www.youtube.com/watch?v=1WjxBLgsQy8', 'https://www.youtube.com/watch?v=0DdPkt2QOKk']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2019.04.24
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.17763
[debug] exe versions: avconv 11.3, avprobe 11.3, ffmpeg N-83657-g7e4f32f, ffprobe N-83657-g7e4f32f
[debug] Proxy map: {}
[youtube] ezopeXwUukQ: Downloading webpage
[youtube] ezopeXwUukQ: Downloading video info webpage
[debug] Invoking downloader on 'https://r5---sn-cxaaj5o5q5-tt1z.googlevideo.com/videoplayback?id=o-AF1Efwg2Vg-lCoPktcKp8sL2Eza8i1upti-fISS37SEp&itag=18&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-cxaaj5o5q5-tt1z%2Csn-t0a7sn7d&ms=au%2Conr&mv=m&pl=22&ei=ugrGXLmEM4bLigTHxZmwBA&initcwndbps=928750&mime=video%2Fmp4&gir=yes&clen=34498827&ratebypass=yes&dur=551.381&lmt=1539968193246002&mt=1556482608&fvip=3&c=WEB&txp=5431432&ip=142.116.175.243&ipbits=0&expire=1556504346&sparams=ip%2Cipbits%2Cexpire%2Cid%2Citag%2Csource%2Crequiressl%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cei%2Cinitcwndbps%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&signature=CC9D2E5940841D5803175F1ABDDFE65952045C32.6DF690CB04714FB4C732F9AF91F44409A578CB86&key=yt8'
[download] Destination: 'Inside 9_11' bonus program, 'Witness 9_11' - part 1 of 3.mp4
[download] 100% of 32.90MiB in 00:07
[youtube] 1WjxBLgsQy8: Downloading webpage
[youtube] 1WjxBLgsQy8: Downloading video info webpage
[debug] Invoking downloader on 'https://r2---sn-cxaaj5o5q5-tt1z.googlevideo.com/videoplayback?id=o-AAzvngnxObpEZN1G-3hHe43IrIzcWEJM0aH66JmvzGd0&itag=18&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-cxaaj5o5q5-tt1z%2Csn-t0a7sn7d&ms=au%2Conr&mv=m&pl=22&ei=xArGXKyYEtSsjASqnaWYDw&initcwndbps=928750&mime=video%2Fmp4&gir=yes&clen=45585911&ratebypass=yes&dur=642.635&lmt=1541085625971167&mt=1556482608&fvip=4&c=WEB&txp=5431432&ip=142.116.175.243&ipbits=0&expire=1556504356&sparams=ip%2Cipbits%2Cexpire%2Cid%2Citag%2Csource%2Crequiressl%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cei%2Cinitcwndbps%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&signature=0DBCCC220965124EC4977A02231DC04784629260.CFDF6B55CD5056C604F8D019351E3448516603CF&key=yt8'
[download] Destination: 'Inside 9_11' bonus program, 'Witness 9_11' - part 2 of 3.mp4
[download] 100% of 43.47MiB in 00:13
[youtube] 0DdPkt2QOKk: Downloading webpage
[youtube] 0DdPkt2QOKk: Downloading video info webpage
[debug] Invoking downloader on 'https://r4---sn-cxaaj5o5q5-tt1d.googlevideo.com/videoplayback?id=o-AJTL9SAnMh81rCBLrH7M-7fMEW2WI6rB2a78d3yY9KgM&itag=18&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-cxaaj5o5q5-tt1d%2Csn-t0a7sn7d&ms=au%2Conr&mv=m&pl=22&ei=0grGXLPZKdjXigSW4Y3ABw&initcwndbps=1085000&mime=video%2Fmp4&gir=yes&clen=51136589&ratebypass=yes&dur=638.316&lmt=1266052509160227&mt=1556482691&fvip=4&c=WEB&ip=142.116.175.243&ipbits=0&expire=1556504370&sparams=ip%2Cipbits%2Cexpire%2Cid%2Citag%2Csource%2Crequiressl%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cei%2Cinitcwndbps%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&signature=A623ACA5BCCCAE8FCC8328B3C516B5AAA4A3D91F.349D6E299BD8263C4332215EDA19DA9FCB7FB25B&key=yt8'
[download] Destination: 'Inside 9_11' bonus program, 'Witness 9_11' - part 3 of 3.mp4
[download] 100% of 48.77MiB in 00:09
ERROR: 'pause' is not a valid URL. Set --default-search "ytsearch" (or run youtube-dl "ytsearch:pause" ) to search YouTube
Traceback (most recent call last):
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp1l3rbf78\build\youtube_dl\YoutubeDL.py", line 796, in extract_info
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp1l3rbf78\build\youtube_dl\extractor\common.py", line 529, in extract
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp1l3rbf78\build\youtube_dl\extractor\generic.py", line 2227, in _real_extract
youtube_dl.utils.ExtractorError: 'pause' is not a valid URL. Set --default-search "ytsearch" (or run youtube-dl "ytsearch:pause" ) to search YouTube

C:\Users\Computer User\Music\youtube-dl and libav 11.3 files cache and downloads>

@WolfganP
Copy link

@WolfganP WolfganP commented Apr 29, 2019

That's your answer: 720x480 means width = 720, height = 480; "--format "best[ext=mp4][height<=720]" just fallback to get the best stream available below your criteria (format 135 = 480p)

@IoanPaleru
Copy link
Author

@IoanPaleru IoanPaleru commented Apr 29, 2019

I really appreciate your help, but that's not the issue. I know that 720x480 means 480p (width 720, height 480), and that 720p would be 1280x720 (width 1280, height 720), for example.

Using the "--format "best[ext=mp4][height<=720]" command, youtube-dl only downloads 540x360 or 480x320 MP4 files, but it used to be able to download a 720x480 MP4 file (if 720p wasn't available).

Using a different command, youtube-dl can download the available 720x480 file, but it only outputs it as an MKV instead of MP4 file with that resolution.

What youtube-dl's currently doing is either downloading a 720x480 file as an MKV, or only 540x360 or 480x320 as MP4 files. It looks like it might be using this stream: "244 webm 720x480 480p 643k , vp9, 30fps, video only, 29.90MiB", instead of this one: "135 mp4 720x480 480p 1004k , avc1.4d401e, 30fps, video only, 34.16MiB".

Do you know which command to use to get youtube-dl to download, convert, and mux either 720p (if it's available) or the next best available quality (which in this case is 480p), but output it as an MP4 instead of MKV file? Thanks.

@WolfganP
Copy link

@WolfganP WolfganP commented Apr 30, 2019

You have plenty of examples about format selection in https://github.com/ytdl-org/youtube-dl#format-selection , probably good to use the precedence operator '/' for controlled fallbacks. You may force what you want in your specific video as: -f 135+140 --merge-output-format mp4
Plus the program is also triggering an error as your last argument is 'pause'

@IoanPaleru
Copy link
Author

@IoanPaleru IoanPaleru commented Jun 10, 2019

Ok, thanks, but youtube-dl used to do all of that automatically and download and format videos in the correct resolutions with the command I was using.

@ytdl-org ytdl-org deleted a comment from vjmass Oct 20, 2019
@ytdl-org ytdl-org locked and limited conversation to collaborators Oct 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.