axiomatic-systems / Bento4

Full-featured MP4 format, MPEG DASH, HLS, CMAF SDK and tools
http://www.bento4.com
2k stars 482 forks source link

Not possible to set distinct PSSH data for different encryption key(s)/keyid(s) #257

Open KarlGallagher opened 6 years ago

KarlGallagher commented 6 years ago

Hi,

Whilst it is possible to set filters/mapping on encryption keys (e.g only use this key for audio). It appears that it is still only possible to have one global PSSH box (per DRM system) shared between tracks in this instance.

It is common with many DRM systems that the PSSH data would be different for each track in this case (since they may include references to the keyId in the PSSH payload).

MP4Encrypt should support filter criteria on the PSSH args also (instead of only on the Key/Propery args.

To be clear - I am referring to the insertion of PSSH atoms into the init fragment here...

barbibulle commented 6 years ago

That makes sense. I'll mark this as an enhancement and will try to make it part of the next release.

KarlGallagher commented 6 years ago

Hi @barbibulle

can you provide an update on this feature please?

barbibulle commented 6 years ago

We have added support for proper multi-key encryption (potentially a different KID/Key for each track). As far as the PSSH data is concerned, it isn't clear that multiple PSSH boxes would necessarily be needed. Most DRMs support having a PSSH box with signaling for multiple keys (ex: PlayReady, Marlin and Widevine), in which case a single PSSH box works just fine. Do you have a specific case with a DRM system that requires separate PSSH boxes for each KID/Key?

KarlGallagher commented 6 years ago

Hi @barbibulle - Yes, the use-case is legacy PlayReady clients, which don't support the signalling mode that you have outlined.