Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.09k stars 1.67k forks source link

Manifest parser as an external module #2550

Open wilaw opened 6 years ago

wilaw commented 6 years ago

[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!

davemevans commented 6 years ago

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

shacharz commented 6 years ago

any update?

epiclabsDASH commented 6 years ago

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