Skip to content

Commit

Permalink
feat(dash): Improve DASH SegmentTemplate performance with on-demand s…
Browse files Browse the repository at this point in the history
…egment references (#5061)

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.

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.

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.

DASH parsing speed-ups in some cases can be as much as 40%.

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
  • Loading branch information
nrcrast and joeyparrish authored Apr 29, 2023
1 parent a8e3c9a commit f1c5a1c
Show file tree
Hide file tree
Showing 6 changed files with 745 additions and 33 deletions.
2 changes: 2 additions & 0 deletions lib/dash/mpd_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@ shaka.dash.MpdUtils = class {
* The start time of the range in representation timescale units.
* @property {number} end
* The end time (exclusive) of the range.
*
* @export
*/
shaka.dash.MpdUtils.TimeRange;

Expand Down
Loading

0 comments on commit f1c5a1c

Please sign in to comment.