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 multiperiod with advert, crashes after 15min loop on "cannot read properties of null" #3800

Closed
Murmur opened this issue Oct 29, 2021 · 9 comments
Assignees
Labels
Milestone

Comments

@Murmur
Copy link

Murmur commented Oct 29, 2021

Player https://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html 4.1.1 (development, commit: 83c9f6d3)
Manifest(broken timeline) https://refapp.hbbtv.org/videos/multiperiod_test6.php
New manifest without adverts https://refapp.hbbtv.org/videos/multiperiod_test6c.php

  • vod segments as a continuous live type="dynamic" manifest loop
  • main periods, advert(12s) period every 1min
  • mark a seamless link between main periods
    <SupplementalProperty schemeIdUri="urn:mpeg:dash:period-connectivity:2015" value="p68146143"/>
  • trigger urn:mpeg:dash:event:2012@value=1 refresh event in a manifest
    <EventStream schemeIdUri="urn:mpeg:dash:event:2012" value="1" timescale="1000"><Event presentationTime="4000" id="68146148091"/></EventStream>
  • trigger a custom mpd events in a manifest
    <EventStream schemeIdUri="http://hbbtv.org/refapp" value="1a2b3c" timescale="1000"><Event presentationTime="1000" duration="2000" id="68146148">MPD event(p68146148,1s)</Event></EventStream>

Content: main periods, advert(12s) period every 1min, served as a live manifest

Dashjs sometimes gives a jumping gap occuring in period... but I don't know why, content should use a constant segment lengths.

Dashjs crashes after ~15min for cannot read properties of NULL error.

Requesting seek to time: 1635507852 (internal) 
Debug.js:169 [824918][GapController] Jumping gap occuring in period p68146155 starting at 1635507828 and ending at 1635507852. Jumping by: 0.10000000000000142 
...
14:47:30 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'accessibility')
 at _getAllMediaInfo (DashAdapter.js:231)
    at Object.getAllMediaInfoForType (DashAdapter.js:311)
    at _initializeMediaForType (Stream.js:320)
    at Stream.js:284
    at Array.forEach (<anonymous>)
    at Stream.js:282
    at new Promise (<anonymous>)
    at _commonMediaInitialization (Stream.js:273)
    at _initializeMedia (Stream.js:236)
    at Stream.js:214
@Murmur Murmur added the Bug label Oct 29, 2021
@dsilhavy
Copy link
Collaborator

dsilhavy commented Nov 6, 2021

I think there are two problems here:

  • Content problem: The timeShiftBufferDepth is set to PT1H but there is not enough content in the MPD to fulfill this DVR window
  • Player problem: dash.js periodically compares the currenttime against the DVR window. If the currenttime is outside of the DVR window we do a seek. There seems to be a late update of the MPD containing the new periods. dash.js runs in kind of a race condition: currenttime is larger than DVRWindow.end . dash.js initializes a seek to a period that has been removed in the current version of the MPD. That leads to a nullpointer exception. I think we should pause the DVR window check and potential seeks when an MPD update is in progress.

I did some tests in Shaka and Bitmovin and both fail for me at the ad period boundaries. Might be something to check as well.

@dsilhavy
Copy link
Collaborator

dsilhavy commented Nov 6, 2021

Please also add a minimumUpdatePeriod. From 23009-1:

@minimumUpdatePeriod: If this attribute is not present, it indicates that the MPD does not change.

@Murmur
Copy link
Author

Murmur commented Nov 6, 2021

Thanks, will double check a manifest run a new test. Yes after a while manifest loses a maincontent period or maincontent+advert periods between the previous and fresh manifest snapshot.

It's simply using a hardcoded timeShiftBufferDepth value as we are testing a live stream. Segments are from a static manifest repeating an infinite loop so they are always infinitely available backward and also forward.
....
Manifest does want to use @minimumUpdatePeriod but urn:mpeg:dash:event:2012@value=1 refresh event in a manifest. Do you mean should have like a foodoo @minimumUpdatePeriod="PT99999H" value, then MDP reload events are still invoked as currently is happening?

@dsilhavy
Copy link
Collaborator

dsilhavy commented Nov 8, 2021

  • The problem with timeShiftBufferDepth is that it is not reflected in the periods of this MPD. Players like dash.js will compensate for that by adjusting the DVR window based on the period boundaries. However, at some point periods are removed that are still in the timeShiftBufferDepth which might lead to inconsistencies in some players.
  • I think the missing @minimumUpdatePeriod is the reason the stream stalls in Shaka and Bitmovin. There seems to be no reload of the MPD.
  • Overall I assume there is a timing issue at some point which causes dash.js to fail. I applied the changes in described above but the stream still fails after some minutes.

Is there any player that is able to play the stream longer than some minutes?

@dsilhavy
Copy link
Collaborator

dsilhavy commented Nov 8, 2021

This might help you debugging the stream. Two consecutive MPDs:

--- MPD 1 ---

First period: id="p68182698" : start: PT1636384848S
....
Last period: id="ad68182702" : endtime (summed up duration of all periods): 1636385004 


--- MPD 2 ---
First period: id="p68182704" start="PT1636385028S"

In my opinion there is a gap between the two MPDs. This is indicated by:

  • The Period@id values, p68182703 and adp68182703 are missing
  • The difference between the endtime of the last period in MPD 1 and the starttime of the first period in MPD2:
    1636385028 - 1636385004 = 24

In addition: When the error happens the currently active period in the player is removed from the MPD. For instance, in the example above dash.js was playing period "p68182702". This period is removed in the MPD update (MPD2).

@dsilhavy dsilhavy self-assigned this Nov 10, 2021
@Murmur
Copy link
Author

Murmur commented Nov 12, 2021

I made a better stream without an advert breaks. All periods are from the main content. My naive bug in timeShiftBufferDepth fixed, a full backlog time window is now visible in all manifest reloads. No more NULL error. Will create a new test with adverts later.

I don't use minimumUpdatePeriod because testing a MpdRefresh events. I have no answer how should minUpdatePeriod really be set as idea is not to use an even interval for mpd requests.

https://refapp.hbbtv.org/videos/multiperiod_test6c.php

@dsilhavy
Copy link
Collaborator

Thanks for sharing, stream seems to run fine.

@dsilhavy
Copy link
Collaborator

@Murmur Can I close this issue since the problems seem to be stream related?

@Murmur
Copy link
Author

Murmur commented Nov 18, 2021

@dsilhavy Yes please, I have a new test stream coming up soon in few days, will create new tickets if something else arise.

  • this content is vod-to-live scripting so need very finetuned timeline handling to make things work (with main content and adverts).

@dsilhavy dsilhavy added this to the 4.1.1 milestone Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants