Skip to content
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

[MSS] Widevine pssh generation #2397

Merged

Conversation

bbert
Copy link
Contributor

@bbert bbert commented Jan 30, 2018

This goal of this PR is to synthesize the Widevine pssh for MSS+PR streams on-the-fly with KID value extracted from PlayReady manifest's ProtectionHeader field.

With the help of this PR, this is no more required to provide pssh as an input parameter in protectionData.

The source code to build the Widevine pssh according to Google Protocol Buffer has been generated using the protobuf.js project (https://github.com/dcodeIO/ProtoBuf.js).

The source for manipulating/generating Widevine pssh has been introduced only in MSS package, to avoid increasing the build/minified file size of dash.js (dash.all). Only the MSS package (dash.mss) is increased about around 18kB (due to protobufjs package dependency).

If afterwards there is some need for adding the option to override some field values of original pssh for any stream, we could then integrate this protobufjs library into protection package. This could be generalized for all key systems.

Bertrand Berthelot added 6 commits January 18, 2018 17:15
- do not use ProtectionController do get key systems string value and scheme ID URI
- generate (minimal) Widevine pssh with KID extracted from PlayReady ProtectionHeader
@sandersaares
Copy link
Member

Nice! This simplifies life. Do I understand it right that this feature activates automatically for any MSS stream with a ProtectionHeader? No activation needed by app developer?

I imagine hand-rolling the Widevine header object using byte manipulation (as is done for the PSSH box) would enable the size increase to be avoided. It is a rather tiny structure, so as long as nothing more involved is needed, perhaps this enables the feature to reach a wider set of users?

@bbert
Copy link
Contributor Author

bbert commented Jan 30, 2018

Yes, I confirm no activation needed by app developer, except of course providing license url.
By default, a Widevine ContentProtection node is added with a minimal pssh containing KID, algorithm (AES-CTR) and track type ('SD').

2 options:
1 - we provide a default pssh using byte manipulation to set KID value, then no possibility to custom the pssh at application level, but no increase in build file size
2 - we provide a mean to custom the pssh fields, using protobufjs library, but then inscrease the build file size

Personally, for the time being, option 1 is sufficient and acceptable.
Either we anticipate further needs, either wo do it as simple as possible for now, and keep in mind this solution for future needs.

@sandersaares
Copy link
Member

sandersaares commented Jan 30, 2018

What is the rationale behind the "SD" track type? Will hardcoding this value satisfy all expected use cases?

I guess the same question can be raised for the algorithm but this can likely be deferred until DASH-IF IOP defines something that talks about how to properly signal non-CTR content (I think there is no such signaling defined there now).

ksWidevine = keySystems[i];
break;
// Set box length value
pssh[i++] = (length & 0xFF000000) >> 32;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this probably be '>>> 24;' ? Move three bytes right and fill with zeros?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes of course! Thanks for pointing out. I will correct.

@bbert
Copy link
Contributor Author

bbert commented Jan 31, 2018

Hi @sandersaares,
Yes you're right about track type. I have removed it.
And for algorithm, we can also remove setting the value since the default value is assumed to be AESCTR.

@bbert
Copy link
Contributor Author

bbert commented Jan 31, 2018

Now the question is: do we inlude protobufjs dependency of do we simply provide the Widevine header with byte manipulation?

I am in favor of the simplest solution without increasing file, as long as nobody expresses the need for manipulating/overrinding the pssh.

@epiclabsDASH
Copy link
Contributor

epiclabsDASH commented Jan 31, 2018

"+ 1" for the simplest solution. I also prefer keeping the solution as simpler as possible and don't add complexity because something that is still not a real use case.

@epiclabsDASH epiclabsDASH added this to the v2.6.7 milestone Jan 31, 2018
@bbert
Copy link
Contributor Author

bbert commented Feb 1, 2018

OK. I have committed changes for simplest solution.

@epiclabsDASH epiclabsDASH merged commit 0d849a7 into Dash-Industry-Forum:development Feb 23, 2018
@bbert bbert deleted the mss-wv-pssh branch March 1, 2018 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants