--audio-format FORMAT ignored to download opus audio. Could not write header for output file #0 #19064

Closed
opened 2026-02-21 10:24:55 -05:00 by deekerman · 0 comments
Owner

Originally created by @Foxtrod89 on GitHub (Jan 8, 2020).

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.01.01
  • 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 --list-formats https://www.youtube.com/watch?v=4BDq_22PfWU&t=628s
[youtube] 4BDq_22PfWU: Downloading webpage
[youtube] 4BDq_22PfWU: Downloading video info webpage
[info] Available formats for 4BDq_22PfWU:
format code  extension  resolution note
249          webm       audio only tiny   51k , opus @ 50k (48000Hz), 31.25MiB
250          webm       audio only tiny   81k , opus @ 70k (48000Hz), 44.20MiB
251          webm       audio only tiny  133k , opus @160k (48000Hz), 74.26MiB
140          m4a        audio only tiny  135k , m4a_dash container, mp4a.40.2@128k (44100Hz), 87.77MiB
278          webm       256x144    144p   96k , webm container, vp9, 30fps, video only, 47.91MiB
160          mp4        256x144    144p  113k , avc1.4d400c, 30fps, video only, 40.44MiB
242          webm       426x240    240p  211k , vp9, 30fps, video only, 69.92MiB
133          mp4        426x240    240p  256k , avc1.4d4015, 30fps, video only, 94.52MiB
243          webm       640x360    360p  379k , vp9, 30fps, video only, 131.62MiB
134          mp4        640x360    360p  502k , avc1.4d401e, 30fps, video only, 183.92MiB
244          webm       854x480    480p  680k , vp9, 30fps, video only, 213.12MiB
135          mp4        854x480    480p  898k , avc1.4d401f, 30fps, video only, 333.53MiB
247          webm       1280x720   720p 1255k , vp9, 30fps, video only, 436.30MiB
136          mp4        1280x720   720p 1810k , avc1.4d401f, 30fps, video only, 686.32MiB
248          webm       1920x1080  1080p 2250k , vp9, 30fps, video only, 712.87MiB
137          mp4        1920x1080  1080p 3311k , avc1.640028, 30fps, video only, 1.29GiB
43           webm       640x360    360p , vp8.0, vorbis@128k, 400.22MiB
18           mp4        640x360    360p  393k , avc1.42001E, mp4a.40.2@ 96k (44100Hz), 266.68MiB
22           mp4        1280x720   720p 1140k , avc1.64001F, mp4a.40.2@192k (44100Hz) (best)

Description

I want to extract best OPUS based audio from Youtube.
For that i'm using:
--no-check-certificate --prefer-insecure --audio-format opus --extract-audio --postprocessor-args "-acodec libopus -b:a 64K" --external-downloader aria2c --external-downloader-args "-x16 -s16 -k1M"
It does work sometimes when you have m4a container as "best" audio stream, does work if you manually specify -format 251 which is overkill.
It doesn't work with for m4a_dash container as best possible audio stream.
I'm assuming because there is no way to demux opus from m4a_dash. Reported as bug due to switch --audio-format opus which will force youtubedl to get opus stream(best/worst???)

ENVIRONMENTS : Windows 7 x64, ffmpeg version N-71192-g3c91239, youtube-dl.exe
2020.01.01
OBSERVED RESULT: will not getting opus stream even with --audio-format opus
Could not write header for output file #0 - error pops up.
EXPECTED RESULT: will get opus stream.

Originally created by @Foxtrod89 on GitHub (Jan 8, 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.01.01. 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. - Read bugs section in FAQ: http://yt-dl.org/reporting - Finally, put x into all relevant boxes (like this [x]) --> - [x] I'm reporting a broken site support issue - [x] I've verified that I'm running youtube-dl version **2020.01.01** - [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 bug reports including closed ones - [x] I've read bugs section in FAQ ## 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.01.01 [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 --list-formats https://www.youtube.com/watch?v=4BDq_22PfWU&t=628s [youtube] 4BDq_22PfWU: Downloading webpage [youtube] 4BDq_22PfWU: Downloading video info webpage [info] Available formats for 4BDq_22PfWU: format code extension resolution note 249 webm audio only tiny 51k , opus @ 50k (48000Hz), 31.25MiB 250 webm audio only tiny 81k , opus @ 70k (48000Hz), 44.20MiB 251 webm audio only tiny 133k , opus @160k (48000Hz), 74.26MiB 140 m4a audio only tiny 135k , m4a_dash container, mp4a.40.2@128k (44100Hz), 87.77MiB 278 webm 256x144 144p 96k , webm container, vp9, 30fps, video only, 47.91MiB 160 mp4 256x144 144p 113k , avc1.4d400c, 30fps, video only, 40.44MiB 242 webm 426x240 240p 211k , vp9, 30fps, video only, 69.92MiB 133 mp4 426x240 240p 256k , avc1.4d4015, 30fps, video only, 94.52MiB 243 webm 640x360 360p 379k , vp9, 30fps, video only, 131.62MiB 134 mp4 640x360 360p 502k , avc1.4d401e, 30fps, video only, 183.92MiB 244 webm 854x480 480p 680k , vp9, 30fps, video only, 213.12MiB 135 mp4 854x480 480p 898k , avc1.4d401f, 30fps, video only, 333.53MiB 247 webm 1280x720 720p 1255k , vp9, 30fps, video only, 436.30MiB 136 mp4 1280x720 720p 1810k , avc1.4d401f, 30fps, video only, 686.32MiB 248 webm 1920x1080 1080p 2250k , vp9, 30fps, video only, 712.87MiB 137 mp4 1920x1080 1080p 3311k , avc1.640028, 30fps, video only, 1.29GiB 43 webm 640x360 360p , vp8.0, vorbis@128k, 400.22MiB 18 mp4 640x360 360p 393k , avc1.42001E, mp4a.40.2@ 96k (44100Hz), 266.68MiB 22 mp4 1280x720 720p 1140k , avc1.64001F, mp4a.40.2@192k (44100Hz) (best) ``` ## Description <!-- Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. 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. --> I want to extract best OPUS based audio from Youtube. For that i'm using: `--no-check-certificate --prefer-insecure --audio-format opus --extract-audio --postprocessor-args "-acodec libopus -b:a 64K" --external-downloader aria2c --external-downloader-args "-x16 -s16 -k1M"` It does work sometimes when you have **m4a** container as "best" audio stream, does work if you manually specify -format 251 which is overkill. It doesn't work with for **m4a_dash** container as best possible audio stream. I'm assuming because there is no way to demux opus from m4a_dash. Reported as bug due to switch *--audio-format opus* which will force youtubedl to get opus stream(best/worst???) ENVIRONMENTS : Windows 7 x64, ffmpeg version N-71192-g3c91239, youtube-dl.exe 2020.01.01 OBSERVED RESULT: will not getting opus stream even with --audio-format opus Could not write header for output file #0 - error pops up. EXPECTED RESULT: will get opus stream.
deekerman 2026-02-21 10:24:55 -05:00
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-ytdl-org#19064
No description provided.