Dash-Industry-Forum / livesim2

DASH Live Source Simulator v2 in Go
Other
36 stars 6 forks source link

Enhanced Clear Key Content Protection with on-the-fly encryption #150

Closed tobbee closed 8 months ago

tobbee commented 8 months ago

This PR implements support for encrypting streams on the fly using either "cbcs" or "cenc" scheme and fetching the keys over HTTP towards the server. The keys and key IDs are generated from the asset name and related to each other which allows for easy lookup and generation.

Both normal and low-latency streaming should be supported. The video and audio segments are encrypted in an extra process round. The init segments also need to be prepared. That is done when ingesting the content. At the same time, it is checked whether the segments are already encrypted, in which case the extra encryption information is not stored.

Pre-encrypted content should also work. Has been tested with an HbbTV asset provided in #122 (after changing the spelling of Laurl and the namespace).

The URL generator has been updated with the new option for eccp.

This solves #122.