-
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
feat(dash): Improve DASH SegmentTemplate performance with on-demand segment references #5061
feat(dash): Improve DASH SegmentTemplate performance with on-demand segment references #5061
Conversation
Incremental code coverage: 99.10% |
I have tested on several TVs and the performance is better than before, I still have to do the code review. |
Overall, I'm very impressed with the performance improvements. Thank you so much for contributing! My main concern is that we take care of edge cases, especially around fitting segments to the period. |
Please merge with main. I just fixed some test failures, and I'd like to see a clean test pass before I merge this. The PR looks good, though. Thanks! |
Background
This is a performance optimization intended to reduce the Video Start Time for DASH streams, both VOD and Live, by reducing the amount of processing done during manifest parse time. This is especially effective for long multi-period assets, assets with many variants, or on low end devices in general. I've provided some measurements showing the performance improvements at the conclusion of this PR.
Currently, during manifest parse time for a Segment Template, Shaka will loop through the entire timeline and create segment references for each timeline entry. For a long asset, or an asset with many tracks, this is a significant amount of processing.
Solution
I've created a new entity called the Timeline Segment Index that extends the SegmentIndex interface. The purpose of the Timeline Segment Index is to ingest a timeline during construction, and then use that information to build Segment References only on demand. This removes the need to parse the entire timeline and create all of the Segment References during parse time.
Results/Measurements
The effects of this change aren't quite as apparent on desktop web browsers, given their speed and power. This improvement really shines on lower end TVs on assets with a long timeline.