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

Error number -22 occurred ( -f bestvideo+bestaudio ) #4264

Open
ericzutter opened this issue Nov 21, 2014 · 7 comments
Open

Error number -22 occurred ( -f bestvideo+bestaudio ) #4264

ericzutter opened this issue Nov 21, 2014 · 7 comments

Comments

@ericzutter
Copy link

@ericzutter ericzutter commented Nov 21, 2014

Highest resolution for video in example is "-f 18". Instead of downloading highest resolution, youtube-dl.exe with parameter "-f bestvideo+bestaudio" downloads a lower resolution and gives an error. How download highest resolution from all DASH formats and all NON DASH formats ?

C:>youtube-dl.exe -v -f bestvideo+bestaudio https://www.youtube.com/watch?v=25gWNvrRDPU
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-f', 'bestvideo+bestaudio', 'https://www.youtube.com/watch?v=25gWNvrRDPU']
[debug] Encodings: locale cp1252, fs mbcs, out cp65001, pref cp1252
[debug] youtube-dl version 2014.11.21
[debug] Python version 2.7.8 - Windows-7-6.1.7600
[debug] exe versions: ffmpeg N-62912-
[debug] Proxy map: {}
[youtube] Confirming age
[youtube] 25gWNvrRDPU: Downloading webpage
[youtube] 25gWNvrRDPU: Downloading video info webpage
[youtube] 25gWNvrRDPU: Extracting video information
[youtube] 25gWNvrRDPU: Downloading DASH manifest
[debug] Invoking downloader on 'https://r4---sn-oxv-25ge.googlevideo.com/videoplayback?id=db981636fad10cf5&itag=243&source=youtube&requiressl=yes&ms=au&mv=m&mm=31&ratebypass=yes&mime=video/webm&gir=yes&clen=11409245&lmt=1396846363846848&dur=309.709&sver=3&upn=ki5BIfeiROY&mt=1416569196&signature=8477E8EF370B5A718C66EC5227DB079E37A8A237.02B745A5B571E9F32B7E423529CB69DB2FD2C088&key=dg_yt0&fexp=907259,916641,917000,927622,932404,943909,945066,947209,947215,948124,951923,952302,952605,952901,953912,957103,957105,957201,958100&ip=46.253.172.132&ipbits=0&expire=1416590877&sparams=ip,ipbits,expire,id,itag,source,requiressl,ms,mv,mm,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: Aben wo ha Music (DADDY LUMBA)-25gWNvrRDPU.f243.webm
[download] 100% of 10.88MiB in 00:01
[debug] Invoking downloader on 'https://r4---sn-oxv-25ge.googlevideo.com/videoplayback?id=db981636fad10cf5&itag=141&source=youtube&requiressl=yes&ms=au&mv=m&mm=31&ratebypass=yes&mime=audio/mp4&gir=yes&clen=9894083&lmt=1389424415540199&dur=310.311&sver=3&upn=ki5BIfeiROY&mt=1416569196&signature=12D9281BBE5C450336E787EC9F20B3CBAC7AE2F4.4CA428F4A9ED30F8ADEC3EB6560E799E234B2921&key=dg_yt0&fexp=907259,916641,917000,927622,932404,943909,945066,947209,947215,948124,951923,952302,952605,952901,953912,957103,957105,957201,958100&ip=46.253.172.132&ipbits=0&expire=1416590877&sparams=ip,ipbits,expire,id,itag,source,requiressl,ms,mv,mm,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: Aben wo ha Music (DADDY LUMBA)-25gWNvrRDPU.f141.m4a
[download] 100% of 9.44MiB in 00:00
[ffmpeg] Merging formats into "Aben wo ha Music (DADDY LUMBA)-25gWNvrRDPU.webm"
[debug] ffmpeg command line: ffmpeg -y -i 'Aben wo ha Music (DADDY LUMBA)-25gWNvrRDPU.f243.webm' -i 'Aben wo ha Music (DADDY LUMBA)-25gWNvrRDPU.f141.m4a' -c copy -map 0✌️0 -map 1🅰️0 -shortest 'Aben wo ha Music (DADDY LUMBA)-25gWNvrRDPU.webm'
ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Error number -22 occurred
Traceback (most recent call last):
File "youtube_dl\YoutubeDL.pyo", line 1134, in post_process
File "youtube_dl\postprocessor\ffmpeg.pyo", line 523, in run
File "youtube_dl\postprocessor\ffmpeg.pyo", line 93, in run_ffmpeg_multiple_files
FFmpegPostProcessorError

@clampak
Copy link

@clampak clampak commented Nov 23, 2014

By specifying bestvideo+bestaudio, it grabs the best of each without the other and merges the two. The error you're getting is because the webm format can't have aac audio in it. This is documented in #3610.

Theoretically, if you just want to download the best quality, for this video only, then you could do:
youtube-dl -f 18+141 https://www.youtube.com/watch?v=25gWNvrRDPU

However, upon inspection this video is actually 352x240. That's the format 18.

@clb92
Copy link

@clb92 clb92 commented Feb 24, 2015

There's a new option available, which is relevant for you, in one of the newest versions of youtube-dl. You can use -f "bestvideo[ext=mp4]+bestaudio" to download the best mp4 video available.

@Tatsh
Copy link
Contributor

@Tatsh Tatsh commented Jun 15, 2015

Thanks @clb92. That is a great feature and unfortunately it is not documented on the manpage or help.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 15, 2015

@Tatsh
Copy link
Contributor

@Tatsh Tatsh commented Jun 15, 2015

@dstftw That link does not mention that one of the conditions is [ext=...]. Not all the conditions are documented. And youtube-dl -h | fgrep ext= outputs nothing. Now maybe you would not expect that in the --help text but I would certainly expect the format selection to be much more straightforward about valid syntax rather than giving some ideas via paragraphs. By comparison the Output Template section gives much more clear information by listing all possible values.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 15, 2015

@Tatsh it actually does

and for ext, acodec, vcodec, container, and protocol and the comparisons =, !=

It's not feasible to write an example for every combination of field and comparison.

@mpenkov
Copy link

@mpenkov mpenkov commented Sep 2, 2018

It looks like this issue is resolved, and may be closed.

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