diff options
author | root <root@mediaserver.Belkin> | 2010-02-17 23:14:37 +0100 |
---|---|---|
committer | root <root@mediaserver.Belkin> | 2010-02-17 23:14:37 +0100 |
commit | f27608f2695d51f563adb6ebc8c475c6a8df53ba (patch) | |
tree | c1a909a310b10f267221029e3ba50462dbd3a63f /istream.sh | |
download | istreamdev-f27608f2695d51f563adb6ebc8c475c6a8df53ba.tar.gz istreamdev-f27608f2695d51f563adb6ebc8c475c6a8df53ba.tar.bz2 |
0.3.5-dev
Diffstat (limited to 'istream.sh')
-rwxr-xr-x | istream.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/istream.sh b/istream.sh new file mode 100755 index 0000000..434208c --- /dev/null +++ b/istream.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +FFPATH="/usr/bin/ffmpeg" +STREAM=$1 +VRATE=$2 +ARATE=$3 +ACHANNELS=$4 +XY=$5 +HTTP_PATH="$6ram/" + +SEGDUR=10 # Length of Segments produced (between 10 and 30) +SEGWIN=$7 # Amount of Segments to produce +PREFIX=stream + +if [ $# -eq 0 ] +then +echo "You must supply a valid channel!" +exit 1 +fi + +############################################################# +# start dumping the TS via Streamdev into a pipe for ffmpeg +# and store baseline 3.0 mpegts to outputfile +# sending it to the segmenter via a PIPE +############################################################## + +res=`ps ax|grep "segmenter" | grep -v grep` + +if test -z "$res" +then + +cd ram +2> /dev/null rm "$PREFIX"*.ts + +2> /dev/null $FFPATH -i $STREAM -deinterlace -f mpegts -acodec libmp3lame -ab $ARATE -ac $ACHANNELS -s $XY -vcodec libx264 -b $VRATE -flags +loop \ + -cmp \+chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 \ + -sc_threshold 40 -i_qfactor 0.71 -bt $VRATE -maxrate $VRATE -bufsize $VRATE -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 \ + -qmin 10 -qmax 51 -qdiff 4 -level 30 -g 30 -async 2 -threads 4 - | \ +segmenter - $SEGDUR $PREFIX $PREFIX.m3u8 $HTTP_PATH $SEGWIN & + +fi |