Created
March 11, 2021 00:55
-
-
Save moltak/f5cd8ccd1dac99d64de3da5beb4203e2 to your computer and use it in GitHub Desktop.
ffmpeg hls for audio
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/sh | |
BASE_URL="https://hls-test-bucket-will-be-removed.s3.ap-northeast-2.amazonaws.com/test3/" | |
FILE_KEY=file.key | |
FILE_KEY_INFO=file.keyinfo | |
openssl rand 16 > $FILE_KEY | |
echo $BASE_URL$FILE_KEY > $FILE_KEY_INFO | |
echo $FILE_KEY >> $FILE_KEY_INFO | |
echo $(openssl rand -hex 16) >> $FILE_KEY_INFO | |
ffmpeg -y -i $1 \ | |
-b:a 24k \ | |
-hls_list_size 0 \ | |
-hls_time 4 \ | |
-hls_base_url $BASE_URL \ | |
-hls_key_info_file $FILE_KEY_INFO \ | |
-hls_segment_filename "segment%03d.ts" \ | |
$2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment