From 618b5e446c4379c9d95fe7b30fd6a0fc6af19a70 Mon Sep 17 00:00:00 2001 From: chrisellsworth Date: Mon, 8 Jun 2026 23:42:48 -0700 Subject: [PATCH] [ie] Extract supplemental codecs from DASH manifests (#16827) Authored by: chrisellsworth --- test/test_InfoExtractor.py | 45 +++++++++++++++++++++++ test/testdata/mpd/supplemental_codecs.mpd | 28 ++++++++++++++ yt_dlp/extractor/common.py | 4 +- 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 test/testdata/mpd/supplemental_codecs.mpd diff --git a/test/test_InfoExtractor.py b/test/test_InfoExtractor.py index f66fdbf8da..63aef689a1 100644 --- a/test/test_InfoExtractor.py +++ b/test/test_InfoExtractor.py @@ -1415,6 +1415,51 @@ jwplayer("mediaplayer").setup({"abouttext":"Visit Indie DB","aboutlink":"http:\/ }, ], }, + ), ( + # SCTE 214 supplemental codecs (e.g. Dolby AV1) + # Based on unfragmented.mpd with scte214:supplementalCodecs on VIDEO-1 only + 'supplemental_codecs', + 'https://v.redd.it/hw1x7rcg7zl21/DASHPlaylist.mpd', # mpd_url + 'https://v.redd.it/hw1x7rcg7zl21', # mpd_base_url + [{ + 'url': 'https://v.redd.it/hw1x7rcg7zl21/audio', + 'manifest_url': 'https://v.redd.it/hw1x7rcg7zl21/DASHPlaylist.mpd', + 'ext': 'm4a', + 'format_id': 'AUDIO-1', + 'format_note': 'DASH audio', + 'container': 'm4a_dash', + 'acodec': 'mp4a.40.2', + 'vcodec': 'none', + 'tbr': 129.87, + 'asr': 48000, + }, { + 'url': 'https://v.redd.it/hw1x7rcg7zl21/DASH_240', + 'manifest_url': 'https://v.redd.it/hw1x7rcg7zl21/DASHPlaylist.mpd', + 'ext': 'mp4', + 'format_id': 'VIDEO-2', + 'format_note': 'DASH video', + 'container': 'mp4_dash', + 'acodec': 'none', + 'vcodec': 'avc1.4d401e', + 'tbr': 608.0, + 'width': 240, + 'height': 240, + 'fps': 30, + }, { + 'url': 'https://v.redd.it/hw1x7rcg7zl21/DASH_360', + 'manifest_url': 'https://v.redd.it/hw1x7rcg7zl21/DASHPlaylist.mpd', + 'ext': 'mp4', + 'format_id': 'VIDEO-1', + 'format_note': 'DASH video, dav1.10.02', + 'container': 'mp4_dash', + 'acodec': 'none', + 'vcodec': 'avc1.4d401e', + 'tbr': 804.261, + 'width': 360, + 'height': 360, + 'fps': 30, + }], + {}, ), ] diff --git a/test/testdata/mpd/supplemental_codecs.mpd b/test/testdata/mpd/supplemental_codecs.mpd new file mode 100644 index 0000000000..f005cf4154 --- /dev/null +++ b/test/testdata/mpd/supplemental_codecs.mpd @@ -0,0 +1,28 @@ + + + + + + DASH_360 + + + + + + DASH_240 + + + + + + + + + audio + + + + + + + diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 31c0266d4a..048c542858 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -2970,6 +2970,8 @@ class InfoExtractor: content_type = representation_attrib.get('contentType', mime_type.split('/')[0]) codec_str = representation_attrib.get('codecs', '') + supplemental_codecs = representation_attrib.get( + '{urn:scte:dash:scte214-extensions}supplementalCodecs') # Some kind of binary subtitle found in some youtube livestreams if mime_type == 'application/x-rawcc': codecs = {'scodec': codec_str} @@ -3025,7 +3027,7 @@ class InfoExtractor: 'asr': int_or_none(representation_attrib.get('audioSamplingRate')), 'fps': int_or_none(representation_attrib.get('frameRate')), 'language': lang if lang not in ('mul', 'und', 'zxx', 'mis') else None, - 'format_note': f'DASH {content_type}', + 'format_note': join_nonempty(f'DASH {content_type}', supplemental_codecs, delim=', '), 'filesize': filesize, 'container': mimetype2ext(mime_type) + '_dash', **codecs,