Repository: yt-dlp
Issue: Specify codec combinations (h264+aac OR vp9+opus)
Labels: enhancement

### 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 requesting a feature unrelated to a specific site
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've verified that I'm running yt-dlp version **2023.10.13** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [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

I want to be able to specify codec combinations, instead of sorting by video codec/audio codec separately. So that if by some other criteria I specified, VP9 video coder is the best fit then it can only be combined with Opus codec. And vice versa, if H.264 is better fit then only combine it with AAC.

Example video:
```bash
% yt-dlp https://www.youtube.com/shorts/2RbpuIgCMkI -F | egrep '^(140|251|298|303)'
140 m4a   audio only      2 |  528.87KiB  130k https | audio only          mp4a.40.2  130k 44k [en] medium, m4a_dash
251 webm  audio only      2 |  543.69KiB  133k https | audio only          opus       133k 48k [en] medium, webm_dash
298 mp4   720x1280    60    |   11.67MiB 2937k https | avc1.4D4020   2937k video only          720p60, mp4_dash
303 webm  1080x1920   60    |   14.87MiB 3743k https | vp09.00.41.08 3743k video only          1080p60, webm_dash
```

I want to download highest bitrate video format, smaller than 20MB, but combine it only with matching codec. What I've tried:
```bash
yt-dlp https://www.youtube.com/shorts/2RbpuIgCMkI -S vbr,codec:h264:aac,codec:vp9:opus -f 'bv[filesize<20M]+ba' -s
[info] 2RbpuIgCMkI: Downloading 1 format(s): 303+140
```

It seems that `codec:h264:aac,codec:vp9:opus` is an equivalent of `vcodec:h264,acodec:aac,vcodec:vp9,acodec:opus` which is not what I want. (The reversed order `codec:vp9:opus,codec:h264:aac` will work here but it's coincidence.)

There's "ext" field but it won't work because multiple video codecs can be muxed into e.g. MP4 container format. And I don't want to prefer VP9 over H.264 or vice versa, I want to specify the audio codec match, but both options are fine.

There's also `--prefer-free-formats` flag, but again, not exactly what I want.

### 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', 'https://www.youtube.com/shorts/2RbpuIgCMkI', '-S', 'vbr,codec:h264:aac,codec:vp9:opus', '-f', 'bv[filesize<20M]+ba', '-s']
[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.10.13 [b634ba742] (pip)
[debug] Python 3.12.0 (CPython arm64 64bit) - macOS-14.0-arm64-arm-64bit (OpenSSL 3.1.3 19 Sep 2023)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0, phantomjs 2.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, sqlite3-3.43.2, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1890 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.10.13, Current version: stable@2023.10.13
yt-dlp is up to date (stable@2023.10.13)
[youtube] Extracting URL: https://www.youtube.com/shorts/2RbpuIgCMkI
[youtube] 2RbpuIgCMkI: Downloading webpage
[youtube] 2RbpuIgCMkI: Downloading ios player API JSON
[youtube] 2RbpuIgCMkI: Downloading android player API JSON
[debug] Loading youtube-nsig.dd34ec3d from cache
[debug] [youtube] Decrypted nsig T5AKJ8kl_CphWx83g => WzivObECDIJyXA
[youtube] 2RbpuIgCMkI: Downloading m3u8 information
[debug] Sort order given by user: vbr, codec:h264:aac, codec:vp9:opus
[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, vbr, vcodec:h264(7), acodec:aac(10), quality, res, fps, hdr:12(7), source, channels, lang, proto, size, br, asr, vext, aext, hasaud, id
[info] 2RbpuIgCMkI: Downloading 1 format(s): 303+140
```