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 -22 while ffmpeg muxing files on Windows 10 #24045

Closed
jbruchon opened this issue Feb 15, 2020 · 0 comments
Closed

Error -22 while ffmpeg muxing files on Windows 10 #24045

jbruchon opened this issue Feb 15, 2020 · 0 comments
Labels

Comments

@jbruchon
Copy link

@jbruchon jbruchon commented Feb 15, 2020

Checklist

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

[download] Downloading video 263 of 270
[youtube] 2tcJHbIKpRQ: Downloading webpage
[youtube] 2tcJHbIKpRQ: Downloading video info webpage
WARNING: video doesn't have subtitles
[debug] Default format spec: bestvideo+bestaudio/best
[info] Writing video description to: Kickstarter Crap - Skate 4D.description
[info] Writing video description metadata as JSON to: Kickstarter Crap - Skate 4D.info.json
[youtube] 2tcJHbIKpRQ: Downloading thumbnail ...
[youtube] 2tcJHbIKpRQ: Writing thumbnail to: Kickstarter Crap - Skate 4D.jpg
[debug] Invoking downloader on 'https://r2---sn-5ualdn7k.googlevideo.com/videoplayback?expire=1581757158&ei=hl5HXtmKIIGK4QSJjo2oBA&ip=47.134.10.147&id=o-AHZgckcsRc3sXF_ZvkcvuceK-YrkYPzmdE0TUr66S3-X&itag=398&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C394%2C395%2C396%2C397%2C398&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-5ualdn7k%2Csn-5uaeznde&ms=au%2Crdu&mv=m&mvi=1&pl=17&initcwndbps=1897500&vprv=1&mime=video%2Fmp4&gir=yes&clen=28768353&dur=593.926&lmt=1577763779639174&mt=1581735465&fvip=2&keepalive=yes&fexp=23842630%2C23878762&c=WEB&txp=5531432&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRQIhAMD_hIbiv8QU2LL2XLRUKq223CXpD3NWWqEzcgnqHfCVAiA2gbYYsR_k4bkMyz0sLDrOghbaHSAFb5b7pFTb95FLHg%3D%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIhAJbw5e35P74ek359CMdJQKQyduAquNy7ogaLRiO6bN3NAiBLgrsieEApmrNyaPvl7tChTKuV_lIJyzjGSQCuMhhAog%3D%3D&ratebypass=yes'
[download] Destination: Kickstarter Crap - Skate 4D.f398.mp4
[download] 100% of 27.44MiB in 00:02
[debug] Invoking downloader on 'https://r2---sn-5ualdn7k.googlevideo.com/videoplayback?expire=1581757158&ei=hl5HXtmKIIGK4QSJjo2oBA&ip=47.134.10.147&id=o-AHZgckcsRc3sXF_ZvkcvuceK-YrkYPzmdE0TUr66S3-X&itag=140&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-5ualdn7k%2Csn-5uaeznde&ms=au%2Crdu&mv=m&mvi=1&pl=17&initcwndbps=1897500&vprv=1&mime=audio%2Fmp4&gir=yes&clen=9615260&dur=594.059&lmt=1568582791435880&mt=1581735465&fvip=2&keepalive=yes&fexp=23842630%2C23878762&c=WEB&txp=5531432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRAIgfmxEXMdhWiCw0hrQbROE80VRFskjF1qqoAoSI_Rz4V4CIE1RwY2uX3CxrFVyowHczNFZ9R9kfBNmZrdr0BoWM8D9&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIhAJbw5e35P74ek359CMdJQKQyduAquNy7ogaLRiO6bN3NAiBLgrsieEApmrNyaPvl7tChTKuV_lIJyzjGSQCuMhhAog%3D%3D&ratebypass=yes'
[download] Destination: Kickstarter Crap - Skate 4D.f140.m4a
[download] 100% of 9.17MiB in 00:00
[ffmpeg] Merging formats into "Kickstarter Crap - Skate 4D.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:Kickstarter Crap - Skate 4D.f398.mp4" -i "file:Kickstarter Crap - Skate 4D.f140.m4a" -c copy -map "0:v:0" -map "1:a:0" "file:Kickstarter Crap - Skate 4D.temp.mp4"
ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Error number -22 occurred
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 2064, in post_process
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\postprocessor\ffmpeg.py", line 512, in run
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\postprocessor\ffmpeg.py", line 235, in run_ffmpeg_multiple_files
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: Could not write header for output file #0 (incorrect codec parameters ?): Error number -22 occurred

[ffmpeg] Adding metadata to 'Kickstarter Crap - Skate 4D.mp4'
ERROR: [WinError 2] The system cannot find the file specified: 'Kickstarter Crap - Skate 4D.mp4'
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 807, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 862, in process_ie_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 1643, in process_video_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 1999, in process_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\YoutubeDL.py", line 2064, in post_process
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\postprocessor\ffmpeg.py", line 498, in run
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\postprocessor\ffmpeg.py", line 210, in run_ffmpeg_multiple_files
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpw0w300z1\build\youtube_dl\postprocessor\ffmpeg.py", line 210, in <genexpr>
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'Kickstarter Crap - Skate 4D.mp4'

[download] Downloading video 264 of 270

Description

This does not appear to be a duplicate of #4906 or similar bugs; they all say "invalid argument" but error -22 appears to be: ERROR_BAD_COMMAND 22 (0x16) The device does not recognize the command.

When archiving entire channels, I sometimes find that a very small number of the downloaded videos will fail to mux during post-processing (in this case, 2 out of 270 are failing). The streams download and all of the output files are created, but the logs show a message about "incorrect codec parameters" with no real parameters, only a question mark. I did some sanity checks to make sure it wasn't something trivial that is not youtube-dl's fault:

D:\TEMP>icacls "Kickstarter Crap - Skate 4D.*"
Kickstarter Crap - Skate 4D.description Everyone:(F)
                                        BUILTIN\Administrators:(I)(F)
                                        NT AUTHORITY\SYSTEM:(I)(F)
                                        NT AUTHORITY\Authenticated Users:(I)(M)
                                        BUILTIN\Users:(I)(RX)

Kickstarter Crap - Skate 4D.f140.m4a Everyone:(F)
                                     BUILTIN\Administrators:(I)(F)
                                     NT AUTHORITY\SYSTEM:(I)(F)
                                     NT AUTHORITY\Authenticated Users:(I)(M)
                                     BUILTIN\Users:(I)(RX)

Kickstarter Crap - Skate 4D.f398.mp4 Everyone:(F)
                                     BUILTIN\Administrators:(I)(F)
                                     NT AUTHORITY\SYSTEM:(I)(F)
                                     NT AUTHORITY\Authenticated Users:(I)(M)
                                     BUILTIN\Users:(I)(RX)

Kickstarter Crap - Skate 4D.info.json Everyone:(F)
                                      BUILTIN\Administrators:(I)(F)
                                      NT AUTHORITY\SYSTEM:(I)(F)
                                      NT AUTHORITY\Authenticated Users:(I)(M)
                                      BUILTIN\Users:(I)(RX)

Kickstarter Crap - Skate 4D.jpg Everyone:(F)
                                BUILTIN\Administrators:(I)(F)
                                NT AUTHORITY\SYSTEM:(I)(F)
                                NT AUTHORITY\Authenticated Users:(I)(M)
                                BUILTIN\Users:(I)(RX)

Kickstarter Crap - Skate 4D.temp.mp4 Everyone:(F)
                                     BUILTIN\Administrators:(I)(F)
                                     NT AUTHORITY\SYSTEM:(I)(F)
                                     NT AUTHORITY\Authenticated Users:(I)(M)
                                     BUILTIN\Users:(I)(RX)

Successfully processed 6 files; Failed processing 0 files

D:\TEMP>attrib "Kickstarter Crap - Skate 4D.*"
A                    D:\TEMP\Kickstarter Crap - Skate 4D.description
A                    D:\TEMP\Kickstarter Crap - Skate 4D.f140.m4a
A                    D:\TEMP\Kickstarter Crap - Skate 4D.f398.mp4
A                    D:\TEMP\Kickstarter Crap - Skate 4D.info.json
A                    D:\TEMP\Kickstarter Crap - Skate 4D.jpg
A                    D:\TEMP\Kickstarter Crap - Skate 4D.temp.mp4

D:\TEMP>dir "Kickstarter Crap - Skate 4D.*"
 Volume in drive D is 256G_M2
 Volume Serial Number is 9C17-AE1B

 Directory of D:\TEMP

02/14/2020  09:59 PM               526 Kickstarter Crap - Skate 4D.description
09/15/2019  04:26 PM         9,615,260 Kickstarter Crap - Skate 4D.f140.m4a
12/30/2019  10:42 PM        28,768,353 Kickstarter Crap - Skate 4D.f398.mp4
02/14/2020  09:59 PM            35,832 Kickstarter Crap - Skate 4D.info.json
02/14/2020  09:59 PM            98,807 Kickstarter Crap - Skate 4D.jpg
02/14/2020  10:12 PM                28 Kickstarter Crap - Skate 4D.temp.mp4
               6 File(s)     38,518,806 bytes
               0 Dir(s)  147,627,507,712 bytes free

MediaInfo:

General
Complete name                            : D:\TEMP\Kickstarter Crap - Skate 4D.f140.m4a
Format                                   : dash
Codec ID                                 : dash (iso6/mp41)
File size                                : 9.17 MiB
Duration                                 : 9 min 54 s
Overall bit rate                         : 129 kb/s
Encoded date                             : UTC 2019-09-15 21:26:17
Tagged date                              : UTC 2019-09-15 21:26:17

Audio
ID                                       : 1
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 9 min 54 s
Bit rate                                 : 128 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 9.06 MiB (99%)
Title                                    : ISO Media file produced by Google Inc.
Language                                 : English
Encoded date                             : UTC 2019-09-15 21:26:17
Tagged date                              : UTC 2019-09-15 21:26:17

---

General
Complete name                            : D:\TEMP\Kickstarter Crap - Skate 4D.f398.mp4
Format                                   : dash
Codec ID                                 : dash (iso6/av01/mp41)
File size                                : 27.4 MiB
Duration                                 : 9 min 53 s
Overall bit rate                         : 388 kb/s
Encoded date                             : UTC 2019-12-31 03:28:52
Tagged date                              : UTC 2019-12-31 03:28:52

Video
ID                                       : 1
Format                                   : AV1
Format/Info                              : AOMedia Video 1
Format profile                           : Main@L3.1
Codec ID                                 : av01
Duration                                 : 9 min 53 s
Bit rate                                 : 385 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.014
Stream size                              : 27.3 MiB (99%)
Title                                    : ISO Media file produced by Google Inc.
Encoded date                             : UTC 2019-12-31 03:28:52
Tagged date                              : UTC 2019-12-31 03:28:52
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Codec configuration box                  : av1C

System is running Windows 10 Pro x64 build 1909.

@dstftw dstftw closed this Feb 15, 2020
@dstftw dstftw added the incomplete label Feb 15, 2020
@ytdl-org ytdl-org deleted a comment from jbruchon Mar 10, 2020
@ytdl-org ytdl-org locked and limited conversation to collaborators Mar 10, 2020
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
2 participants
You can’t perform that action at this time.