diff options
author | TheTroll <trolldev@gmail.com> | 2010-03-28 18:17:07 +0200 |
---|---|---|
committer | TheTroll <trolldev@gmail.com> | 2010-03-28 18:17:07 +0200 |
commit | 4cd3207e6e6b4bd988c2dba20cb99ff99f6dec5b (patch) | |
tree | 6e2c9eca798d2bdd31471c38ff5fe490a69dbbec | |
parent | db375962a4c5c4170d24734e413a52590f9409b6 (diff) | |
download | istreamdev-4cd3207e6e6b4bd988c2dba20cb99ff99f6dec5b.tar.gz istreamdev-4cd3207e6e6b4bd988c2dba20cb99ff99f6dec5b.tar.bz2 |
Put Error: in failed session name
Added ffmpeg debug
new maxepgdays option
-rwxr-xr-x | bin/istream.sh | 11 | ||||
-rwxr-xr-x | bin/session.php | 24 | ||||
-rwxr-xr-x | config_default.php | 21 |
3 files changed, 40 insertions, 16 deletions
diff --git a/bin/istream.sh b/bin/istream.sh index 438e322..b54417a 100755 --- a/bin/istream.sh +++ b/bin/istream.sh @@ -12,6 +12,7 @@ SEGWIN=$7 # Amount of Segments to produce FFPATH=$8 SEGMENTERPATH=$9 SESSION=${10} +FFMPEGLOG=${11} if [ $# -eq 0 ] then @@ -19,6 +20,12 @@ echo "Format is : ./istream.sh source video_rate audio_rate audio_channels 480x3 exit 1 fi +# Log +if [ -z "$FFMPEGLOG" ] +then + FFMPEGLOG="/dev/null" +fi + ############################################################# # start dumping the TS via Streamdev into a pipe for ffmpeg # and store baseline 3.0 mpegts to outputfile @@ -29,8 +36,8 @@ cd ../ram/$SESSION 2> /dev/null rm stream*.ts -2> /dev/null $FFPATH -i "$STREAM" -deinterlace -f mpegts -acodec libmp3lame -ab $ARATE -ac $ACHANNELS -s $XY -vcodec libx264 -b $VRATE -flags +loop \ +$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 - | \ + -qmin 10 -qmax 51 -qdiff 4 -level 30 -g 30 -async 2 -threads 4 - 2>$FFMPEGLOG | \ $SEGMENTERPATH - $SEGDUR stream stream.m3u8 $HTTP_PATH$SESSION/ $SEGWIN & diff --git a/bin/session.php b/bin/session.php index 5b9464b..950c855 100755 --- a/bin/session.php +++ b/bin/session.php @@ -2,7 +2,7 @@ function sessioncreate($type, $url, $mode) { - global $httppath, $ffmpegpath, $segmenterpath, $quality, $maxencodingprocesses; + global $httppath, $ffmpegpath, $segmenterpath, $quality, $maxencodingprocesses, $ffmpegdebug, $ffmpegdebugfile; addlog("Creating a new session for \"" .$url ."\" (" .$type .", " .$mode .")"); @@ -64,23 +64,31 @@ function sessioncreate($type, $url, $mode) $channame = ""; break; } + // Create logo if ($type == 'vid') generatelogo($type, $url, '../ram/' .$session .'/thumb.png'); else generatelogo($type, $channame, '../ram/' .$session .'/thumb.png'); + + // FFMPEG debug + if ($ffmpegdebug) + $ffdbg = $ffmpegdebugfile; + else + $ffdbg = ""; + // Start encoding $url = str_replace("\\'", "'", $url); switch ($type) { case 'tv': - $cmd = "export SHELL=\"/bin/sh\";printf \"./istream.sh \\\"" .$url ."\\\" " .$qparams ." " .$httppath ." 2 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \" | at now"; + $cmd = "export SHELL=\"/bin/sh\";printf \"./istream.sh \\\"" .$url ."\\\" " .$qparams ." " .$httppath ." 2 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \\\"" .$ffdbg ."\\\" \" | at now"; break; case 'rec': - $cmd = "export SHELL=\"/bin/sh\";printf \"cat \\\"" .$url ."\\\"/0* | ./istream.sh - " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \" | at now"; + $cmd = "export SHELL=\"/bin/sh\";printf \"cat \\\"" .$url ."\\\"/0* | ./istream.sh - " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \\\"" .$ffdbg ."\\\" \" | at now"; break; case 'vid': - $cmd = "export SHELL=\"/bin/sh\";printf \"./istream.sh \\\"" .$url ."\\\" " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \" | at now"; + $cmd = "export SHELL=\"/bin/sh\";printf \"./istream.sh \\\"" .$url ."\\\" " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \\\"" .$ffdbg ."\\\" \" | at now"; break; default: $cmd = ""; @@ -347,6 +355,9 @@ function sessiongetlist() if ($type == "none") continue; + // Get status + $status = getstreamingstatus($session); + $newsession = array(); $newsession['session'] = substr($session, strlen("session")); $newsession['type'] = $type; @@ -355,8 +366,11 @@ function sessiongetlist() else $newsession['name'] = $channame; + if ($status['status'] == "error") + $newsession['name'] = "Error: " .$newsession['name']; + // Check if encoding - if (file_exists('../ram/' .$session .'/segmenter.pid')) + if (file_exists('../ram/' .$session .'/segmenter.pid') && ($status['status'] != "error")) $newsession['encoding'] = 1; else $newsession['encoding'] = 0; diff --git a/config_default.php b/config_default.php index 621791e..26d57ef 100755 --- a/config_default.php +++ b/config_default.php @@ -7,35 +7,38 @@ // Debug mode $debug=0; // Debug all action $debugfile="/tmp/istreamdev.log"; // Debug file + $ffmpegdebug=0; // Debug ffmpeg + $ffmpegdebugfile="/tmp/istreamdev-ffmpeg.log"; // FFmpeg debug file // Http configuration - $user = 'istreamdev'; // Login - $pass = 'iguest'; // Password - $httppath = '/istreamdev/'; // Absolute path to the index.php file. Don't put http://yourdomain !! + $user='istreamdev'; // Login + $pass='iguest'; // Password + $httppath='/istreamdev/'; // Absolute path to the index.php file. Don't put http://yourdomain !! // VDR configuration $vdrchannels='/etc/vdr/channels.conf'; // VDR channel list $svdrpport=2001; // SVDRP port $svdrpip='127.0.0.1'; // SVDRP ip $vdrstreamdev='http://127.0.0.1:3000/TS/'; // VDR streamdev URL - $vdrrecpath='/video/'; //VDR recording directory + $vdrrecpath='/video/'; // VDR recording directory + $vdrepgmaxdays=10; // Number of days to get from EPG // Media configuration $videotypes='avi mkv ts mov mp4 wmv flv mpg mpeg mpeg2 mpv '; // Supported video extensions (must finish with a space) $audiotypes='mp3 aac wav '; // Supported audio extensions - $videosource = '/mnt/media/movies/'; // Video files directory - $audiosource = '/mnt/media/music/'; // Audio files directory + $videosource='/mnt/media/movies/'; // Video files directory + $audiosource='/mnt/media/music/'; // Audio files directory // Encoding (The name cannot be changed) // Name Video Audio Audio channels Resolution - $quality=array ( 'edge' => '128k 64k 1 240x160', + $quality=array ( 'edge' => '128k 64k 1 240x160', '3g' => '350k 64k 1 408x272', 'wifi' => '512k 128k 2 480x320'); $maxencodingprocesses=3; // Max simultaneous encoding processes // Misc - $ffmpegpath = '/usr/bin/ffmpeg'; //path to ffmpeg binary - $segmenterpath = '/usr/bin/segmenter'; //path to segmenter binary + $ffmpegpath='/usr/bin/ffmpeg'; //path to ffmpeg binary + $segmenterpath='/usr/bin/segmenter'; //path to segmenter binary // Version $isdversion = "1.0-alpha1"; |