test(manifests): add shaka packager ad-cue output to the corpus

This commit is contained in:
imSp4rky
2026-11-02 17:50:25 -07:00
parent c744e9a87b
commit a4ba7767c5
3 changed files with 96 additions and 2 deletions
+21 -2
View File
@@ -2,7 +2,8 @@
Sources: the DASH-IF test vector database (with the stream counts and codecs it expects),
the example MPDs of the MPEG DASH spec (ISO/IEC 23009-1), the yt-dlp test data, and the
stream lists of the dash.js reference player, the Shaka Player demo and the hls.js tests.
stream lists of the dash.js reference player, the Shaka Player demo and the hls.js tests, and
Shaka Packager test output (ad cues written as Period splits).
Only the manifest text is stored; index.json maps each file to its source URL, which the
parser needs to resolve relative URLs. A manifest that fails to download keeps its previous
copy. An HLS media playlist is left out, since HLS parses only multivariant playlists.
@@ -35,6 +36,10 @@ DASHJS_SOURCES = (
YTDLP_TESTDATA = "https://api.github.com/repos/yt-dlp/yt-dlp/contents/test/testdata/"
HLSJS_STREAMS = "https://raw.githubusercontent.com/video-dev/hls.js/master/tests/test-streams.js"
SHAKA_ASSETS = "https://raw.githubusercontent.com/shaka-project/shaka-player/main/demo/common/assets.js"
SHAKA_PACKAGER_TESTDATA = (
"https://raw.githubusercontent.com/shaka-project/shaka-packager/main/packager/app/test/testdata/"
)
SHAKA_PACKAGER_OUTPUTS = ("vtt-text-to-mp4-with-ad-cues",)
OUT = Path(__file__).resolve().parent.parent / "tests" / "fixtures" / "manifests"
MAX_BYTES = 500_000
DEADLINE = 60
@@ -117,6 +122,12 @@ def shaka_streams() -> list[Stream]:
return [("shaka", name.replace("\\'", "'"), url, None) for name, url in pattern.findall(text)]
def shaka_packager_streams() -> list[Stream]:
return [
("shaka-packager", name, f"{SHAKA_PACKAGER_TESTDATA}{name}/output.mpd", None) for name in SHAKA_PACKAGER_OUTPUTS
]
def kind_of(head: bytes) -> Optional[str]:
"""Tell the manifest type from the first bytes, since many manifest URLs have no telling extension."""
text = head.lstrip(b"\xef\xbb\xbf").lstrip()
@@ -167,7 +178,15 @@ def fetch(stream: Stream) -> Optional[dict[str, Any]]:
def main() -> None:
streams: dict[str, Stream] = {}
lists = dashif_streams() + mpeg_streams() + ytdlp_streams() + dashjs_streams() + shaka_streams() + hlsjs_streams()
lists = (
dashif_streams()
+ mpeg_streams()
+ ytdlp_streams()
+ dashjs_streams()
+ shaka_streams()
+ hlsjs_streams()
+ shaka_packager_streams()
)
for source, name, url, expect in lists:
url = f"https:{url}" if url.startswith("//") else url
if url not in EXCLUDED:
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT2.736067S">
<Period id="0" duration="PT2.002S">
<AdaptationSet id="1" contentType="audio" startWithSAP="1" segmentAlignment="true">
<Representation id="0" bandwidth="133961" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="44100">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
<SegmentTemplate timescale="44100" initialization="bear-640x360-audio-init.mp4" media="bear-640x360-audio-$Number$.m4s" startNumber="1">
<SegmentTimeline>
<S t="0" d="45056"/>
<S t="45056" d="43008"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet id="0" contentType="video" width="640" height="360" frameRate="30000/1001" segmentAlignment="true" par="16:9">
<Representation id="1" bandwidth="974154" codecs="avc1.64001e" mimeType="video/mp4" sar="1:1">
<SegmentTemplate timescale="30000" initialization="bear-640x360-video-init.mp4" media="bear-640x360-video-$Number$.m4s" startNumber="1">
<SegmentTimeline>
<S t="0" d="30030" r="1"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet id="2" contentType="text" segmentAlignment="true">
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle"/>
<Representation id="2" bandwidth="2104" codecs="wvtt" mimeType="application/mp4">
<SegmentTemplate timescale="1000" initialization="bear-english-text-init.mp4" media="bear-english-text-$Number$.m4s" startNumber="1">
<SegmentTimeline>
<S t="0" d="1000" r="1"/>
<S t="2000" d="1"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
</Period>
<Period id="1" duration="PT0.734067S">
<AdaptationSet id="1" contentType="audio" startWithSAP="1" segmentAlignment="true">
<Representation id="0" bandwidth="108129" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="44100">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
<SegmentTemplate timescale="44100" presentationTimeOffset="88288" initialization="bear-640x360-audio-init.mp4" media="bear-640x360-audio-$Number$.m4s" startNumber="3">
<SegmentTimeline>
<S t="88064" d="32768"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet id="0" contentType="video" width="640" height="360" frameRate="30000/1001" segmentAlignment="true" par="16:9">
<Representation id="1" bandwidth="869088" codecs="avc1.64001e" mimeType="video/mp4" sar="1:1">
<SegmentTemplate timescale="30000" presentationTimeOffset="60059" initialization="bear-640x360-video-init.mp4" media="bear-640x360-video-$Number$.m4s" startNumber="3">
<SegmentTimeline>
<S t="60060" d="22022"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet id="2" contentType="text" segmentAlignment="true">
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle"/>
<Representation id="2" bandwidth="2216" codecs="wvtt" mimeType="application/mp4">
<SegmentTemplate timescale="1000" presentationTimeOffset="2001" initialization="bear-english-text-init.mp4" media="bear-english-text-$Number$.m4s" startNumber="4">
<SegmentTimeline>
<S t="2001" d="1000" r="2"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
</Period>
</MPD>
+7
View File
@@ -2916,6 +2916,13 @@
"name": "onDemand profile",
"url": "https://download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-onDemand/mp4-onDemand-mpd-AV.mpd"
},
{
"file": "dash/shaka-packager-vtt-text-to-mp4-with-ad-cues-7bf01ab0.mpd",
"kind": "dash",
"source": "shaka-packager",
"name": "vtt-text-to-mp4-with-ad-cues",
"url": "https://raw.githubusercontent.com/shaka-project/shaka-packager/main/packager/app/test/testdata/vtt-text-to-mp4-with-ad-cues/output.mpd"
},
{
"file": "dash/shaka-shaka-player-history-h264-vp9-av1-live-dash-88d2ae20.mpd",
"kind": "dash",