Last active
May 13, 2022 20:59
-
-
Save arafathusayn/cf7add0eb02cb68ba328e0b390f69c61 to your computer and use it in GitHub Desktop.
Bash script to create AES-encrypted HLS VOD using ffmpeg. Usage: ./make-encrypted-hls-vod.sh <path to video file>
This file contains hidden or 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 | |
openssl rand 16 > enc.key | |
printf "enc.key\nenc.key\n$(openssl rand -hex 16)" > enc.keyinfo | |
mkdir -p ./hls | |
ffmpeg -y \ | |
-i "$1" \ | |
-preset ultrafast \ | |
-hls_key_info_file enc.keyinfo \ | |
-hls_time 10 \ | |
-hls_playlist_type vod \ | |
-hls_segment_filename "hls/seg_%d.ts" \ | |
"hls/video.m3u8" | |
cp enc.key ./hls/enc.key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment