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
#!/usr/bin/env bash | |
# downloading mv.mp4 | |
download_mv_if_needed() { | |
if [ ! -f "./videos/mv.mp4" ]; then | |
mkdir -p ./videos | |
curl -L https://www.dropbox.com/s/fl02xpyhz8693b0/mv.mp\?dl\=1 -o ./videos/mv.mp4 | |
fi | |
} |
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
ffmpeg -i sample.mp4 \ | |
-filter_complex \ | |
"[0:v]split=4[v1][v2][v3][v4]; \ | |
[v1]scale=w=1980:h=1080[v1out]; \ | |
[v2]scale=w=1280:h=720[v2out]; \ | |
[v3]scale=w=854:h=480[v3out]; \ | |
[v4]scale=w=640:h=360[v4out]" \ | |
-map [v1out] -c:v:0 libx264 -profile main -b:v:0 5000k -minrate 4500k -maxrate 5300k -bufsize 5000k -preset slow -g 120 -keyint_min 120 -sc_threshold 0 \ | |
-map [v2out] -c:v:1 libx264 -profile main -b:v:1 3000k -minrate 2500k -maxrate 3200k -bufsize 3000k -preset slow -g 120 -keyint_min 120 -sc_threshold 0 \ | |
-map [v3out] -c:v:2 libx264 -profile main -b:v:2 1500k -minrate 1250k -maxrate 1600k -bufsize 1500k -preset slow -g 120 -keyint_min 120 -sc_threshold 0 \ |
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 | |
openssl rand 16 > enc.key | |
printf "enc.key\nenc.key\n$(openssl rand -hex 16)" > keyinfo.drm | |
mkdir -p ./hls | |
ffmpeg -y \ | |
-i "$1" \ |
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
#!/usr/bin/env bash | |
START_TIME=$SECONDS | |
set -e | |
echo "-----START GENERATING HLS STREAM-----" | |
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME] | |
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1 | |
# commenter/ajouter des lignes ici pour contrôler les rendus qui seront créés | |
renditions=( |