emarsden / dash-mpd-rs

Rust library for parsing, serializing and downloading media content from a DASH MPD manifest.
MIT License
72 stars 23 forks source link

Add SegmentTimeline in SegmentList #51

Closed erik-moqvist closed 7 months ago

erik-moqvist commented 8 months ago

Should be according to spec. Just let me know if you want me to add a test or validation or something else =)

emarsden commented 8 months ago

Indeed, thanks for the fix. In fact, I see that the BitstreamSwitching element is also missing.

Do you happen to have a sample MPD with this? I'd like to include more SegmentList manifests in the test suite, but it's not widely used.

erik-moqvist commented 8 months ago

I manually edited one of ours. Hopefully without mistakes.

<?xml version="1.0" ?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" mediaPresentationDuration="PT0H0M49.598000000S" type="static">
  <Period duration="PT0H0M49.598000000S">
    <AdaptationSet maxWidth="1280" maxHeight="720" mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" >
      <Representation frameRate="15.00" bandwidth="0" id="video1" codecs="avc1.640029" width="1280" height="720" scanType="progressive" >
    <SegmentList timescale="1000" presentationTimeOffset="0">
      <Initialization sourceURL="https://foobar.com/init.mp4"/>
      <SegmentURL media="https://foobar.com/fie.0.m4v" />
      <SegmentURL media="https://foobar.com/fie.1.m4v" />
      <SegmentURL media="https://foobar.com/fie.2.m4v" />
      <SegmentTimeline>
        <S d="16560" t="0" />
        <S d="16519" />
        <S d="16519" />
      </SegmentTimeline>
    </SegmentList>
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>