-
-
Save dlobjoie/96e0965a53a4ac227eeac317078334e2 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)" > keyinfo.drm | |
mkdir -p ./hls | |
ffmpeg -y \ | |
-i "$1" \ | |
-preset slow \ | |
-hls_key_info_file keyinfo.drm \ | |
-hls_time 5 \ | |
-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