dash.js icon indicating copy to clipboard operation
dash.js copied to clipboard

Manifest parser as an external module

Open wilaw opened this issue 6 years ago • 3 comments

[posting on behalf of Shachar at Peer5]

As part of our progress in supporting DASH, we have found the need to upgrade our DASH manifest parser.Instead of upgrading and maintaining our own parser, we'd like to use dash.js's

We tried doing that, and indeed using just the DashParser.js module is easy and returns a valid JS object that we can work with, but unfortunately it is not enough for us, as we need some additional utility functions to digest that parsed manifest.

Those utility functions mostly exist in dash.js in one way or another, but they are not easily extractable from dash.js itself without doing a lot of twist & turns in order to get them work (Handling dependency injection, passing correct context, etc).

Would it be possible to either extract the entire manifest parsing & utility functions to either an external module that can be "require"ed separately from dash.js, or keep them inside dash.js but make them "require"able without having to initialize complex configurations?

Specifically the utility functions that we're looking for are:

  1. Get a list of all the segments in a representation (Or up to a given limit). Similar to getSegments - https://github.com/Dash-Industry-Forum/dash.js/blob/v2.6.7/src/dash/utils/SegmentsGetter.js#L54
  2. Reverse representation lookup - Given a URL of a segment, we would like a way to find which representation that segment belongs to (We can probably do it ourselves, given that all of the template variables are exposed on the representation)
  3. Calculate duration between two segments (Not necessarily adjacent ones) - We would like a function to return the duration in milliseconds between two segment URLs (And given a representation of course).
  4. Get the last available segment in a representation - As DASH manifests are mostly static and contain the needed information to calculate which segments are available on the server at any given point in time, we would like a method that exposes that functionality given a specific representation.

Let me know what you think, Thanks!

wilaw avatar Apr 24 '18 23:04 wilaw

Closely related to https://github.com/Dash-Industry-Forum/dash.js/issues/1428.

davemevans avatar Apr 25 '18 09:04 davemevans

any update?

shacharz avatar May 27 '18 09:05 shacharz

@shacharz, I am fully ok with this feature suggestion, that will be useful for many tools/projects related with MPEG-DASH streams (myself needed something like this many times when building monitoring tools for MPEG-DASH streams, for example).

Given said this, we are planning some important refactor changes for dash.js 3.0. Many of them are related with the way segments are retrieved from the manifest so that would be a good time to start separating the manifest parser as an external module. We will keep this requirement in mind.

Thanks!

epiclabsDASH avatar May 30 '18 07:05 epiclabsDASH