summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/istream.sh13
-rw-r--r--bin/session.php2
2 files changed, 11 insertions, 4 deletions
diff --git a/bin/istream.sh b/bin/istream.sh
index d9bb2a5..b8535c7 100755
--- a/bin/istream.sh
+++ b/bin/istream.sh
@@ -12,11 +12,11 @@ FFPATH=$7
SEGMENTERPATH=$8
SESSION=${9}
FFMPEGLOG=${10}
-FFMPEGPREFIX=${11}
+FILES=${11}
if [ $# -eq 0 ]
then
-echo "Format is : ./istream.sh source video_rate audio_rate audio_channels 480x320 httppath segments_number ffmpeg_path segmenter_path"
+echo "Format is : ./istream.sh source video_rate audio_rate audio_channels 480x320 httppath segments_number ffmpeg_path segmenter_path rec_files"
exit 1
fi
@@ -43,9 +43,16 @@ cd ../ram/$SESSION
# Create a fifo
2>/dev/null mkfifo ./fifo
+if [ ! -z "$FILES" ]
+then
+ FFMPEGPREFIX="cat $FILES"
+else
+ FFMPEGPREFIX="cat /dev/null"
+fi
+
# Start ffmpeg
(trap "rm -f ./ffmpeg.pid; rm -f ./fifo" EXIT HUP INT TERM ABRT; \
- $FFMPEGPREFIX $FFPATH -i "$STREAM" -deinterlace -f mpegts -acodec libmp3lame -ab $ARATE -ac 2 -s $XY -vcodec libx264 -b $VRATE -flags +loop \
+ $FFMPEGPREFIX | $FFPATH -i "$STREAM" -deinterlace -f mpegts -acodec libmp3lame -ab $ARATE -ac 2 -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 - 2>$FFMPEGLOG >./fifo) &
diff --git a/bin/session.php b/bin/session.php
index 81582ee..e52b6e4 100644
--- a/bin/session.php
+++ b/bin/session.php
@@ -85,7 +85,7 @@ function sessioncreate($type, $url, $mode)
$cmd = "./istream.sh \"" .$url ."\" " .$qparams ." " .$httppath ." 2 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \"" .$ffdbg ."\" \"\" >/dev/null &";
break;
case 'rec':
- $cmd = "./istream.sh - " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \"" .$ffdbg ."\" \"cat \\\"" .$url ."/\\\"/0* |\" >/dev/null &";
+ $cmd = "./istream.sh - " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \"" .$ffdbg ."\" \"" .$url ."/0* \" >/dev/null &";
break;
case 'vid':
$cmd = "./istream.sh \"" .$url ."\" " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \"" .$ffdbg ."\" \"\" >/dev/null &";