shaka-player: Clear Key problem : new implementation of a Common Encryption packager
EDIT : it work both with shaka-player and dashjs in firefox. Not in chrome. EDIT2 : implementing sub sample it work now both with shaka-player and dashjs in Chrome. Not in Firefox… EDIT3 : it seems to work ! need some clarification and adjustment.
A bit of context first: (and sorry if this not really a shakaplayer issue, but I know there are very competent persons reading here). And sorry for the crosspost on the dashjs but the issue is generic…
I’ve started coding/adding common-encryption to nginx-rtmp module dash packager. The reasons are :
- there a not so much live dash DRM (wdv, playready) enabled solution (USP have one but bases on smooth ingest which are … old, elemental need to much module
- having an open source could be cool
- we already use a patched nginx-rtmp in production to handle client side ad insertion, which basically convert SCTE35 message to emsg box. It work well for us, so using something different for live streaming will need to rework with vendor this feature.
After some weeks reading the spec, and some weeks of coding I think I am not too far from success. I can write encrypted fragment, made signalisation in init file. Decrypting it with mp4decrypt from bento4 tools (appending init and fragment file) result in a playable mp4. So my code should not be completely crap.
Code is here : https://github.com/ut0mt8/nginx-rtmp-module/tree/cenc/dash/
The next step is to test with clear key drm system (I will handle wdv and playready after if it work) And obviously it do not work for now.
My test page is here : https://futomaki.net/player/shaka/ The manifest is here : https://aws.futomaki.net/dash/live/index.mpd
KID is
- F10DF10DF10DF10DF10DF10DF10DF10D (hex)
- 8Q3xDfEN8Q3xDfEN8Q3xDQ (base64)
KEY is
- F00DF00DF00DF00DF00DF00DF00DF00D (hex)
- 8A3wDfAN8A3wDfAN8A3wDQ (base64)
Observed behaviour
The content did not play 😕
Console output
"Error: Shaka Error MEDIA.VIDEO_ERROR (3,,CHUNK_DEMUXER_ERROR_APPEND_FAILED: Failed to prepare video sampl
Any help, advices are welcome. If you notice something not conform or else don’t hesitate 😉
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (8 by maintainers)
I can get it to play in Firefox. My guess is Chrome doesn’t support full-sample encryption.
When I started I was thinking I ve never get it to work and I am a fool to try to implement it. And finaly even with widevine it work. Just before the Word cup 😃
Glad I could help. If you have any more questions, feel free to ask.