question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refactor to derive live edge from list of segments

See original GitHub issue

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 the duration attribute do we lack this explicit list, in which case availabilityStartTime 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 overtake timeShiftBufferDepth. 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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
joeyparrishcommented, Jul 23, 2018

Hi everyone,

I had plans to solve this as part of a larger refactor, which is described in #1339. I now think this should be solved in a simpler way, by just modifying the DASH parser. I still plan to refactor things in #1339, but there’s no reason this issue needs to be dependent on that.

1reaction
leandromoreiracommented, Jul 22, 2018

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

An example of preparatory refactoring
This is where I'm adding a new feature, and I see that the existing code is not structured in such a way that...
Read more >
What is Code Refactoring? How Refactoring Resolves ...
Code refactoring is defined as the process of restructuring computer ... code review – the last chance to clean up code before it...
Read more >
Best way to refactor methods that have the same code but ...
I'd extract the unique part of the code to a Supplier , move the common code to one method, and have the original...
Read more >
Refactoring Software Packages via Community Detection ...
And it finally provides a list of classes as refactoring candidates by comparing the optimized package structures with the real package ...
Read more >
Refactoring a monolith into microservices
Decouple by domain-driven design; Prioritize services for migration; Extract a service from a monolith; Manage a monolithic database; Reference tables.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found