Created
August 2, 2020 00:34
-
-
Save kevinGodell/3ce8ca80315a2e20c75b7d78361df6a0 to your computer and use it in GitHub Desktop.
testing ffmpeg mp4 encryption
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# convert, encrypt, decrypt, probe | |
echo "Hello ffmpeg mp4 encryption!" | |
echo -e "\n---------- convert wav to mp4 ----------\n" | |
ffmpeg -y -i long_input_44100.wav long_input_44100.mp4 | |
echo -e "\n---------- encrypt mp4 ----------\n" | |
ffmpeg -y -i long_input_44100.mp4 -encryption_scheme cenc-aes-ctr -encryption_key 76a6c65c5ea762046bd749a2e632ccbb -encryption_kid a7e61c373e219033c21091fa607bf3b8 long_input_44100_encrypted.mp4 | |
echo -e "\n---------- decrypt mp4 ----------\n" | |
ffmpeg -y -decryption_key 76a6c65c5ea762046bd749a2e632ccbb -i long_input_44100_encrypted.mp4 long_input_44100_decrypted.mp4 | |
echo -e "\n---------- encrypt hls mpegts ----------\n" | |
ffmpeg -y -i long_input_44100.mp4 -f hls -hls_segment_type mpegts -hls_enc 1 -hls_enc_key 76a6c65c5ea762046bd749a2e632ccbb mpegts.m3u8 | |
echo -e "\n---------- encrypt hls fmp4 ----------\n" | |
ffmpeg -y -i long_input_44100.mp4 -f hls -hls_segment_type fmp4 -hls_enc 1 -hls_enc_key 76a6c65c5ea762046bd749a2e632ccbb fmp4.m3u8 | |
echo -e "\n---------- probe encrypted mp4 ----------\n" | |
ffprobe -decryption_key 76a6c65c5ea762046bd749a2e632ccbb -i long_input_44100_encrypted.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment