Youtube vide breaks after download FFmpegPostProcessorError: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument #19800

Closed
opened 2026-02-21 09:28:16 -05:00 by deekerman · 1 comment
Owner

Originally created by @Neo-7575 on GitHub (Mar 29, 2020).

Checklist

  • [ x] I'm reporting a broken site support
  • [ x] I've verified that I'm running youtube-dl version 2020.03.24
  • [ x] I've checked that all provided URLs are alive and playable in a browser
  • [ x] I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • [ x] I've searched the bugtracker for similar issues including closed ones

Verbose log

youtube-dl -v https://www.youtube.com/watch?v=F8Y797g_Jg4
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=F8Y797g_Jg4']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.03.24
[debug] Python version 2.7.12 (CPython) - Linux-4.4.0-142-generic-x86_64-with-LinuxMint-18.1-serena
[debug] exe versions: avconv 2.8.15, avprobe 2.8.15, ffmpeg 2.8.15, ffprobe 2.8.15
[debug] Proxy map: {}
[youtube] F8Y797g_Jg4: Downloading webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on u'https://r2---sn-u2oxu-bqol.googlevideo.com/videoplayback?expire=1585500623&ei=b32AXqWNC5fx7gPwmaqICw&ip=83.21.26.227&id=o-APURSk0Mq2vGobUXqIwaeqcd7LYX1UQ9XWk9CKp_X6Pu&itag=398&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C394%2C395%2C396%2C397%2C398&source=youtube&requiressl=yes&mh=e1&mm=31%2C29&mn=sn-u2oxu-bqol%2Csn-u2oxu-f5fe6&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=762500&vprv=1&mime=video%2Fmp4&gir=yes&clen=304138915&dur=4010.005&lmt=1580862799194825&mt=1585478913&fvip=2&keepalive=yes&fexp=23882513&c=WEB&txp=5531432&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ADKhkGMwRAIgEOm5YR-CMdx3RwTFshDGkqUW0HyJAffKT0-u4dYae1UCIDElsP2nhjR-ULHgefeN4yiRW1slNPefiDVCSaK_3agX&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=ABSNjpQwRQIgA3C4J2KPAaWZAjWWxagwZknMdGImD1343xeSC3NwXMwCIQDDGMl2VCJ9CVw9YmdtlVE1f-VvanALgy1KGp925cwMEw%3D%3D&ratebypass=yes'
[download] Destination: Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f398.mp4
[download] 100% of 290.05MiB in 03:38
[debug] Invoking downloader on u'https://r2---sn-u2oxu-bqol.googlevideo.com/videoplayback?expire=1585500623&ei=b32AXqWNC5fx7gPwmaqICw&ip=83.21.26.227&id=o-APURSk0Mq2vGobUXqIwaeqcd7LYX1UQ9XWk9CKp_X6Pu&itag=140&source=youtube&requiressl=yes&mh=e1&mm=31%2C29&mn=sn-u2oxu-bqol%2Csn-u2oxu-f5fe6&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=762500&vprv=1&mime=audio%2Fmp4&gir=yes&clen=64899123&dur=4010.062&lmt=1555995968467430&mt=1585478913&fvip=2&keepalive=yes&fexp=23882513&c=WEB&txp=5535432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ADKhkGMwRAIgGrP01xUF9o2dU-4S0GEV2dnnBao1eDJZjsHIkahY0boCIEq9qx2l1F6mPmemEmT5UaTAOJxxwaf-SWBo_uvuxx7A&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=ABSNjpQwRQIgA3C4J2KPAaWZAjWWxagwZknMdGImD1343xeSC3NwXMwCIQDDGMl2VCJ9CVw9YmdtlVE1f-VvanALgy1KGp925cwMEw%3D%3D&ratebypass=yes'
[download] Destination: Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f140.m4a
[download] 100% of 61.89MiB in 00:45
[ffmpeg] Merging formats into "Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f398.mp4' -i 'file:Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f140.m4a' -c copy -map '0✌️0' -map '1🅰️0' 'file:Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.temp.mp4'
ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2065, in post_process
files_to_delete, info = pp.run(info)
File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 512, in run
self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)
File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 235, in run_ffmpeg_multiple_files
raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

Description

instead of 1 video file I get 3 files

Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f140.m4a

Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f398.mp4

Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.temp.mp4

The video files don't look playable while .m4a contains audio only.

Only this video looks like its problematic to download, no other YT video shows this problem.

Theory:
the -- in the video title can mess up something that uses bash and even " -- " will not escape it can this be the problem?

The video is playable in the browser.

Originally created by @Neo-7575 on GitHub (Mar 29, 2020). <!-- ###################################################################### WARNING! IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE ###################################################################### --> ## Checklist <!-- Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl: - First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2020.03.24. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED. - Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser. - Make sure that all URLs and arguments with special characters are properly quoted or escaped as explained in http://yt-dl.org/escape. - Search the bugtracker for similar issues: http://yt-dl.org/search-issues. DO NOT post duplicates. - Finally, put x into all relevant boxes (like this [x]) --> - [ x] I'm reporting a broken site support - [ x] I've verified that I'm running youtube-dl version **2020.03.24** - [ x] I've checked that all provided URLs are alive and playable in a browser - [ x] I've checked that all URLs and arguments with special characters are properly quoted or escaped - [ x] I've searched the bugtracker for similar issues including closed ones ## Verbose log <!-- Provide the complete verbose output of youtube-dl that clearly demonstrates the problem. Add the `-v` flag to your command line you run youtube-dl with (`youtube-dl -v <your command line>`), copy the WHOLE output and insert it below. It should look similar to this: [debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj'] [debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251 [debug] youtube-dl version 2020.03.24 [debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2 [debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4 [debug] Proxy map: {} <more lines> --> youtube-dl -v https://www.youtube.com/watch?v=F8Y797g_Jg4 [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=F8Y797g_Jg4'] [debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2020.03.24 [debug] Python version 2.7.12 (CPython) - Linux-4.4.0-142-generic-x86_64-with-LinuxMint-18.1-serena [debug] exe versions: avconv 2.8.15, avprobe 2.8.15, ffmpeg 2.8.15, ffprobe 2.8.15 [debug] Proxy map: {} [youtube] F8Y797g_Jg4: Downloading webpage [debug] Default format spec: bestvideo+bestaudio/best [debug] Invoking downloader on u'https://r2---sn-u2oxu-bqol.googlevideo.com/videoplayback?expire=1585500623&ei=b32AXqWNC5fx7gPwmaqICw&ip=83.21.26.227&id=o-APURSk0Mq2vGobUXqIwaeqcd7LYX1UQ9XWk9CKp_X6Pu&itag=398&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C394%2C395%2C396%2C397%2C398&source=youtube&requiressl=yes&mh=e1&mm=31%2C29&mn=sn-u2oxu-bqol%2Csn-u2oxu-f5fe6&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=762500&vprv=1&mime=video%2Fmp4&gir=yes&clen=304138915&dur=4010.005&lmt=1580862799194825&mt=1585478913&fvip=2&keepalive=yes&fexp=23882513&c=WEB&txp=5531432&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ADKhkGMwRAIgEOm5YR-CMdx3RwTFshDGkqUW0HyJAffKT0-u4dYae1UCIDElsP2nhjR-ULHgefeN4yiRW1slNPefiDVCSaK_3agX&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=ABSNjpQwRQIgA3C4J2KPAaWZAjWWxagwZknMdGImD1343xeSC3NwXMwCIQDDGMl2VCJ9CVw9YmdtlVE1f-VvanALgy1KGp925cwMEw%3D%3D&ratebypass=yes' [download] Destination: Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f398.mp4 [download] 100% of 290.05MiB in 03:38 [debug] Invoking downloader on u'https://r2---sn-u2oxu-bqol.googlevideo.com/videoplayback?expire=1585500623&ei=b32AXqWNC5fx7gPwmaqICw&ip=83.21.26.227&id=o-APURSk0Mq2vGobUXqIwaeqcd7LYX1UQ9XWk9CKp_X6Pu&itag=140&source=youtube&requiressl=yes&mh=e1&mm=31%2C29&mn=sn-u2oxu-bqol%2Csn-u2oxu-f5fe6&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=762500&vprv=1&mime=audio%2Fmp4&gir=yes&clen=64899123&dur=4010.062&lmt=1555995968467430&mt=1585478913&fvip=2&keepalive=yes&fexp=23882513&c=WEB&txp=5535432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ADKhkGMwRAIgGrP01xUF9o2dU-4S0GEV2dnnBao1eDJZjsHIkahY0boCIEq9qx2l1F6mPmemEmT5UaTAOJxxwaf-SWBo_uvuxx7A&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=ABSNjpQwRQIgA3C4J2KPAaWZAjWWxagwZknMdGImD1343xeSC3NwXMwCIQDDGMl2VCJ9CVw9YmdtlVE1f-VvanALgy1KGp925cwMEw%3D%3D&ratebypass=yes' [download] Destination: Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f140.m4a [download] 100% of 61.89MiB in 00:45 [ffmpeg] Merging formats into "Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.mp4" [debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f398.mp4' -i 'file:Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f140.m4a' -c copy -map '0:v:0' -map '1:a:0' 'file:Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.temp.mp4' ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Traceback (most recent call last): File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2065, in post_process files_to_delete, info = pp.run(info) File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 512, in run self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args) File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 235, in run_ffmpeg_multiple_files raise FFmpegPostProcessorError(msg) FFmpegPostProcessorError: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument ## Description <!-- Provide an explanation of your issue in an arbitrary form. Provide any additional information, suggested solution and as much context and examples as possible. If work on your issue requires account credentials please provide them or explain how one can obtain them. --> instead of 1 video file I get 3 files Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f140.m4a Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.f398.mp4 Tip Toland Workshop -- Sculpting a Clay Head - Free Tutorial-F8Y797g_Jg4.temp.mp4 The video files don't look playable while .m4a contains audio only. Only this video looks like its problematic to download, no other YT video shows this problem. Theory: the -- in the video title can mess up something that uses bash and even " -- " will not escape it can this be the problem? The video is playable in the browser.
deekerman 2026-02-21 09:28:16 -05:00
  • closed this issue
  • added the
    invalid
    label
Author
Owner

@dstftw commented on GitHub (Mar 29, 2020):

Outdated ffmpeg.

@dstftw commented on GitHub (Mar 29, 2020): Outdated ffmpeg.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#19800
No description provided.