Repository: yt-dlp
Issue: [YouTube] embed-metadata causes conversion failed in some videos. "Could not find tag for codec eac3"
Labels: bug,external issue,site:youtube,core:post-processor

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting that yt-dlp is broken on a **supported** site
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [ ] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

_No response_

### Provide a description that is worded well enough to be understood

Some videos when extract audio and embed metadata are used will give the error "conversion failed". The audio file is still downloaded at least, but it leaves files behind (such as the temp file and the thumbnail file), and the audio file will fail to have any metadata. This doesn't happen when I try to download a video.

It only happens on these videos
https://youtu.be/1SEgoi7kjw8
https://youtu.be/VKzWLUQizz8
https://youtu.be/TNEQ2Z0cjh4 (mild nsfw?)

This issue is a problem to me because I run yt-dlp automatically on a daily basis. It archives many of my music playlists and channels I watch. I can't always manually moderate the files I am downloading to ensure they are all being downloaded properly. It would be nice to have a workaround that doesn't involve removing the metadata option, or adding to my script "rm *.webp". I mainly want to keep the title and artist
Thankfully, it seems that those are actually the only videos where I have this issue.
This issue might be relevant to #4838 #11020 and #9303

What stands out from the logs
```
[ipod @ 0x5b29100353c0] Could not find tag for codec eac3 in stream #0, codec not currently supported in container
[out#0/ipod @ 0x5b2910037940] Could not write header (incorrect codec parameters ?): Invalid argument
Conversion failed!
```

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-vU', '--embed-metadata', '-x', '1SEgoi7kjw8']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.09.27 from yt-dlp/yt-dlp [c6387abc1]
[debug] Python 3.12.6 (CPython x86_64 64bit) - Linux-6.10.10-zen1-1-zen-x86_64-with-glibc2.40 (OpenSSL 3.3.2 3 Sep 2024, glibc 2.40)
[debug] exe versions: ffmpeg 7.0.2 (setts), ffprobe 7.0.2, rtmpdump 2.4
[debug] Optional libraries: brotli-1.1.0, certifi-2024.08.30, mutagen-1.47.0, pycrypto-3.20.0, requests-2.32.3, sqlite3-3.46.1, urllib3-1.26.20
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests
[debug] Loaded 1838 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.09.27 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.09.27 from yt-dlp/yt-dlp)
[youtube] Extracting URL: 1SEgoi7kjw8
[youtube] 1SEgoi7kjw8: Downloading webpage
[youtube] 1SEgoi7kjw8: Downloading ios player API JSON
[youtube] 1SEgoi7kjw8: Downloading web creator player API JSON
[debug] [youtube] Extracting signature function js_b0557ce3_113
[debug] Loading youtube-sigfuncs.js_b0557ce3_113 from cache
[debug] Loading youtube-nsig.b0557ce3 from cache
[debug] [youtube] Decrypted nsig oMghXuigoqF5lfDZr => yB19ty6QSdYr_g
[debug] Loading youtube-nsig.b0557ce3 from cache
[debug] [youtube] Decrypted nsig hAQsDVvSczaXJOm2G => W7aMiJw1WoQhFQ
[debug] [youtube] Extracting signature function js_b0557ce3_109
[debug] Loading youtube-sigfuncs.js_b0557ce3_109 from cache
[youtube] 1SEgoi7kjw8: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[info] 1SEgoi7kjw8: Downloading 1 format(s): 328
[debug] Invoking http downloader on "https://rr1---sn-n02xgoxufvg3-2gb6.googlevideo.com/videoplayback?expire=1727592400&ei=cKP4Zo-aONXIi9oP5-rUqAU&ip=185.246.210.17&id=o-AByJSTMm8WXnoTKwZPjvKd4Y7DKvmZQQSXDsviBR-wqE&itag=328&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=dd&mm=31%2C29&mn=sn-n02xgoxufvg3-2gb6%2Csn-4g5lznl7&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=693750&bui=AXLXGFQPpjzHbd9oBGqAhxseFPb9y00zU16oDP6rsDx5GLQxC5ADhVvOttcdXlF2TE_GXInlutV-V4xn&spc=54MbxTwfCJvktICLHHVxraWu5Eau_jz7H97C67AiGNZHSzGhpnzY&vprv=1&svpuc=1&mime=audio%2Fmp4&ns=EspYaqKJ7Jgq_kTKc62DzaEQ&rqh=1&gir=yes&clen=12734232&dur=265.216&lmt=1710115319472727&mt=1727570471&fvip=4&keepalive=yes&fexp=51299152%2C51300761&c=WEB_CREATOR&sefc=1&txp=4432434&n=W7aMiJw1WoQhFQ&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=ABPmVW0wRQIgDiVE46SaLa4krGd4ZNjSVl_qw7kQMppIKEPWL47UJ6MCIQDnGf6y1JUh9ji0Te0woQH8EMXx8qwMWCO_G2w36pV41Q%3D%3D&sig=AJfQdSswRAIgPUQ9ii7r7ECEF7hJFjOO8xkOG6t7r0c95W9WnwPaWBMCIH22fvjEXB20PTBaAC1UML4DfxvdY5tc43Q_-1iSRX9Z"
[download] Justice - Waters Of Nazareth - † (Official Audio) [1SEgoi7kjw8].m4a has already been downloaded
[download] 100% of   12.14MiB
[ExtractAudio] Not converting audio Justice - Waters Of Nazareth - † (Official Audio) [1SEgoi7kjw8].m4a; the file is already in a common audio format
[Metadata] Adding metadata to "Justice - Waters Of Nazareth - † (Official Audio) [1SEgoi7kjw8].m4a"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Justice - Waters Of Nazareth - † (Official Audio) [1SEgoi7kjw8].m4a' -map 0 -dn -ignore_unknown -vn -acodec copy -write_id3v1 1 -metadata 'title=Justice - Waters Of Nazareth - † (Official Audio)' -metadata date=20121207 -metadata 'description=“HYPERDRAMA” new album pre-save: https://justice.lnk.to/hyperdramayo
Justice “One Night/All Night” (Starring Tame Impala) out now: https://justice.lnk.to/onanyo 
//
 Taken from the album “†” available on all platforms: https://BecauseMusic.lnk.to/Justice
Subscribe to the channel: http://bit.ly/JusticeChannel 
Listen to the essentials from Justice here: https://lnk.to/JusticeEssentials
 
Justice : Gaspard Augé and Xavier de Rosnay
 
Official website → https://justice.church
 
Follow Justice:
Facebook: http://facebook.com/etjusticepourtous
Instagram: http://instagram.com/etjusticepourtous 

© 2007 Ed Banger Records / Because Music

#Justice' -metadata 'synopsis=“HYPERDRAMA” new album pre-save: https://justice.lnk.to/hyperdramayo
Justice “One Night/All Night” (Starring Tame Impala) out now: https://justice.lnk.to/onanyo 
//
 Taken from the album “†” available on all platforms: https://BecauseMusic.lnk.to/Justice
Subscribe to the channel: http://bit.ly/JusticeChannel 
Listen to the essentials from Justice here: https://lnk.to/JusticeEssentials
 
Justice : Gaspard Augé and Xavier de Rosnay
 
Official website → https://justice.church
 
Follow Justice:
Facebook: http://facebook.com/etjusticepourtous
Instagram: http://instagram.com/etjusticepourtous 

© 2007 Ed Banger Records / Because Music

#Justice' -metadata 'purl=https://www.youtube.com/watch?v=1SEgoi7kjw8' -metadata 'comment=https://www.youtube.com/watch?v=1SEgoi7kjw8' -metadata artist=Justice -metadata:s:0 language=eng -movflags +faststart 'file:Justice - Waters Of Nazareth - † (Official Audio) [1SEgoi7kjw8].temp.m4a'
[debug] ffmpeg version n7.0.2 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 14.2.1 (GCC) 20240910
  configuration: --prefix=/usr --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-libfontconfig --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan --enable-alsa --enable-bzlib --enable-iconv --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-lzma --enable-sdl2 --enable-xlib --enable-zlib --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-v4l2-m2m --enable-vaapi --enable-vdpau --enable-librist --enable-lto --enable-libsvtav1 --enable-libvmaf --enable-cuda-llvm --disable-cuvid --disable-debug --disable-sndio
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:Justice - Waters Of Nazareth - † (Official Audio) [1SEgoi7kjw8].m4a':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomdby1iso2mp41
    encoder         : Lavf61.1.100
  Duration: 00:04:25.22, start: 0.000000, bitrate: 384 kb/s
  Stream #0:0[0x1](und): Audio: eac3 (ec-3 / 0x332D6365), 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
      Metadata:
        handler_name    : ISO Media file produced by Google Inc.
        vendor_id       : [0][0][0][0]
      Side data:
        audio service type: main
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
[ipod @ 0x589b513873c0] Could not find tag for codec eac3 in stream #0, codec not currently supported in container
[out#0/ipod @ 0x589b51389940] Could not write header (incorrect codec parameters ?): Invalid argument
Conversion failed!

ERROR: Postprocessing: Conversion failed!
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/yt_dlp/YoutubeDL.py", line 3561, in process_info
    replace_info_dict(self.post_process(dl_filename, info_dict, files_to_move))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/yt_dlp/YoutubeDL.py", line 3743, in post_process
    info = self.run_all_pps('post_process', info, additional_pps=info.get('__postprocessors'))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/yt_dlp/YoutubeDL.py", line 3725, in run_all_pps
    info = self.run_pp(pp, info)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/yt_dlp/YoutubeDL.py", line 3703, in run_pp
    files_to_delete, infodict = pp.run(infodict)
                                ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/yt_dlp/postprocessor/common.py", line 23, in run
    ret = func(self, info, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/yt_dlp/postprocessor/common.py", line 128, in wrapper
    return func(self, info)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/yt_dlp/postprocessor/ffmpeg.py", line 712, in run
    self.run_ffmpeg_multiple_files(
  File "/usr/lib/python3.12/site-packages/yt_dlp/postprocessor/ffmpeg.py", line 330, in run_ffmpeg_multiple_files
    return self.real_run_ffmpeg(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/yt_dlp/postprocessor/ffmpeg.py", line 368, in real_run_ffmpeg
    raise FFmpegPostProcessorError(stderr.strip().splitlines()[-1])
yt_dlp.postprocessor.ffmpeg.FFmpegPostProcessorError: Conversion failed!
```