google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.75k stars 6.03k forks source link

Support SAMPLE-AES encryption with identity key format #6488

Open Romantic-LiXuefeng opened 5 years ago

Romantic-LiXuefeng commented 5 years ago

Just as the title. Support to decrypt H.264/AAC/AC-3/Enhanced AC-3 streams encrypted with AES-SAMPLE encryption described in the below link . https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption/Encryption/Encryption.html. If there is no plan to support this, Hope give some advice how to implement this feature.

AquilesCanta commented 5 years ago

It's not in our current plans to add support for this. Still I'll leave this open to track support for non-CDM SAMPLE-AES protection.

If you are looking into implementing this, the simplest approach to start with is probably implementing your own ElementaryStreamReader (for Transport Stream elementary streams, start by forking H264Reader), or Extractor for packed audio. You'll need to plumb the key and initialization vector into your extractor in order to decrypt.

Once a working solution is in place, we can look into making it fit into ExoPlayer's model.

Romantic-LiXuefeng commented 5 years ago

@AquilesCanta As your said, issuecomment, whether there is no different to extract Sample from encrypted TS format or clear TS format.