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

dash.js 3.1.2 pauses playback when manifest type changes from dynamic into static #3311

Closed
5 tasks done
tomraut opened this issue Jun 25, 2020 · 17 comments
Closed
5 tasks done
Labels
stale To be used by automatic issue staling and closing to indicate that this issue is about to be closed

Comments

@tomraut
Copy link

tomraut commented Jun 25, 2020

Environment
  • Link to playable MPD file: see below
  • Dash.js version: 3.1.2
  • Browser name/version: Chrome 83
  • OS name/version: OSX Mojave
Steps to reproduce

In our use case we have live stream which user is able to start playing from beginning even if user joins session at the very end of live broadcast. When such stream reaches the end, EOS is signalled from encoder and USP modifies manifest by changing its type to static and removing minimumUpdatePeriod.

Examples of manifests are below.

last version of dynamic manifest:

<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Unified Streaming Platform(version=1.9.5) -->
<MPD
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="urn:mpeg:dash:schema:mpd:2011"
  xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
  type="dynamic"
  availabilityStartTime="1970-01-01T00:00:00Z"
  publishTime="2020-06-25T06:10:00.024182Z"
  minimumUpdatePeriod="PT2S"
  timeShiftBufferDepth="PT2H13M41.760S"
  maxSegmentDuration="PT4S"
  minBufferTime="PT10S"
  profiles="urn:mpeg:dash:profile:isoff-live:2011,urn:com:dashif:dash264">
  <Period
    id="1"
    start="PT0S">
    <BaseURL>dash/</BaseURL>
    <AdaptationSet
      id="1"
      group="1"
      contentType="audio"
      lang="en"
      segmentAlignment="true"
      audioSamplingRate="48000"
      mimeType="audio/mp4"
      codecs="mp4a.40.2"
      startWithSAP="1">
      <AudioChannelConfiguration
        schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
        value="2">
      </AudioChannelConfiguration>
      <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main" />
      <SegmentTemplate
        timescale="48000"
        initialization="1261753-$RepresentationID$.dash"
        media="1261753-$RepresentationID$-$Time$.dash">
        <!-- 2020-06-25T03:54:06.520000Z / 1593057246 - 2020-06-25T06:07:48.280000Z -->
        <SegmentTimeline>
          <S t="76466747832960" d="184320" r="2088" />
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation
        id="audio_1=128000"
        bandwidth="128000">
      </Representation>
    </AdaptationSet>
    <AdaptationSet
      id="2"
      group="2"
      contentType="video"
      par="16:9"
      minBandwidth="499968"
      maxBandwidth="3899968"
      maxWidth="1280"
      maxHeight="720"
      minFrameRate="25"
      maxFrameRate="50"
      segmentAlignment="true"
      sar="1:1"
      mimeType="video/mp4"
      startWithSAP="1">
      <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main" />
      <SegmentTemplate
        timescale="600"
        initialization="1261753-$RepresentationID$.dash"
        media="1261753-$RepresentationID$-$Time$.dash">
        <!-- 2020-06-25T03:54:06.520000Z / 1593057246 - 2020-06-25T06:07:48.280000Z -->
        <SegmentTimeline>
          <S t="955834347912" d="2304" r="2088" />
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation
        id="video=499968"
        bandwidth="499968"
        width="512"
        height="288"
        frameRate="25"
        codecs="avc1.4D401E"
        scanType="progressive">
      </Representation>
      <Representation
        id="video=749952"
        bandwidth="749952"
        width="640"
        height="360"
        frameRate="25"
        codecs="avc1.4D401E"
        scanType="progressive">
      </Representation>
      <Representation
        id="video=1000000"
        bandwidth="1000000"
        width="768"
        height="432"
        frameRate="25"
        codecs="avc1.4D401E"
        scanType="progressive">
      </Representation>
      <Representation
        id="video=1499968"
        bandwidth="1499968"
        width="864"
        height="486"
        frameRate="25"
        codecs="avc1.4D401F"
        scanType="progressive">
      </Representation>
      <Representation
        id="video=3000000"
        bandwidth="3000000"
        width="1280"
        height="720"
        frameRate="25"
        codecs="avc1.4D401F"
        scanType="progressive">
      </Representation>
      <Representation
        id="video=3899968"
        bandwidth="3899968"
        width="1280"
        height="720"
        frameRate="50"
        codecs="avc1.4D4020"
        scanType="progressive">
      </Representation>
    </AdaptationSet>
  </Period>
  <UTCTiming
    schemeIdUri="urn:mpeg:dash:utc:http-iso:2014"
    value="https://time.akamai.com/?iso" />
</MPD>

..and static one:

<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Unified Streaming Platform(version=1.9.5) -->
<MPD
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="urn:mpeg:dash:schema:mpd:2011"
  xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
  type="static"
  mediaPresentationDuration="PT2H13M45.600S"
  maxSegmentDuration="PT4S"
  minBufferTime="PT10S"
  profiles="urn:mpeg:dash:profile:isoff-live:2011,urn:com:dashif:dash264">
  <Period
    id="1"
    duration="PT2H13M45.600S">
    <BaseURL>dash/</BaseURL>
    <AdaptationSet
      id="1"
      group="1"
      contentType="audio"
      lang="en"
      segmentAlignment="true"
      audioSamplingRate="48000"
      mimeType="audio/mp4"
      codecs="mp4a.40.2"
      startWithSAP="1">
      <AudioChannelConfiguration
        schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
        value="2">
      </AudioChannelConfiguration>
      <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main" />
      <SegmentTemplate
        timescale="48000"
                initialization="1261753-$RepresentationID$.dash"
        media="1261753-$RepresentationID$-$Time$.dash">
        <!-- 2020-06-25T03:54:06.520000Z / 1593057246 - 2020-06-25T06:07:52.120000Z -->
        <SegmentTimeline>
          <S t="76466747832960" d="184320" r="2089" />
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation
        id="audio_1=128000"
        bandwidth="128000">
      </Representation>
    </AdaptationSet>
    <AdaptationSet
      id="2"
      group="2"
      contentType="video"
      par="16:9"
      minBandwidth="499968"
      maxBandwidth="3899968"
      maxWidth="1280"
      maxHeight="720"
      minFrameRate="25"
      maxFrameRate="50"
      segmentAlignment="true"
      sar="1:1"
      mimeType="video/mp4"
      startWithSAP="1">
      <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main" />
      <SegmentTemplate
        timescale="600"
                initialization="1261753-$RepresentationID$.dash"
        media="1261753-$RepresentationID$-$Time$.dash">
        <!-- 2020-06-25T03:54:06.520000Z / 1593057246 - 2020-06-25T06:07:52.120000Z -->
        <SegmentTimeline>
          <S t="955834347912" d="2304" r="2089" />
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation
        id="video=499968"
        bandwidth="499968"
        width="512"
        height="288"
        frameRate="25"
        codecs="avc1.4D401E"
        scanType="progressive">
      </Representation>
      <Representation
        id="video=749952"
        bandwidth="749952"
        width="640"
        height="360"
        frameRate="25"
        codecs="avc1.4D401E"
        scanType="progressive">
      </Representation>
      <Representation
        id="video=1000000"
        bandwidth="1000000"
        width="768"
        height="432"
        frameRate="25"
        codecs="avc1.4D401E"
        scanType="progressive">
      </Representation>
      <Representation
        id="video=1499968"
        bandwidth="1499968"
        width="864"
        height="486"
        frameRate="25"
        codecs="avc1.4D401F"
        scanType="progressive">
      </Representation>
      <Representation
        id="video=3000000"
        bandwidth="3000000"
        width="1280"
        height="720"
        frameRate="25"
        codecs="avc1.4D401F"
        scanType="progressive">
      </Representation>
      <Representation
        id="video=3899968"
        bandwidth="3899968"
        width="1280"
        height="720"
        frameRate="50"
        codecs="avc1.4D4020"
        scanType="progressive">
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>
Observed behaviour

When manifest type is changed into static, dash.js stops playback (see attached screenshot):
Screenshot 2020-06-25 at 9 11 50
It is possible to continue playback by tickling player's timeline but it is not ideal situation as it requires user's interaction.

Console output

See attached screenshot above.

@bbert
Copy link
Contributor

bbert commented Jun 25, 2020

Adressed by #3280. Have you check with current development version?

@tomraut
Copy link
Author

tomraut commented Jun 25, 2020

@bbert yes, this happens with the latest dev version too.

@bbert
Copy link
Contributor

bbert commented Jun 25, 2020

I think it stops playing because you really reach the end of the stream.
If you seek back to content start when starting playing, you should see that playback is still going on after manifest gets into static mode, until reaching end of stream.

@tomraut
Copy link
Author

tomraut commented Jun 25, 2020

I'll do another test tomorrow but I'm quite sure it didn't stop because of reaching end of the stream as I was able to resume playback by tickling timeline. When stream stopped/paused, I was ~19 minutes away from the end of it.

@bbert
Copy link
Contributor

bbert commented Jun 25, 2020

If you reproduce, will you be able to provide some test stream. I did my tests usng the one provided by mrp1977 (in issue #3263)

@tomraut
Copy link
Author

tomraut commented Jun 25, 2020

Sure thing, @bbert. Our "Morning news" stream starts tomorrow at 2020-06-26T03:55:00Z and it stops sometimes around 2020-06-26T09:10:00Z. I can add link to playable MPD here tomorrow morning.

@tomraut
Copy link
Author

tomraut commented Jun 26, 2020

@bbert
Copy link
Contributor

bbert commented Jun 26, 2020

It's already a static manifest, and which does not work since presentationTimeOffest is missing (while timeline use EPOCH) times)

@tomraut
Copy link
Author

tomraut commented Jun 26, 2020

Screenshot 2020-06-26 at 9 33 06 I can confirm that after manifest was changed from dynamic to static playback works now without any issues but timeline does not indicate user that this is in fact already static presentation as player shows constantly "-47:06" and not counting down. Do you @bbert mean by your previous comment that in order to make timeline work, there should be presentationTimeOffset?

@bbert
Copy link
Contributor

bbert commented Jun 26, 2020

OK great that's what I was expecting.
Indeed the timeline does not indicate to users that the stream became a static presentation since player keeps playing the live stream up to the end. In the player we do not convert the dynamic stream to a static one. We do ignore the static manifest and stop refreshing it, as specified in the IOP.
The way we suggest to handle NPVR streams while in recording state is to map progress bar/timeline to the record/program start and end dates.
If the user starts playing the record afterwhile it becames static (record has finished) then you can provide the timeline as for on-demand contents.

My previous comment was about the static manifest validity: if you want to keep the segments timestamps as in dynamic manifest (i.e. EPOCH times) then it is required you provide the presentationTimestampOffest.
The static stream is not playable, it should start from 0, but 1st video timestamp is 1593143665,72s

@dsilhavy
Copy link
Collaborator

@tomraut Did the comment of @bbert help you solving this issue?

@tomraut
Copy link
Author

tomraut commented Aug 4, 2020

@dsilhavy with 3.1.2 release dynamic => static transition seems to work just fine with except of the timeline/timecode issue I mentioned. Do you have any plans to improve that part later or is the recommendation for mapping progress bar/timeline to start/end dates still valid?

@maral21
Copy link

maral21 commented Feb 22, 2021

@bbert @tomraut I am dealing with this same issue, while playing a video with dashjs my manifest changes from dynamic to static, and it pauses. If I interact with the mouse over the timeline It works but as @tomraut said it is not the desired behaviour. I installed the 3.2.1 with this problem already, what happened, is it not fixed already?

@tomraut
Copy link
Author

tomraut commented Feb 23, 2021

@maral21 I haven't had this issue with 3.2.0 and I'm not able to try with 3.2.1 until next week but this doesn't sound good. I went quickly through changes in 3.2.1 but didn't notice anything particular. Perhaps @dsilhavy can comment on finding from @maral21 ?

@maral21
Copy link

maral21 commented Feb 23, 2021

@tomraut Thanks for your reply with 3.2.0 this issue is not present.

@stale
Copy link

stale bot commented Jul 23, 2021

This issue has been automatically marked as stale because it has not had recent activity. However, it might still be relevant so please leave a short comment if it should remain open. Otherwise the issue will be closed automatically after two weeks. Thank you for your contributions.

@stale stale bot added the stale To be used by automatic issue staling and closing to indicate that this issue is about to be closed label Jul 23, 2021
@stale
Copy link

stale bot commented Aug 6, 2021

This issue has been automatically closed because no further activity occurred. If you think this issue is still relevant please reopen it or contact @dsilhavy. Thank you for your contributions.

@stale stale bot closed this as completed Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale To be used by automatic issue staling and closing to indicate that this issue is about to be closed
Projects
None yet
Development

No branches or pull requests

4 participants