Closed CiaShangLin closed 11 months ago
How to play an MP4 encrypted with FFMPEG ? By using the following FFMPEG command, I encrypted an MP4 file, and it can be decrypted and played using ffplay. Is there a way to pass this key to Exoplayer?
ffmpeg -i decryption.mp4 -vcodec copy -acodec copy -encryption_scheme cenc-aes-ctr -encryption_key c7e16c4403654b85847037383f0c2db3 -encryption_kid a7e61c373e219033c21091fa607bf3b8 encryption.mp4
ffplay -i encryption.mp4 -decryption_key c7e16c4403654b85847037383f0c2db3
Hi @CiaShangLin, I think you can use an AesCipherDataSource that wraps an upstream data source (eg. DefaultDataSource).
DefaultDataSource
Is there any demo I can refer to?
How to play an MP4 encrypted with FFMPEG ? By using the following FFMPEG command, I encrypted an MP4 file, and it can be decrypted and played using ffplay. Is there a way to pass this key to Exoplayer?
ffmpeg -i decryption.mp4 -vcodec copy -acodec copy -encryption_scheme cenc-aes-ctr -encryption_key c7e16c4403654b85847037383f0c2db3 -encryption_kid a7e61c373e219033c21091fa607bf3b8 encryption.mp4
ffplay -i encryption.mp4 -decryption_key c7e16c4403654b85847037383f0c2db3