Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live MPD unplayable with empty segment timeline for text track #2708

Closed
5 tasks done
jakubvojacek opened this issue Jul 12, 2018 · 3 comments
Closed
5 tasks done

Live MPD unplayable with empty segment timeline for text track #2708

jakubvojacek opened this issue Jul 12, 2018 · 3 comments

Comments

@jakubvojacek
Copy link

Steps to reproduce

The playback does not start in case of live content that has subtitle track with no subtitles available yet. Sample MPD is:

<?xml version="1.0" encoding="UTF-8"?>
<!--Generated with https://github.com/google/shaka-packager version 5f0868275a-release-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" 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="PT3.2S" type="dynamic" publishTime="2018-07-12T06:43:34Z" availabilityStartTime="2018-07-11T18:18:02Z" minimumUpdatePeriod="PT5S" timeShiftBufferDepth="PT15000S" suggestedPresentationDelay="PT5S">
  <Period id="0" start="PT0S">
    <AdaptationSet id="0" contentType="text" lang="cs" segmentAlignment="true">
      <Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle"/>
      <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
      <Representation id="0" bandwidth="0" codecs="wvtt" mimeType="application/mp4">
        <SegmentTemplate timescale="1000" initialization="ct-sport-8_subtitle_init.mp4" media="subtitle/ttv_$Number$.m4s" startNumber="1"/>
      </Representation>
    </AdaptationSet>
    <AdaptationSet id="1" contentType="video" maxWidth="1920" maxHeight="1080" frameRate="90000/3600" segmentAlignment="true" par="16:9">
      <Representation id="1" bandwidth="400000" codecs="avc1.4d401e" mimeType="video/mp4" sar="1:1" width="640" height="360">
        <SegmentTemplate timescale="90000" initialization="ct-sport-8_video_640_360.mp4" media="video_640_360/ct-sport-8-$Number$.mp4" startNumber="9287">
          <SegmentTimeline>
            <S t="2675297040" d="288000" r="4688"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
      <Representation id="2" bandwidth="2500000" codecs="avc1.4d4028" mimeType="video/mp4" sar="1:1" width="1920" height="1080">
        <SegmentTemplate timescale="90000" initialization="ct-sport-8_video_1920_1080.mp4" media="video_1920_1080/ct-sport-8-$Number$.mp4" startNumber="9287">
          <SegmentTimeline>
            <S t="2675297040" d="288000" r="4688"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
      <Representation id="3" bandwidth="1000000" codecs="avc1.4d401f" mimeType="video/mp4" sar="1:1" width="960" height="540">
        <SegmentTemplate timescale="90000" initialization="ct-sport-8_video_720_410.mp4" media="video_720_410/ct-sport-8-$Number$.mp4" startNumber="9287">
          <SegmentTimeline>
            <S t="2675297040" d="288000" r="4688"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
    <AdaptationSet id="2" contentType="audio" lang="cs" segmentAlignment="true">
      <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
      <Representation id="4" bandwidth="131745" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="48000">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
        <SegmentTemplate timescale="90000" initialization="ct-sport-8_audio_cs.mp4" media="audio_cs/ct-sport-8-$Number$.mp4" startNumber="9289">
          <SegmentTimeline>
            <S t="2675521778" d="288000" r="3684"/>
            <S t="3736801778" d="281955"/>
            <S t="3737089489" d="288000" r="54"/>
            <S t="3752929489" d="285935"/>
            <S t="3753217404" d="288000" r="804"/>
            <S t="3985057404" d="282036"/>
            <S t="3985345198" d="288000" r="140"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
  </Period>
  <UTCTiming schemeIdUri="urn:mpeg:dash:utc:http-head:2014" value="https://mw.motv.eu/time.txt"/>
</MPD>
Observed behaviour

The playback is not started, ends up with an error instead. This issue was just recently resolved by the shaka player team in their player shaka-project/shaka-player#1484 and you can sucecssfully test playing the MPD here https://nightly-dot-shaka-player-demo.appspot.com/

Console output
SegmentsUtils.js:238 Uncaught TypeError: Cannot read property 'start' of null
    at decideSegmentListRangeForTemplate (SegmentsUtils.js:238)
    at Object.getSegmentsFromTemplate [as getSegments] (TemplateSegmentsGetter.js:64)
    at Object.getSegments (SegmentsGetter.js:65)
    at updateSegments (DashHandler.js:218)
    at updateSegmentList (DashHandler.js:244)
    at Object.updateRepresentation (DashHandler.js:255)
    at Object.updateData (RepresentationController.js:192)
    at Object.updateData (DashAdapter.js:446)
    at Object.selectMediaInfo (StreamProcessor.js:250)
    at createStreamProcessor (Stream.js:390)
@davemevans
Copy link
Contributor

It passes the validator, but I don't think this is valid - you state there is an empty SegmentTimeline, but that element is not included here, only a SegmentTemplate with no @duration.

The spec is clear that If the Representation contains more than one Media Segment, then either the attribute @duration or the element SegmentTimeline shall be present. Neither of those things is true. Additionally, the DASH-IF IOP are even clearer: exactly one of SegmentTemplate@duration or SegmentTemplate.SegmentTimeline must be present per Representation.

Regardless, it will still fail since media should be available for the entire @timeShiftBufferDepth. Personally, I think dash.js is behaving correctly and that the packager should be producing valid segments with empty samples.

Of course, there is the option to copy the Shaka Player functionality.

@nicosang
Copy link
Contributor

Hi @jakubvojacek and @bbcrddave ,

I rather agree with David. However, the issue seems to be solved by adding a small test of availabilityWindow. @jakubvojacek could you, please, test it on your side?

thanks,

Nico

@jakubvojacek
Copy link
Author

@nicosang thank you for the PR. I will try to talk to shaka packager team to fix this issue on their side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants