-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Refactor to derive live edge from list of segments #999
Comments
This is an issue we may be running into in our application. I haven't done a complete investigation yet. But since I'm pretty sure someone will ask me -- May I ask, is this refactoring being worked on currently? Is there a (rough) estimate for when the work will be done? Thanks. |
We are not working on it yet, primarily because we aren't yet sure how best to do the refactoring. |
Ok thanks Joey 👍 |
There are two ways Playhead should be able to recover from a drifting stream: 1. Wait until the initial position is available 2. Seek to another position Neither of these was working. For one, we couldn't detect seeks before content was loaded. For another, we were constantly updating the initial streaming position, so a drifted stream would never catch up to our expectations. This fixes both issues so that a drifting stream can at least recover. Relates to issue #999 (drift tolerance) Closes #1105 Change-Id: I8d2eedcff25b92b42ecd2e1f361d45ecbddd26ba
There are two ways Playhead should be able to recover from a drifting stream: 1. Wait until the initial position is available 2. Seek to another position Neither of these was working. For one, we couldn't detect seeks before content was loaded. For another, we were constantly updating the initial streaming position, so a drifted stream would never catch up to our expectations. This fixes both issues so that a drifting stream can at least recover. Relates to issue #999 (drift tolerance) Closes #1105 Change-Id: I8d2eedcff25b92b42ecd2e1f361d45ecbddd26ba
Hey @joeyparrish, once this is done, it looks like you may be able get rid of |
@joeyparrish can you confirm, with this change, that Shaka would ignore device time for |
Yes. With this change, only |
One thing i cannot understand, encoder makes stream in unstopable way (if some drift happens then it will not make segment less or more by time (for example if drift one second back, then segment will be any way for 5 seconds as configured)) In HLS there is a timestamp can be shown explicitly via #EXT-X-PROGRAM-DATE-TIME for every 5 seconds (when ts segments for 5 seconds for example) and if drift happens then this tag can be changed and player will use correct time. In DASH if template is used, then i dont get how player will know that drift happened if segmetns still the same length in seconds? I thought that multi-period should help in this case. |
@kuznetcoff777 I think this http://www.unified-streaming.com/blog/stop-numbering-underappreciated-power-dashs-segmenttimeline can help you understand how it is possible to signalize discontinuities in Dash. |
@joeyparrish perfect! cannot wait to see it & test it! 👍 |
@joeyparrish Is it possible include this change in 2.4.4? |
I found a bug in the implementation which needs to be corrected, so I'm reopening this issue. @avelad, I won't include this in v2.4.4 because it's a major behavior change and comes with some amount of risk. I think the fact that I didn't get it right the first time supports this decision. :-) I am planning to release a couple of betas for v2.5, though. If you're willing to try out a beta, you can have this feature before v2.5.0 is final. |
Oh, and I forgot to explain the bug I found: it only works for single-period content where the period starts at 0. The timestamps I'm using to compute the live edge are relative to the period, but they should have been relative to the presentation. |
In HLS, the live edge of a presentation seems to be derived from the list of segments. In DASH, the live edge is (currently, in our implementation) derived from the
availabilityStartTime
attribute and the current time.But even in DASH, there are multiple ways one could compute the live edge. With
<SegmentList>
or<SegmentTemplate>
+<SegmentTimeline>
, we get an explicit list of segments, much like in HLS. Only in<SegmentTemplate>
with theduration
attribute do we lack this explicit list, in which caseavailabilityStartTime
is the only option. So although our current model matches the DASH spec, it does not match the majority of what we see in practice.In cases of encoder drift, the actual segments differ from the idealized live edge we compute based on
availabilityStartTime
. (This type of drift could occur in HLS, as well.) When this happens, we are limiting ourselves by only working with this ideal live edge, rather than the effective live edge based on the segments.When we encounter drift in live DASH today, we see issues as soon as the drift is larger than
presentationDelay
. When that happens, the player can never reach the live edge. Playback can continue further back from the edge, but eventually, drift can also overtaketimeShiftBufferDepth
. When this happens, the actual segments are completely outside of the seek range, which leaves the player unable to play anything at all.To improve our resilience in these scenarios, we should compute the live edge based on the list of segments. In this case, drift would cause occasional buffering events, but playback could recover indefinitely.
The text was updated successfully, but these errors were encountered: