mpd解析存在错误

Author: lns103Created Aug 1, 2026Updated Aug 1, 2026

链接 https://primeran.eus/manifests/argi-gorriak-d1-1-txarto-beti-bezala/eu/widevine/dash.mpd?include_tudum=true 问题:该mpd实际是两个视频,分别为logo和正片,logo的init.mp4 + 1.m4s,以及正片的init.mp4 + 1.m4s + 2.m4s +......,解析器直接组合了logo的init.mp4+logo的1.m4s+正片的1.m4s + 2.m4s +...... 导致视频损坏

附mpd内容

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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" xmlns:cenc="urn:mpeg:cenc:2013" profiles="urn:mpeg:dash:profile:isoff-live:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT1993.61S">
  <Period id="0" start="PT0S" duration="PT5.61S">
  <BaseURL>https://cdn.primeran.eus/media/dd5cb60b19e37870972164d1995dc7b3/cenc/</BaseURL>
  <AdaptationSet contentType="video" maxWidth="1920" maxHeight="1080" frameRate="12800/512" segmentAlignment="true" par="16:9">
    <ContentProtection value="cenc" schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="662f4a9a-1871-4d37-8d0c-d58adcc62b16"/>
    <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
      <cenc:pssh>AAAAZnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAEYSEGYvSpoYcU03jQzVitzGKxYaBk92ZXJvbiIkNjYyZjRhOWEtMTg3MS00ZDM3LThkMGMtZDU4YWRjYzYyYjE2SOPclZsG</cenc:pssh>
    </ContentProtection>
    <Representation id="100" bandwidth="1089910" codecs="avc1.42c01e" mimeType="video/mp4" sar="1:1" width="640" height="360">
    <SegmentTemplate timescale="1" initialization="360/init.mp4" media="360/$Number$.m4s" startNumber="1">
        <SegmentTimeline>
            <S t="0" d="6" r="0"/>
        </SegmentTimeline>
    </SegmentTemplate>
</Representation>
<Representation id="101" bandwidth="2705450" codecs="avc1.42c01f" mimeType="video/mp4" sar="1:1" width="854" height="480">
    <SegmentTemplate timescale="1" initialization="480/init.mp4" media="480/$Number$.m4s" startNumber="1">
        <SegmentTimeline>
            <S t="0" d="6" r="0"/>
        </SegmentTimeline>
    </SegmentTemplate>
</Representation>
<Representation id="102" bandwidth="3786844" codecs="avc1.42c028" mimeType="video/mp4" sar="1:1" width="1280" height="720">
    <SegmentTemplate timescale="1" initialization="720/init.mp4" media="720/$Number$.m4s" startNumber="1">
        <SegmentTimeline>
            <S t="0" d="6" r="0"/>
        </SegmentTimeline>
    </SegmentTemplate>
</Representation>
<Representation id="103" bandwidth="4846960" codecs="avc1.42c02a" mimeType="video/mp4" sar="1:1" width="1920" height="1080">
    <SegmentTemplate timescale="1" initialization="1080/init.mp4" media="1080/$Number$.m4s" startNumber="1">
        <SegmentTimeline>
            <S t="0" d="6" r="0"/>
        </SegmentTimeline>
    </SegmentTemplate>
</Representation>
  </AdaptationSet>
  <AdaptationSet contentType="audio" lang="eu" label="Euskara" segmentAlignment="true">
  <ContentProtection value="cenc" schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="662f4a9a-1871-4d37-8d0c-d58adcc62b16"/>
  <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
    <cenc:pssh>AAAAZnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAEYSEGYvSpoYcU03jQzVitzGKxYaBk92ZXJvbiIkNjYyZjRhOWEtMTg3MS00ZDM3LThkMGMtZDU4YWRjYzYyYjE2SOPclZsG</cenc:pssh>
  </ContentProtection>
  <Representation id="200" bandwidth="70108" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="48000">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
    <SegmentTemplate timescale="1" initialization="audio_und/init.mp4" media="audio_und/$Number$.m4s" startNumber="1">
      <SegmentTimeline>
        <S t="0" d="6" r="0"/>
      </SegmentTimeline>
    </SegmentTemplate>
  </Representation>
</AdaptationSet>
</Period>

<Period id="1" start="PT5.61S" duration="PT1988S">
  <BaseURL>https://cdn.primeran.eus/media/730a1bba0ec3b8b2e6ababa03f33526d/cenc/</BaseURL>
  <AdaptationSet contentType="video" maxWidth="1920" maxHeight="1080" frameRate="12800/512" segmentAlignment="true" par="16:9">
    <ContentProtection value="cenc" schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="662f4a9a-1871-4d37-8d0c-d58adcc62b16"/>
    <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
      <cenc:pssh>AAAAZnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAEYSEGYvSpoYcU03jQzVitzGKxYaBk92ZXJvbiIkNjYyZjRhOWEtMTg3MS00ZDM3LThkMGMtZDU4YWRjYzYyYjE2SOPclZsG</cenc:pssh>
    </ContentProtection>
    <Representation id="100" bandwidth="1089910" codecs="avc1.42c01e" mimeType="video/mp4" sar="1:1" width="640" height="360">
    <SegmentTemplate timescale="1" initialization="360/init.mp4" media="360/$Number$.m4s" startNumber="1">
        <SegmentTimeline>
            <S t="0" d="6" r="331"/>
        </SegmentTimeline>
    </SegmentTemplate>
</Representation>
<Representation id="101" bandwidth="2705450" codecs="avc1.42c01f" mimeType="video/mp4" sar="1:1" width="854" height="480">
    <SegmentTemplate timescale="1" initialization="480/init.mp4" media="480/$Number$.m4s" startNumber="1">
        <SegmentTimeline>
            <S t="0" d="6" r="331"/>
        </SegmentTimeline>
    </SegmentTemplate>
</Representation>
<Representation id="102" bandwidth="3786844" codecs="avc1.42c028" mimeType="video/mp4" sar="1:1" width="1280" height="720">
    <SegmentTemplate timescale="1" initialization="720/init.mp4" media="720/$Number$.m4s" startNumber="1">
        <SegmentTimeline>
            <S t="0" d="6" r="331"/>
        </SegmentTimeline>
    </SegmentTemplate>
</Representation>
<Representation id="103" bandwidth="4846960" codecs="avc1.42c02a" mimeType="video/mp4" sar="1:1" width="1920" height="1080">
    <SegmentTemplate timescale="1" initialization="1080/init.mp4" media="1080/$Number$.m4s" startNumber="1">
        <SegmentTimeline>
            <S t="0" d="6" r="331"/>
        </SegmentTimeline>
    </SegmentTemplate>
</Representation>
  </AdaptationSet>
  <AdaptationSet contentType="audio" lang="eu" label="Euskara" segmentAlignment="true">
  <ContentProtection value="cenc" schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="662f4a9a-1871-4d37-8d0c-d58adcc62b16"/>
  <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
    <cenc:pssh>AAAAZnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAEYSEGYvSpoYcU03jQzVitzGKxYaBk92ZXJvbiIkNjYyZjRhOWEtMTg3MS00ZDM3LThkMGMtZDU4YWRjYzYyYjE2SOPclZsG</cenc:pssh>
  </ContentProtection>
  <Representation id="200" bandwidth="70108" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="48000">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
    <SegmentTemplate timescale="1" initialization="audio_baq/init.mp4" media="audio_baq/$Number$.m4s" startNumber="1">
      <SegmentTimeline>
        <S t="0" d="6" r="331"/>
      </SegmentTimeline>
    </SegmentTemplate>
  </Representation>
</AdaptationSet>
<AdaptationSet mimeType="text/vtt" lang="eu" label="Euskara"> 
    <Representation id="300" bandwidth="256">
        <BaseURL>https://cdnstorage.primeran.eus/directus/eitb/7e379b34-1e6b-42a4-add7-94913775a7d2.vtt</BaseURL> 
    </Representation>
</AdaptationSet>
</Period>

</MPD>