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

Stream halts when transition from dynamic to static #3567

Closed
OrenMe opened this issue Aug 5, 2021 · 24 comments
Closed

Stream halts when transition from dynamic to static #3567

OrenMe opened this issue Aug 5, 2021 · 24 comments
Labels
priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@OrenMe
Copy link
Contributor

OrenMe commented Aug 5, 2021

Have you read the FAQ and checked for duplicate open issues?
Yes

What version of Shaka Player are you using?
3.0.13 and 3.2.0

Can you reproduce the issue with our latest release version?
yes

Can you reproduce the issue with the latest code from master?
NA

Are you using the demo app or your own custom app?
both

If custom app, can you reproduce the issue using our demo app?
yes

What browser and OS are you using?
Chrome on Mac

For embedded devices (smart TVs, etc.), what model and firmware version are you using?

What are the manifest and license server URIs?

I can't share the manifest url because nature of issue is dynamic, here is sample of dynamic manifest and static manifest where transition between dynamic to static causes the issue:

Dynamic manifest
<?xml version="1.0" encoding="utf-8"?>
<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" id="201" type="dynamic" publishTime="2021-08-05T14:32:51" minimumUpdatePeriod="PT4S" availabilityStartTime="2021-04-05T01:32:10.829000+00:00" minBufferTime="PT12S" suggestedPresentationDelay="PT20.000S" timeShiftBufferDepth="PT620.000S" profiles="urn:mpeg:dash:profile:isoff-live:2011">
  <Period start="PT0.000S" id="1">
    <AdaptationSet mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1" bitstreamSwitching="true">
      <Representation id="1" width="640" height="360" frameRate="25/1" bandwidth="736000" codecs="avc1.4D401E">
        <SegmentTemplate timescale="25000" media="manifest_video_2_0_$Number$.mp4?m=1616463675" initialization="manifest_video_2_0_init.mp4?m=1616463675" startNumber="2645811">
          <SegmentTimeline>
            <S t="264675416533" d="100000" r="156"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
      <Representation id="2" width="854" height="480" frameRate="25/1" bandwidth="1312000" codecs="avc1.4D401E">
        <SegmentTemplate timescale="25000" media="manifest_video_3_0_$Number$.mp4?m=1616463675" initialization="manifest_video_3_0_init.mp4?m=1616463675" startNumber="2645811">
          <SegmentTimeline>
            <S t="264675416533" d="100000" r="156"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
      <Representation id="3" width="1280" height="720" frameRate="25/1" bandwidth="2800000" codecs="avc1.4D401F">
        <SegmentTemplate timescale="25000" media="manifest_video_4_0_$Number$.mp4?m=1616463675" initialization="manifest_video_4_0_init.mp4?m=1616463675" startNumber="2645811">
          <SegmentTimeline>
            <S t="264675416533" d="100000" r="156"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
      <Representation id="4" width="1920" height="1080" frameRate="25/1" bandwidth="4499968" codecs="avc1.4D4028">
        <SegmentTemplate timescale="25000" media="manifest_video_5_0_$Number$.mp4?m=1616463675" initialization="manifest_video_5_0_init.mp4?m=1616463675" startNumber="2645811">
          <SegmentTimeline>
            <S t="264675416533" d="100000" r="156"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
    <AdaptationSet mimeType="audio/mp4" segmentAlignment="0" lang="und">
      <Label>und</Label>
      <Representation id="5" bandwidth="96123" audioSamplingRate="48000" codecs="mp4a.40.2">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></AudioChannelConfiguration>
        <SegmentTemplate timescale="48000" media="manifest_audio_1_0_$Number$.mp4?m=1616463675" initialization="manifest_audio_1_0_init.mp4?m=1616463675" startNumber="2645811">
          <SegmentTimeline>
            <S t="508176800192" d="192512"/>
            <S t="508176992704" d="191488"/>
            <S t="508177184192" d="192512"/>
            <S t="508177376704" d="191488"/>
            <S t="508177568192" d="192512"/>
            <S t="508177760704" d="191488"/>
            <S t="508177952192" d="192512"/>
            <S t="508178144704" d="191488"/>
            <S t="508178336192" d="192512"/>
            <S t="508178528704" d="191488"/>
            <S t="508178720192" d="192512"/>
            //removed some lines here to reduce length...
            <S t="508206176704" d="191488"/>
            <S t="508206368192" d="192512"/>
            <S t="508206560704" d="191488"/>
            <S t="508206752192" d="192512"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
    <AdaptationSet mimeType="application/mp4" codecs="stpp" segmentAlignment="true" startWithSAP="1" bitstreamSwitching="true" lang="en">
      <Label>English</Label>
      <Representation id="6" bandwidth="0">
        <SegmentTemplate timescale="90000" media="manifest_subtitles_6_0_$Number$.mp4?m=1616463675" initialization="manifest_subtitles_6_0_init.mp4?m=1616463675" startNumber="2645811">
          <SegmentTimeline>
            <S t="952831499520" d="360000" r="156"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
    <SupplementalProperty schemeIdUri="urn:scte:dash:utc-time" value="2021-04-05T01:32:04.025Z"></SupplementalProperty>
  </Period>
</MPD>
Static manifest
<?xml version="1.0" encoding="utf-8"?>
<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" id="201" type="static" mediaPresentationDuration="PT632.000S" minBufferTime="PT12S" profiles="urn:mpeg:dash:profile:isoff-main:2011">
  <Period start="PT0.000S" id="1" duration="PT10587648.661S">
    <AdaptationSet mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1" bitstreamSwitching="true">
      <Representation id="1" width="640" height="360" frameRate="25/1" bandwidth="736000" codecs="avc1.4D401E">
        <SegmentTemplate timescale="25000" media="manifest_video_2_0_$Number$.mp4?m=1616463675" initialization="manifest_video_2_0_init.mp4?m=1616463675" startNumber="2645811" presentationTimeOffset="264675416533">
          <SegmentTimeline>
            <S t="264675416533" d="100000" r="157"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
      <Representation id="2" width="854" height="480" frameRate="25/1" bandwidth="1312000" codecs="avc1.4D401E">
        <SegmentTemplate timescale="25000" media="manifest_video_3_0_$Number$.mp4?m=1616463675" initialization="manifest_video_3_0_init.mp4?m=1616463675" startNumber="2645811" presentationTimeOffset="264675416533">
          <SegmentTimeline>
            <S t="264675416533" d="100000" r="157"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
      <Representation id="3" width="1280" height="720" frameRate="25/1" bandwidth="2800000" codecs="avc1.4D401F">
        <SegmentTemplate timescale="25000" media="manifest_video_4_0_$Number$.mp4?m=1616463675" initialization="manifest_video_4_0_init.mp4?m=1616463675" startNumber="2645811" presentationTimeOffset="264675416533">
          <SegmentTimeline>
            <S t="264675416533" d="100000" r="157"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
      <Representation id="4" width="1920" height="1080" frameRate="25/1" bandwidth="4499968" codecs="avc1.4D4028">
        <SegmentTemplate timescale="25000" media="manifest_video_5_0_$Number$.mp4?m=1616463675" initialization="manifest_video_5_0_init.mp4?m=1616463675" startNumber="2645811" presentationTimeOffset="264675416533">
          <SegmentTimeline>
            <S t="264675416533" d="100000" r="157"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
    <AdaptationSet mimeType="audio/mp4" segmentAlignment="0" lang="und">
      <Label>und</Label>
      <Representation id="5" bandwidth="96123" audioSamplingRate="48000" codecs="mp4a.40.2">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></AudioChannelConfiguration>
        <SegmentTemplate timescale="48000" media="manifest_audio_1_0_$Number$.mp4?m=1616463675" initialization="manifest_audio_1_0_init.mp4?m=1616463675" startNumber="2645811" presentationTimeOffset="508176799744">
          <SegmentTimeline>
            <S t="508176800192" d="192512"/>
            <S t="508176992704" d="191488"/>
            <S t="508177184192" d="192512"/>
            <S t="508177376704" d="191488"/>
            //removed some lines here to reduce length...
            <S t="508205984192" d="192512"/>
            <S t="508206176704" d="191488"/>
            <S t="508206368192" d="192512"/>
            <S t="508206560704" d="191488"/>
            <S t="508206752192" d="192512"/>
            <S t="508206944704" d="191488"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
    <AdaptationSet mimeType="application/mp4" codecs="stpp" segmentAlignment="true" startWithSAP="1" bitstreamSwitching="true" lang="en">
      <Label>English</Label>
      <Representation id="6" bandwidth="0">
        <SegmentTemplate timescale="90000" media="manifest_subtitles_6_0_$Number$.mp4?m=1616463675" initialization="manifest_subtitles_6_0_init.mp4?m=1616463675" startNumber="2645811" presentationTimeOffset="952831499520">
          <SegmentTimeline>
            <S t="952831499520" d="360000" r="157"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
    <SupplementalProperty schemeIdUri="urn:scte:dash:utc-time" value="2021-04-05T01:32:04.025Z"></SupplementalProperty>
  </Period>
</MPD>

What configuration are you using? What is the output of player.getConfiguration()?

default config, didn't change anything

What did you do?

play a live dynamic manifest
seek to start of sliding window
wait till it turns to static

What did you expect to happen?
because I seek back then when manifest turned from dynamic to static I expect playback to continue until the end of the remaining duration of playback

What actually happened?

The playback stops immediately when manifest turn from dynamic to static
A warning appears in the console There is a gap/overlap between Periods
image

See manifest data for transition between dynamic to static in section above.
The expectation is that it will behave like HLS event playlist where a user can watch a live event, seek back to the beginning and view it, in the meanwhile the even is over and level playlist gets appended with EXT-X-ENDLIST but playback keeps going cause user is in DVR part of the stream and only when it reaches the last segment playback stops like a VOD stream.

This is related to another issue that I asked in #3376

Maybe we need to apply same fix here that the reference duration will be taken from either maxSegmentEndTime_ and if not applicable then duration_ or just reset reference givenDuration to some value when manifest transitions from dynamic to static in DashParser.parsePeriods_?

@OrenMe
Copy link
Contributor Author

OrenMe commented Aug 10, 2021

@joeyparrish any chance someone can look into this, I can provide more details if required

@OrenMe
Copy link
Contributor Author

OrenMe commented Aug 25, 2021

Can anyone review this and help?

@OrenMe
Copy link
Contributor Author

OrenMe commented Sep 12, 2021

Hi, any chance for someone to take a look?

@OrenMe
Copy link
Contributor Author

OrenMe commented Sep 20, 2021

@joeyparrish can you please check this issue? I previously sent a test stream over email but I guess it is invalid now, I can provide another one if needed

@TheModMaker
Copy link
Contributor

The problem is that the segments in the manifest change times with the manifest update. In the dynamic manifest, the segments have segment times near 10,000,000 seconds; but in the static manifest, they are shifted back to 0. Changing segment times in an update isn't supported. According to #3376, you should set the Period@start attribute of the first Period to adjust the first segment to appear at the same time as it did before.

@OrenMe
Copy link
Contributor Author

OrenMe commented Sep 20, 2021

Thanks @TheModMaker, the linked ticket was the first issue we encountered and you can see I commented there as well. This fix actually solved the issue with loading the generated manifest after it transitioned from dynamic to static, but I missed the other part about changing the segments timing.
I'll check that with the stream provider.

@joeyparrish joeyparrish added type: bug Something isn't working correctly and removed needs triage labels Sep 27, 2021
@joeyparrish
Copy link
Member

@OrenMe, please accept our apologies for taking so long to respond to this issue the first time. We are working on our issue-handling process and tools to try to improve our response times.

To follow up on your previous comment, have you had a chance to check with the stream provider?

@shaka-bot shaka-bot added this to the v3.3 milestone Oct 1, 2021
@joeyparrish joeyparrish added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Oct 4, 2021
@OrenMe
Copy link
Contributor Author

OrenMe commented Oct 5, 2021

Hi @joeyparrish, I'm sure you are extremely busy so appreciate that.
I'm still waiting on a response from the vendor and will update as soon as I get an answer.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Oct 5, 2021
@joeyparrish joeyparrish added the priority: P2 Smaller impact or easy workaround label Oct 5, 2021
@OrenMe
Copy link
Contributor Author

OrenMe commented Oct 28, 2021

Hi @joeyparrish , sorry it took so long, so this an AWS stream and according to the team they are spec compliant and shared some more details that seem to indicate I ned to manage this in the player side.
I tried to test it in dash.if reference player and some additional ones not using shaka and it seems to handle it correctly, but I still don't know what is the issue.Would you be able to test this on your side as well if I'll share a test stream?
I will share an email with a test stream which is available for you to try.

In addition, the stream I'm testing fails on latest version of the player, it works on 3.2.0, but not on 3.2.1 and also on 3.1.2 but not on 3.1.3 so it is possibly something in latest version, my initial suspicion is with this fix 'Fix tracking of active variant track in live streams'

@OrenMe
Copy link
Contributor Author

OrenMe commented Nov 1, 2021

@joeyparrish does this help? were you able to review the email and test with the test link?
I read a bit more and asked around in video-dev on it and stumbled on a link to discussion in exoplayer google/ExoPlayer#4780 around that matter that led to another one in dash-if Dash-Industry-Forum/Guidelines-TimingModel#31 but I'm still don't know if this also relates to how shaka handles this

@OrenMe
Copy link
Contributor Author

OrenMe commented Nov 8, 2021

Hi @joeyparrish did you get a chance to review the details and test stream sent over the email?

@caridley
Copy link
Contributor

We are also having problems when a cloud DVR stream transitions from dynamic to static during playback. We have reproduced our problem with Shaka 3.1.2 and 3.2.1. Our problem does not occur with Shaka 2.5.22

@OrenMe
Copy link
Contributor Author

OrenMe commented Nov 15, 2021

thanks for the feedback @caridley , @joeyparrish any chance to get this checked?

@rhyswilliamsza
Copy link

rhyswilliamsza commented Nov 17, 2021

I have also experienced this issue on my Chromecast receivers since the SDK was updated to use Shaka v3.0.13. My streams are generated by FFMPEG, and move from dynamic to static once encoding has been completed.

I think this may have been caused by #3567 or #3419, though I'm totally guessing here. Everything worked fine on v3.0.10. Haven't checked versions in between, but I'll do a few tests and get back to you asap!

@OrenMe
Copy link
Contributor Author

OrenMe commented Nov 24, 2021

@joeyparrish would appreciate your feedback here, not sure where to even start looking

@OrenMe
Copy link
Contributor Author

OrenMe commented Dec 13, 2021

@joeyparrish any update?

@caridley
Copy link
Contributor

caridley commented Jan 6, 2022

@OrenMe Our specific problem with dynamic to static transitions has been fixed with the fix for #3675 in the 3.0.15, 3.1.4 and 3.2.2 releases

@OrenMe
Copy link
Contributor Author

OrenMe commented Jan 7, 2022

Thanks @caridley ! Will check it as soon as I'm back in the office.

@yairans
Copy link

yairans commented Jan 18, 2022

The issue still exists on 3.3.0 version. @joeyparrish can you please check this issue?

@avelad avelad modified the milestones: v3.3, v4.1 May 4, 2022
@avelad avelad modified the milestones: v4.1, v4.2 Jun 3, 2022
@glhvta
Copy link
Contributor

glhvta commented Jul 22, 2022

We faced the same issue when transition from 'dynamic' to 'static' content happens on Chromecast app (shaka version 3.0.13) and Web app with shaka (shaka version 3.2.1).

Could please someone share the latest status of this issue?

Thanks.

@joeyparrish
Copy link
Member

Is the issue still present in the latest releases? (v3.2.10, v3.3.8, v4.0.4, v4.1.2)

@glhvta
Copy link
Contributor

glhvta commented Aug 4, 2022

Hi @joeyparrish. I just checked behavior on the latest shaka release 3.2.10 and it looks like the issue is not reproduced.

On the same stream when switching from dynamic to static:

  • v3.2.1 stream halts
  • v3.2.10 stream continues to play till the end of asset

@avelad avelad modified the milestones: v4.2, v4.3 Aug 17, 2022
@SivanA-Kaltura
Copy link

SivanA-Kaltura commented Nov 9, 2022

Hello @joeyparrish.
To update about the current state of the issue, our customer is using a set of manifests that transition from dynamic to static. I can't provide a working example currently, but these are examples of the enclosing mpd elements:

<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" id="201" type="dynamic" publishTime="2022-11-08T08:08:18" minimumUpdatePeriod="PT4S" availabilityStartTime="2021-04-15T12:42:29.396000+00:00" minBufferTime="PT12S" suggestedPresentationDelay="PT20.000S" timeShiftBufferDepth="PT544.000S" profiles="urn:mpeg:dash:profile:isoff-live:2011">

<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" id="201" type="static" mediaPresentationDuration="PT1324.000S" minBufferTime="PT12S" profiles="urn:mpeg:dash:profile:isoff-main:2011">

Shaka doesn't automatically set currentTime after the transition, which causes playback to immediately end, regardless of the currentTime position before the switch. In addition it looks like seeking after the switch is made can cause a stall, possibly similar to #3902 or #2581.

A solution of saving [shaka.seekRange.end - video.currentTime] and using it to set currentTime after the transition (using responseFilter handler) works pretty well on versions 3.3.0 to 3.3.2, however from version 3.3.3 and onwards (probably because of the fix in 11f998d), calling shaka.seekRange.end in the response filter handler now returns the seekRange for the STATIC manifest, which means we can't set the currentTime correctly anymore.

My question is - is the problem with setting the currentTime caused by an issue on the manifest side, on Shaka side, or on our side ?
The simplest fix would probably be for us to save the value of seekRange.end at a point before it changes, if that's possible.

Thanks,
Sivan

@joeyparrish
Copy link
Member

If the presentation timeline changes on transition, we can't support that. For example, if segment 12 has presentation time 48300 before the transition, but presentation time 500 after the transition, you've just broken the timeline, and everything Shaka has already buffered now disagrees with the manifest.

If the timeline is stable when transitioning from dynamic to static, it should work. If it doesn't, it's a bug in the player.

Since in #3567 (comment), @glhvta confirmed that the original issue was fixed in v3.2.10, I think this issue should be closed. @SivanA-Kaltura, if your content timeline is stable as I described, please open a new issue and follow all the instructions in the issue template (including content links so that we can reproduce the issue). Thanks!

@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jan 8, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

10 participants