From b372f3c141621305299e50961a16583d28db37de Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 20 Oct 2012 19:15:54 +0200 Subject: moved hls to conrib dir --- contrib/hls/create-runit-conf.sh | 45 +++++++++++++++++++++++++++++++++ contrib/hls/install.sh | 10 ++++++++ contrib/hls/m3u8-segmenter-git-repo | 1 + contrib/hls/start-hls.sh | 50 +++++++++++++++++++++++++++++++++++++ src/hls/create-runit-conf.sh | 45 --------------------------------- src/hls/install.sh | 10 -------- src/hls/m3u8-segmenter-git-repo | 1 - src/hls/start-hls.sh | 50 ------------------------------------- 8 files changed, 106 insertions(+), 106 deletions(-) create mode 100755 contrib/hls/create-runit-conf.sh create mode 100755 contrib/hls/install.sh create mode 100644 contrib/hls/m3u8-segmenter-git-repo create mode 100755 contrib/hls/start-hls.sh delete mode 100755 src/hls/create-runit-conf.sh delete mode 100755 src/hls/install.sh delete mode 100644 src/hls/m3u8-segmenter-git-repo delete mode 100755 src/hls/start-hls.sh diff --git a/contrib/hls/create-runit-conf.sh b/contrib/hls/create-runit-conf.sh new file mode 100755 index 0000000..4d43282 --- /dev/null +++ b/contrib/hls/create-runit-conf.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "Usage $0 " + exit 1 +fi + +name=$1 +OUT_D=runit + +rm -rf "$OUT_D" +mkdir -p "$OUT_D" + +for src in av-orig av-en; do + for profile in low medium high; do + echo "creating runit instance for $src - $profile" + DIR="$OUT_D/hls-$name-$src-$profile" + mkdir -p "$DIR/log" +cat >> "$DIR/run" <&1 +exec chpst -u flumotion:flumotion /usr/local/bin/start-hls.sh "$name" "$src" "$profile" +EOF + chmod +x "$DIR/run" + +cat >> "$DIR/log/run" < (high|medium|low)" + exit 1 +fi + +name=$1 +quality=$3 +stream_name="$name/$2-hls-$quality" +src="http://localhost:8000/$2-flash-$quality.flv" +segmenter="/usr/local/bin/m3u8-segmenter" +len=3 +num=3 +url="http://r38.realraum.at/" + +case "$3" in + high) + arate=160k + ;; + medium) + arate=128k + ;; + low) + arate=96k + ;; + *) + arate=128k + ;; +esac + +cd /var/www +ffmpeg -y -i "$src" -f mpegts -acodec libmp3lame -ar 44100 -ab "$arate" -vcodec copy -vbsf h264_mp4toannexb -async 2 - | $segmenter -i - -d $len -n $num -p "$stream_name" -m "$stream_name.m3u8" -u "$url" +rm -f "$stream_name"-*.ts +rm -f "$stream_name".m3u8 + +exit 0 diff --git a/src/hls/create-runit-conf.sh b/src/hls/create-runit-conf.sh deleted file mode 100755 index 4d43282..0000000 --- a/src/hls/create-runit-conf.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -if [ -z "$1" ]; then - echo "Usage $0 " - exit 1 -fi - -name=$1 -OUT_D=runit - -rm -rf "$OUT_D" -mkdir -p "$OUT_D" - -for src in av-orig av-en; do - for profile in low medium high; do - echo "creating runit instance for $src - $profile" - DIR="$OUT_D/hls-$name-$src-$profile" - mkdir -p "$DIR/log" -cat >> "$DIR/run" <&1 -exec chpst -u flumotion:flumotion /usr/local/bin/start-hls.sh "$name" "$src" "$profile" -EOF - chmod +x "$DIR/run" - -cat >> "$DIR/log/run" < (high|medium|low)" - exit 1 -fi - -name=$1 -quality=$3 -stream_name="$name/$2-hls-$quality" -src="http://localhost:8000/$2-flash-$quality.flv" -segmenter="/usr/local/bin/m3u8-segmenter" -len=3 -num=3 -url="http://r38.realraum.at/" - -case "$3" in - high) - arate=160k - ;; - medium) - arate=128k - ;; - low) - arate=96k - ;; - *) - arate=128k - ;; -esac - -cd /var/www -ffmpeg -y -i "$src" -f mpegts -acodec libmp3lame -ar 44100 -ab "$arate" -vcodec copy -vbsf h264_mp4toannexb -async 2 - | $segmenter -i - -d $len -n $num -p "$stream_name" -m "$stream_name.m3u8" -u "$url" -rm -f "$stream_name"-*.ts -rm -f "$stream_name".m3u8 - -exit 0 -- cgit v1.2.3