From 1f5be309fb11e8fa2070c186efe6037a03a9b572 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 18 Feb 2010 13:56:45 +0100 Subject: avi straming first test --- config.php | 8 ++++++-- includes/inc_media.php | 53 ++++++++++++++++++++++++++++++++++++++++++++++--- includes/inc_rec.php | 1 + includes/inc_stream.php | 19 ++++++++++++++---- includes/include.php | 9 ++++++--- istream.sh | 3 ++- 6 files changed, 80 insertions(+), 13 deletions(-) diff --git a/config.php b/config.php index 0ae814f..5a63032 100755 --- a/config.php +++ b/config.php @@ -1,5 +1,5 @@ '128k 64k 1 240x160', '3g' => '350k 64k 1 408x272', 'Wifi' => '512k 128k 2 480x320' ); + $ffmpegpath = '/usr/bin/ffmpeg'; // Version - $isdversion = "0.3.5"; + $isdversion = "0.3.6-alpha"; ?> diff --git a/includes/inc_media.php b/includes/inc_media.php index b946e09..3d1f820 100755 --- a/includes/inc_media.php +++ b/includes/inc_media.php @@ -1,16 +1,63 @@ \r\n"; print "
\r\n"; print "
\r\n"; +if ($dir == $mediapath) + print "\"home\"
\r\n"; +else + print "Back
\r\n"; +print "
\r\n"; print "\"home\"
\r\n"; print "
iStreamdev
\r\n"; print "\r\n"; print "
\r\n"; print " Media\r\n"; +print "
"; +print " {$subdir}\r\n"; print "
\r\n"; +$dir_handle = @opendir($dir) or die("Unable to open $dir"); + +while ($medianame = readdir($dir_handle)) +{ + if($medianame == "." || $medianame == ".." || $medianame == 'lost+found') + continue; + + $medianame2=addslashes($medianame); + + if (strstr($medianame, ".avi") == ".avi") + { + print "
  • $medianame
  • \r\n"; + print "
    "; + print " "; + print " "; + print " "; + print "
    \r\n"; + } + else + { + print "
  • $medianame
  • \r\n"; + print "
    "; + print " "; + print " "; + print "
    \r\n"; + } +} + +$updir = dirname($dir); + +print "
    \r\n"; +closedir($dir_handle); + +print "\r\n"; ?> diff --git a/includes/inc_rec.php b/includes/inc_rec.php index 463b924..8459a07 100755 --- a/includes/inc_rec.php +++ b/includes/inc_rec.php @@ -19,6 +19,7 @@ else print "
    \r\n"; print "\"home\"
    \r\n"; + print "
    iStreamdev
    \r\n"; print "\r\n"; print "
    \r\n"; diff --git a/includes/inc_stream.php b/includes/inc_stream.php index 58bfa1e..b5df588 100755 --- a/includes/inc_stream.php +++ b/includes/inc_stream.php @@ -51,10 +51,11 @@ if (infostreamexist()) case 1: print " "; break; - default: case 2: + case 3: print " "; break; + } print " \r\n"; } @@ -76,12 +77,17 @@ else case 2: list($title, $desc, $realname) = vdrgetinfostream($name, 0); break; + // Media case 3: + $realname = $name; + $title = ""; + $desc = ""; + break; default: $realname = ""; $title = ""; $desc = ""; - $channame = $name; + $channame = ""; } print "\r\n"; @@ -148,9 +154,9 @@ else print " \r\n"; break; case 2: - default: + case 3: print " \r\n"; - break; + break; } print " "; } @@ -168,6 +174,11 @@ else print " "; print " "; break; + case 3: + $dir = dirname($name); + print " "; + print " "; + break; } print " \r\n"; diff --git a/includes/include.php b/includes/include.php index b2f133d..acffb58 100755 --- a/includes/include.php +++ b/includes/include.php @@ -88,16 +88,19 @@ function gen_media() function start_stream($type, $name, $title, $desc, $qname, $qparams, $category, $url) { - global $httppath; + global $httppath, $ffmpegpath; switch ($type) { case 1: - $cmd = "export SHELL=\"/bin/sh\";printf \"./istream.sh '" .$url ."' " .$qparams ." " .$httppath ." 2 \" | at now"; + $cmd = "export SHELL=\"/bin/sh\";printf \"./istream.sh '" .$url ."' " .$qparams ." " .$httppath ." 2 " .$ffmpegpath ." \" | at now"; break; case 2: - $cmd = "export SHELL=\"/bin/sh\";printf \"cat \\\"" .$url ."\\\"/0* | ./istream.sh - " .$qparams ." " .$httppath ." 1260 \" | at now"; + $cmd = "export SHELL=\"/bin/sh\";printf \"cat \\\"" .$url ."\\\"/0* | ./istream.sh - " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." \" | at now"; break; + case 3: + $cmd = "export SHELL=\"/bin/sh\";printf \"./istream.sh '" .$url ."' " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." \" | at now"; + break; default: $cmd = ""; } diff --git a/istream.sh b/istream.sh index 434208c..7e5c93c 100755 --- a/istream.sh +++ b/istream.sh @@ -1,6 +1,5 @@ #!/bin/bash -FFPATH="/usr/bin/ffmpeg" STREAM=$1 VRATE=$2 ARATE=$3 @@ -10,6 +9,8 @@ HTTP_PATH="$6ram/" SEGDUR=10 # Length of Segments produced (between 10 and 30) SEGWIN=$7 # Amount of Segments to produce +FFPATH=$8 + PREFIX=stream if [ $# -eq 0 ] -- cgit v1.2.3