Repository: yt-dlp
Issue: [youtube] merge error
Labels: enhancement,triage,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'm running yt-dlp version **2023.06.22** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [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

France

### Provide a description that is worded well enough to be understood

Hello,
Starting from today, I'm getting this kind of errors on *some* Youtube videos.
A workaround seems to be adding `[vcodec!^=vp]`.

Looking at the log, it is clearly about the ancient version of ffmpeg that I'm using. I'm opening this in case there's something that could be done on yt-dlp side to avoid this kind of error (maybe automatically applying some filters on the format wrt the postprocessing that will be necessary?).

Thanks for everything!

### 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: ['--format-sort', 'res:240', '--format', 'bestvideo[vcodec!^=av01.][ext!=webm]+bestaudio[ext!=webm]/best[vcodec!^=av01.][ext!=webm]/best[vcodec!^=av01.][ext!=webm]', '-vU', 'https://www.youtube.com/watch?v=bMYR33TBkcE']
[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@2023.06.22 [812cdfa06] (linux_exe)
[debug] Python 3.10.11 (CPython x86_64 64bit) - Linux-4.9.0-18-amd64-x86_64-with-glibc2.24 (OpenSSL 3.1.1 30 May 2023, glibc 2.24)
[debug] exe versions: ffmpeg 3.2.18-0, ffprobe 3.2.18-0
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.05.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {'no': 'localhost,127.0.0.1'}
[debug] Loaded 1851 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.06.22, Current version: stable@2023.06.22
Current Build Hash: 18e328f92e9e172f5757a8084c7c6ef950d846ffbef57da3785aeb601e16cdc8
yt-dlp is up to date (stable@2023.06.22)
[youtube] Extracting URL: https://www.youtube.com/watch?v=bMYR33TBkcE
[youtube] bMYR33TBkcE: Downloading webpage
[youtube] bMYR33TBkcE: Downloading ios player API JSON
[youtube] bMYR33TBkcE: Downloading android player API JSON
[debug] Loading youtube-nsig.b7910ca8 from cache
[debug] [youtube] Decrypted nsig FIQeV-YCbYSUnDw => VHshsvXIZ47QfQ
[youtube] bMYR33TBkcE: Downloading m3u8 information
[debug] Sort order given by user: res:240
[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, res:240(240.0), quality, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[info] bMYR33TBkcE: Downloading 1 format(s): 604+140
[debug] Invoking hlsnative downloader on "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1687626007/ei/t8yWZOCRNcuPx_AP-PKdEA/ip/217.61.60.100/id/6cc611df74c191c1/itag/604/source/youtube/requiressl/yes/ratebypass/yes/pfa/1/wft/1/sgovp/clen%3D12490148%3Bdur%3D1049.440%3Bgir%3Dyes%3Bitag%3D242%3Blmt%3D1687526760403509/hls_chunk_host/rr1---sn-8npmpu-8jxl.googlevideo.com/mh/Ct/mm/31,29/mn/sn-8npmpu-8jxl,sn-hpazen7y/ms/au,rdu/mv/m/mvi/1/pl/24/initcwndbps/1313750/vprv/1/playlist_type/DVR/dover/13/txp/5535434/mt/1687604234/fvip/5/short_key/1/keepalive/yes/fexp/24007246,51000011/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,pfa,wft,sgovp,vprv,playlist_type/sig/AOq0QJ8wRgIhAKFeaB5wXbcaHDWSMRqsYsZXijJenbKKdZlBPh8kaJJSAiEAin8yHLAKks3K_RMBFDG-3RVTaS0pefsvLP04QM9jrTM%3D/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pl,initcwndbps/lsig/AG3C_xAwRQIgYAed6SLzWDkp93BE-WHxt4tMDA3VsEKrusl5CauXnP4CIQCIGCmMMYLzkQ9fCTrYj6apT0Red-cnD49UC-25wntFTw%3D%3D/playlist/index.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 209
[download] Destination: Carne coltivata ora in vendita in USA, l’Italia indietro [bMYR33TBkcE].f604.mp4
[download] 100% of   11.96MiB in 00:00:10 at 1.11MiB/s
[debug] Invoking http downloader on "https://rr1---sn-8npmpu-8jxl.googlevideo.com/videoplayback?expire=1687626007&ei=t8yWZOCRNcuPx_AP-PKdEA&ip=217.61.60.100&id=o-ACC5UbNyhMDN_FlNPIgYTnhEKVNzfI8GvhTY42a_wVTF&itag=140&source=youtube&requiressl=yes&mh=Ct&mm=31%2C29&mn=sn-8npmpu-8jxl%2Csn-hpazen7y&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=1313750&vprv=1&svpuc=1&mime=audio%2Fmp4&gir=yes&clen=16985838&dur=1049.472&lmt=1687526108298830&mt=1687604234&fvip=5&keepalive=yes&fexp=24007246%2C51000011&c=IOS&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgc7YHd58djqawVlnO1yqCTZgfJpw8uqSh2VQb1_MXClYCIQDMzq-etUaT7JF4Q-nViDugqRgxKE0-Pr1SiozaWNDrdw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhALCYgSZELEwwjCuVQqiI5-Y0DhwJlY9r0vldDWqSk8ypAiEA1ZeaHamS9pwKXepn5KupKLqBdJBEttoq7TwaMbTwydk%3D"
[download] Destination: Carne coltivata ora in vendita in USA, l’Italia indietro [bMYR33TBkcE].f140.m4a
[download] 100% of   16.20MiB in 00:00:00 at 50.01MiB/s
[Merger] Merging formats into "Carne coltivata ora in vendita in USA, l’Italia indietro [bMYR33TBkcE].mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Carne coltivata ora in vendita in USA, l’Italia indietro [bMYR33TBkcE].f604.mp4' -i 'file:Carne coltivata ora in vendita in USA, l’Italia indietro [bMYR33TBkcE].f140.m4a' -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart 'file:Carne coltivata ora in vendita in USA, l’Italia indietro [bMYR33TBkcE].temp.mp4'
[debug] ffmpeg version 3.2.18-0+deb9u1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --prefix=/usr --extra-version=0+deb9u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:Carne coltivata ora in vendita in USA, l’Italia indietro [bMYR33TBkcE].f604.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6mp41
    creation_time   : 2023-06-24T11:00:09.000000Z
  Duration: 00:17:29.44, start: 0.000000, bitrate: 95 kb/s
    Stream #0:0(und): Video: vp9 (Profile 0) (vp09 / 0x39307076), yuv420p(tv, bt709), 426x240, 93 kb/s, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      creation_time   : 2023-06-24T11:00:09.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 06/24/2023.
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'file:Carne coltivata ora in vendita in USA, l’Italia indietro [bMYR33TBkcE].f140.m4a':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6mp41
    creation_time   : 2023-06-23T12:26:52.000000Z
  Duration: 00:17:29.47, start: 0.000000, bitrate: 129 kb/s
    Stream #1:0(ita): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 1 kb/s (default)
    Metadata:
      creation_time   : 2023-06-23T12:26:52.000000Z
      handler_name    : ISO Media file produced by Google Inc.
[mp4 @ 0x5584e141cc40] VP9 in MP4 support is experimental, add '-strict -2' if you want to use it.
Could not write header for output file #0 (incorrect codec parameters ?): Experimental featureStream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)


ERROR: Postprocessing:   Stream #1:0 -> #0:1 (copy)
Traceback (most recent call last):
  File "yt_dlp/YoutubeDL.py", line 3363, in process_info
  File "yt_dlp/YoutubeDL.py", line 3543, in post_process
  File "yt_dlp/YoutubeDL.py", line 3525, in run_all_pps
  File "yt_dlp/YoutubeDL.py", line 3503, in run_pp
  File "yt_dlp/postprocessor/common.py", line 24, in run
  File "yt_dlp/postprocessor/common.py", line 129, in wrapper
  File "yt_dlp/postprocessor/ffmpeg.py", line 837, in run
  File "yt_dlp/postprocessor/ffmpeg.py", line 329, in run_ffmpeg_multiple_files
  File "yt_dlp/postprocessor/ffmpeg.py", line 367, in real_run_ffmpeg
yt_dlp.postprocessor.ffmpeg.FFmpegPostProcessorError:   Stream #1:0 -> #0:1 (copy)
```