wseemann / FFmpegMediaPlayer

FFmpegMediaPlayer can be used to control playback of audio/video files and streams.
673 stars 201 forks source link

How to play an MP4 encrypted with FFMPEG ? #166

Open CiaShangLin opened 9 months ago

CiaShangLin commented 9 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 FFmpegMediaPlayer?

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

wseemann commented 7 months ago

@CiaShangLin is it a local file (on internal/external storage) or over the network?

CiaShangLin commented 7 months ago

local