Repository: yt-dlp
Issue: Embed metadata on stdout streams
Labels: enhancement,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 a bug unrelated to a specific 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)

### Provide a description that is worded well enough to be understood

`yt-dlp` currently does not embed metadata when `--output=-` (stdout). This is somewhat more difficult especially with how y'alls postprocessing machinery is built but other services like https://github.com/wukko/cobalt do streaming metadata with ffmpeg: 
https://github.com/wukko/cobalt/blob/16397aed89df09b515d781206216e9c163804ed7/src/modules/stream/types.js#L64

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] 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
$ yt-dlp --version
2023.12.20.1
```

<details>
<summary>

`yt-dlp https://www.youtube.com/watch?v=2QT5eGHCJdE --verbose --embed-metadata -o - > stdout.mp4`

</summary>

```
[debug] Command-line config: ['https://www.youtube.com/watch?v=2QT5eGHCJdE', '--verbose', '--embed-metadata', '-o', '-']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version local@2023.12.20.1 [196eb0fe7]
[debug] Python 3.11.5 (CPython x86_64 64bit) - Linux-6.1.57-gentoo-x86_64-x86_64-11th_Gen_Intel-R-_Core-TM-_i7-1185G7_@_3.00GHz-with-glibc2.37 (OpenSSL 3.0.11 19 Sep 2023, glibc 2.37)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0
[debug] Optional libraries: brotlicffi-1.1.0.0, certifi-3021.03.16, pycrypto-3.19.0, requests-2.31.0, secretstorage-3.3.3, sqlite3-3.44.2, urllib3-1.26.18, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1796 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=2QT5eGHCJdE
[youtube] 2QT5eGHCJdE: Downloading webpage
[youtube] 2QT5eGHCJdE: Downloading ios player API JSON
[youtube] 2QT5eGHCJdE: Downloading android player API JSON
[youtube] 2QT5eGHCJdE: 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
[debug] Default format spec: best/bestvideo+bestaudio
[info] 2QT5eGHCJdE: Downloading 1 format(s): 22
[debug] Invoking http downloader on "https://rr1---sn-cxoqcc-gqhl.googlevideo.com/videoplayback?expire=1703119617&ei=oTaDZfj0HeS7sfIPrYmcwAg&ip=69.129.37.22&id=o-AN1vifR5M7VQwHvQZ8hWJ6_6PLTbEU4BiX7ulxiZ45oM&itag=22&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=hJ&mm=31%2C29&mn=sn-cxoqcc-gqhl%2Csn-nx57ynsd&ms=au%2Crdu&mv=m&mvi=1&pl=23&gcr=us&initcwndbps=1098750&spc=UWF9fzbiARrxanMMVImOegJp9DOvjDQ&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=260.226&lmt=1699944123754786&mt=1703097653&fvip=4&fexp=24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRAIgTTpStP9xcaaNl7EPGmWhh_YUJV6gxoTInjCyWTYzlJ4CIFE1t_2tZWKECS9WgR8Ni1lQqQ9itboxsUEmPTMHt4sH&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AAO5W4owRQIgKdOVGd2s2Q7rHX__YUXCZriXwH2j_UpA_ydhAW3Mt4sCIQDwiE_A8KIqy4FVCPJlCSEb2zeUbpvC1OATPl-mxNIa8w%3D%3D"
[debug] File locking is not supported. Proceeding without locking
[download] Destination: -
[download] 100% of   11.30MiB in 00:00:10 at 1.13MiB/s
```

</details>
<details>
<summary>

`yt-dlp https://www.youtube.com/watch?v=2QT5eGHCJdE --verbose --embed-metadata -o file.webm`

</summary>

```
[debug] Command-line config: ['https://www.youtube.com/watch?v=2QT5eGHCJdE', '--verbose', '--embed-metadata', '-o', 'file.webm']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version local@2023.12.20.1 [196eb0fe7]
[debug] Python 3.11.5 (CPython x86_64 64bit) - Linux-6.1.57-gentoo-x86_64-x86_64-11th_Gen_Intel-R-_Core-TM-_i7-1185G7_@_3.00GHz-with-glibc2.37 (OpenSSL 3.0.11 19 Sep 2023, glibc 2.37)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0
[debug] Optional libraries: brotlicffi-1.1.0.0, certifi-3021.03.16, pycrypto-3.19.0, requests-2.31.0, secretstorage-3.3.3, sqlite3-3.44.2, urllib3-1.26.18, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1796 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=2QT5eGHCJdE
[youtube] 2QT5eGHCJdE: Downloading webpage
[youtube] 2QT5eGHCJdE: Downloading ios player API JSON
[youtube] 2QT5eGHCJdE: Downloading android player API JSON
[youtube] 2QT5eGHCJdE: 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
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 2QT5eGHCJdE: Downloading 1 format(s): 616+251
[debug] Invoking hlsnative downloader on "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1703119655/ei/xzaDZYepGryTsfIP-8qBoA0/ip/69.129.37.22/id/d904f97861c225d1/itag/616/source/youtube/requiressl/yes/ratebypass/yes/pfa/1/wft/1/sgovp/clen%3D37707344%3Bdur%3D260.160%3Bgir%3Dyes%3Bitag%3D356%3Blmt%3D1699942628117341/rqh/1/hls_chunk_host/rr1---sn-cxoqcc-gqhl.googlevideo.com/xpc/EgVo2aDSNQ%3D%3D/mh/hJ/mm/31,29/mn/sn-cxoqcc-gqhl,sn-nx5s7n7d/ms/au,rdu/mv/m/mvi/1/pl/23/gcr/us/initcwndbps/1098750/vprv/1/playlist_type/DVR/dover/13/txp/5532434/mt/1703097653/fvip/5/short_key/1/keepalive/yes/fexp/24007246/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,pfa,wft,sgovp,rqh,xpc,gcr,vprv,playlist_type/sig/AJfQdSswRQIhAOlyiBKYG5qddYCH7sLrjxfb4JjQuHWw7C35ym6BAYqJAiBDsmf17hd5609yE26-IFCIfawSD7D16b37cQRWtZnMug%3D%3D/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pl,initcwndbps/lsig/AAO5W4owRQIgUBmZY_cNOMx5PZHYQ--_R1O5nsMYblY1Y6p6tPF63cMCIQCgD1sPpzhsNpGPPK3u5F_rxXao07llz_WUM5PX-cHziA%3D%3D/playlist/index.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 50
[download] Destination: file.f616.mp4
[download] 100% of   35.97MiB in 00:00:47 at 777.38KiB/s
[debug] Invoking http downloader on "https://rr1---sn-cxoqcc-gqhl.googlevideo.com/videoplayback?expire=1703119655&ei=xzaDZbKdJs-1sfIPkKeKmAY&ip=69.129.37.22&id=o-AI0Vf8QLcGpTOL5vt0Riio46XRFUWfrNBSom2B6ZXCiZ&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=hJ&mm=31%2C29&mn=sn-cxoqcc-gqhl%2Csn-nx57ynsd&ms=au%2Crdu&mv=m&mvi=1&pl=23&gcr=us&initcwndbps=1098750&spc=UWF9f-gDRPU3yx6o511u5MZvgphzMTY&vprv=1&svpuc=1&mime=audio%2Fwebm&gir=yes&clen=4272208&dur=260.181&lmt=1699939736383532&mt=1703097653&fvip=4&keepalive=yes&fexp=24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIgIVCx0tqrCQjeiaWZnIYO5jxXV9nLwndMsW9xdmW7Sf8CIQCC5f0KIv7kR3jEvnO9T2yxASR5C5sG4FTB91I57sgt7A%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AAO5W4owRAIgPY3leXV-5DxV6v4ku03KOIJrEdjL-oSlhhCLmGfot7sCIBUO3IUzcRO-gtYjgWXEZB6p1u2IHKvUJY7V1B8XU8o7"
[download] Destination: file.f251.webm
[download] 100% of    4.07MiB in 00:00:03 at 1.09MiB/s
[Merger] Merging formats into "file.webm"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i file:file.f616.mp4 -i file:file.f251.webm -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart file:file.temp.webm
Deleting original file file.f616.mp4 (pass -k to keep)
Deleting original file file.f251.webm (pass -k to keep)
[Metadata] Adding metadata to "file.webm"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i file:file.webm -map 0 -dn -ignore_unknown -c copy -write_id3v1 1 -metadata 'title=Daughter - Youth' -metadata date=20130619 -metadata 'description=Taken from Daughter'"'"'s debut album '"'"'If You Leave'"'"', out now: http://smarturl.it/daughteritunes

Daughter are Elena Tonra, Igor Haefeli & Remi Aguilella
http://www.ohdaughter.com
http://www.facebook.com/ohdaughter 
http://www.twitter.com/ohdaughter

Directed by The Mitcham Submarine

Very special thanks to Ron at Vintage Guitars / Crispin, Rob & Dom of Regent Sounds - Denmark Street London.

Production Credits:
Executive Producer: Hannah Cooper
Director of Photography: Alex Ryle
Focus Puller: Jason Wingrove
Producer: Lucile Weigel
1st Assistant Director: Andy Young
2nd Assistant Director: Sam Barry-Parker
Key Grip: David Bradshaw
DIT: Robert Mila
Audio/Video Playback: Paddy Owen
Gaffer: Wouter Poppink
Hair / Makeup: Brigitta Smart
Stylist: Jakob Brondum
Editor: James Harman @ TC Soho
Post Production: Sean Martin @ Th1ng
Colourist: Tom Knowles @ The Joint
Runner: Matthew Hoare
Runner: Owen Porter' -metadata 'synopsis=Taken from Daughter'"'"'s debut album '"'"'If You Leave'"'"', out now: http://smarturl.it/daughteritunes

Daughter are Elena Tonra, Igor Haefeli & Remi Aguilella
http://www.ohdaughter.com
http://www.facebook.com/ohdaughter 
http://www.twitter.com/ohdaughter

Directed by The Mitcham Submarine

Very special thanks to Ron at Vintage Guitars / Crispin, Rob & Dom of Regent Sounds - Denmark Street London.

Production Credits:
Executive Producer: Hannah Cooper
Director of Photography: Alex Ryle
Focus Puller: Jason Wingrove
Producer: Lucile Weigel
1st Assistant Director: Andy Young
2nd Assistant Director: Sam Barry-Parker
Key Grip: David Bradshaw
DIT: Robert Mila
Audio/Video Playback: Paddy Owen
Gaffer: Wouter Poppink
Hair / Makeup: Brigitta Smart
Stylist: Jakob Brondum
Editor: James Harman @ TC Soho
Post Production: Sean Martin @ Th1ng
Colourist: Tom Knowles @ The Joint
Runner: Matthew Hoare
Runner: Owen Porter' -metadata 'purl=https://www.youtube.com/watch?v=2QT5eGHCJdE' -metadata 'comment=https://www.youtube.com/watch?v=2QT5eGHCJdE' -metadata artist=Daughter -movflags +faststart file:file.temp.webm
```

</details>

<details>
<summary>

`exiftool stdout.mp3`

</summary>

```
ExifTool Version Number         : 12.64
File Name                       : stdout.mp4
Directory                       : .
File Size                       : 12 MB
File Modification Date/Time     : 2023:12:20 10:47:05-08:00
File Access Date/Time           : 2023:12:20 10:46:53-08:00
File Inode Change Date/Time     : 2023:12:20 10:47:05-08:00
File Permissions                : -rw-r--r--
File Type                       : MP4
File Type Extension             : mp4
MIME Type                       : video/mp4
Major Brand                     : MP4 v2 [ISO 14496-14]
Minor Version                   : 0.0.0
Compatible Brands               : isom, mp42
Movie Header Version            : 0
Create Date                     : 2023:11:14 05:26:05
Modify Date                     : 2023:11:14 05:26:05
Time Scale                      : 12800
Duration                        : 0:04:20
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 3
Track Header Version            : 0
Track Create Date               : 2023:11:14 05:26:05
Track Modify Date               : 2023:11:14 05:26:05
Track ID                        : 1
Track Duration                  : 0:04:20
Track Layer                     : 0
Track Volume                    : 0.00%
Image Width                     : 1280
Image Height                    : 720
Compressor ID                   : avc1
Source Image Width              : 1280
Source Image Height             : 720
X Resolution                    : 72
Y Resolution                    : 72
Bit Depth                       : 24
Video Frame Rate                : 25
Graphics Mode                   : srcCopy
Op Color                        : 0 0 0
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 2023:11:14 05:26:05
Media Modify Date               : 2023:11:14 05:26:05
Media Time Scale                : 44100
Media Duration                  : 0:04:20
Media Language Code             : eng
Handler Description             : ISO Media file produced by Google Inc. Created on: 11/13/2023.
Audio Format                    : mp4a
Audio Channels                  : 2
Audio Bits Per Sample           : 16
Audio Sample Rate               : 44100
Balance                         : 0
Handler Type                    : Metadata
Handler Vendor ID               : Apple
Google Start Time               : 0
Google Track Duration           : 0:04:20
Media Data Size                 : 11726305
Media Data Offset               : 121188
Image Size                      : 1280x720
Megapixels                      : 0.922
Avg Bitrate                     : 361 kbps
Rotation                        : 0
```

</details>

<details>
<summary>

`exiftool file.webm`

</summary>

```
ExifTool Version Number         : 12.64
File Name                       : file.webm
Directory                       : .
File Size                       : 42 MB
File Modification Date/Time     : 2023:11:13 21:28:56-08:00
File Access Date/Time           : 2023:11:13 21:28:56-08:00
File Inode Change Date/Time     : 2023:12:20 10:48:25-08:00
File Permissions                : -rw-r--r--
File Type                       : WEBM
File Type Extension             : webm
MIME Type                       : video/webm
EBML Version                    : 1
EBML Read Version               : 1
Doc Type                        : webm
Doc Type Version                : 4
Doc Type Read Version           : 2
Timecode Scale                  : 1 ms
Title                           : Daughter - Youth
Muxing App                      : Lavf60.3.100
Writing App                     : Lavf60.3.100
Video Frame Rate                : 25
Image Width                     : 1920
Image Height                    : 1080
Track Number                    : 2
Track UID                       : 04a9932cceb9ee70
Track Language                  : eng
Codec ID                        : A_OPUS
Track Type                      : Audio
Audio Channels                  : 2
Audio Sample Rate               : 48000
Audio Bits Per Sample           : 32
Compatible Brands               : iso6mp41
Major Brand                     : dash
Minor Version                   : 0
Artist                          : Daughter
Date                            : 20130619
Description                     : Taken from Daughter's debut album 'If You Leave', out now: http://smarturl.it/daughteritunes..Daughter are Elena Tonra, Igor Haefeli & Remi Aguilella.http://www.ohdaughter.com.http://www.facebook.com/ohdaughter .http://www.twitter.com/ohdaughter..Directed by The Mitcham Submarine..Very special thanks to Ron at Vintage Guitars / Crispin, Rob & Dom of Regent Sounds - Denmark Street London...Production Credits:.Executive Producer: Hannah Cooper.Director of Photography: Alex Ryle.Focus Puller: Jason Wingrove.Producer: Lucile Weigel.1st Assistant Director: Andy Young.2nd Assistant Director: Sam Barry-Parker.Key Grip: David Bradshaw.DIT: Robert Mila.Audio/Video Playback: Paddy Owen.Gaffer: Wouter Poppink.Hair / Makeup: Brigitta Smart.Stylist: Jakob Brondum.Editor: James Harman @ TC Soho.Post Production: Sean Martin @ Th1ng.Colourist: Tom Knowles @ The Joint.Runner: Matthew Hoare.Runner: Owen Porter
Synopsis                        : Taken from Daughter's debut album 'If You Leave', out now: http://smarturl.it/daughteritunes..Daughter are Elena Tonra, Igor Haefeli & Remi Aguilella.http://www.ohdaughter.com.http://www.facebook.com/ohdaughter .http://www.twitter.com/ohdaughter..Directed by The Mitcham Submarine..Very special thanks to Ron at Vintage Guitars / Crispin, Rob & Dom of Regent Sounds - Denmark Street London...Production Credits:.Executive Producer: Hannah Cooper.Director of Photography: Alex Ryle.Focus Puller: Jason Wingrove.Producer: Lucile Weigel.1st Assistant Director: Andy Young.2nd Assistant Director: Sam Barry-Parker.Key Grip: David Bradshaw.DIT: Robert Mila.Audio/Video Playback: Paddy Owen.Gaffer: Wouter Poppink.Hair / Makeup: Brigitta Smart.Stylist: Jakob Brondum.Editor: James Harman @ TC Soho.Post Production: Sean Martin @ Th1ng.Colourist: Tom Knowles @ The Joint.Runner: Matthew Hoare.Runner: Owen Porter
Purl                            : https://www.youtube.com/watch?v=2QT5eGHCJdE
Comment                         : https://www.youtube.com/watch?v=2QT5eGHCJdE
Encoder                         : Lavf60.3.100
Handler Name                    : ISO Media file produced by Google Inc. Created on: 12/20/2023.
Vendor Id                       : [0][0][0][0]
Tag Track UID                   : 04a9932cceb9ee70
Duration                        : 00:04:20.188000000
Image Size                      : 1920x1080
Megapixels                      : 2.1
```

</details>