diff options
-rwxr-xr-x | config.php | 8 | ||||
-rwxr-xr-x | includes/inc_media.php | 53 | ||||
-rwxr-xr-x | includes/inc_rec.php | 1 | ||||
-rwxr-xr-x | includes/inc_stream.php | 19 | ||||
-rwxr-xr-x | includes/include.php | 9 | ||||
-rwxr-xr-x | istream.sh | 3 |
6 files changed, 80 insertions, 13 deletions
@@ -1,5 +1,5 @@ <?php - global $user, $pass, $vdrchannels, $vdrstreamdev, $quality, $httppath, $svdrpip, $svdrpport; + global $user, $pass, $vdrchannels, $vdrstreamdev, $quality, $httppath, $svdrpip, $svdrpport, $ffmpegpath; // Http configuration $user = 'istreamdev'; // Login @@ -13,13 +13,17 @@ $vdrstreamdev='http://127.0.0.1:3000/TS/'; // VDR streamdev URL $vdrrecpath='/video/'; + // Media configuration + $mediapath='/mnt/Storage/'; + // Encoding // Name Video Audio Audio channels Resolution $quality = array( 'Edge' => '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 @@ <?php +global $mediapath; + +$dir = $_REQUEST['dir']; +if ($dir == "") + $dir = $mediapath; + +// Get current subdir +$subdir = preg_replace("'" .quotemeta($mediapath) ."'", '', $dir); + print "<body onorientationchange=\"updateOrientation();\" onload=\"updateOrientation();\">\r\n"; print "<div id=\"topbar\" class=\"transparent\">\r\n"; print "<div id=\"leftnav\">\r\n"; +if ($dir == $mediapath) + print "<a href=\"index.php\"><img alt=\"home\" src=\"images/home.png\" /></a></div>\r\n"; +else + print "<a href=\"javascript:sendForm('getback')\">Back</a></div>\r\n"; +print "<div id=\"rightnav\">\r\n"; print "<a href=\"index.php\"><img alt=\"home\" src=\"images/home.png\" /></a></div>\r\n"; print "<div id=\"title\">iStreamdev</div>\r\n"; print "</div>\r\n"; print "<div id=\"content\">\r\n"; print " <span class=\"graytitle\">Media</span>\r\n"; +print "<br>"; +print " <span class=\"graytitle\">{$subdir}</span>\r\n"; print " <ul class=\"pageitem\">"; -print " <li class=\"textbox\"><span class=\"header\">Incoming feature</span"; -print " <p>To do...</p></li>"; -print "</div>\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 "<li class=\"menu\"><a class=\"noeffect\" href=\"javascript:sendForm('$medianame2');\"><span class=\"name\">$medianame</span><span class=\"arrow\"></span></a></li>\r\n"; + print "<form name=\"$medianame\" id=\"$medianame\" method=\"post\" action=\"index.php\">"; + print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"stream\"/>"; + print " <input name=\"type\" type=\"hidden\" id=\"type\" value=3 />"; + print " <input name=\"name\" type=\"hidden\" id=\"name\" value=\"{$dir}/{$medianame}\" />"; + print "</form>\r\n"; + } + else + { + print "<li class=\"menu\"><a class=\"noeffect\" href=\"javascript:sendForm('$medianame2');\"><span class=\"name\">$medianame</span><span class=\"arrow\"></span></a></li>\r\n"; + print "<form name=\"$medianame\" id=\"$medianame\" method=\"post\" action=\"index.php\">"; + print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"media\"/>"; + print " <input name=\"dir\" type=\"hidden\" id=\"dir\" value=\"{$dir}/{$medianame}\" />"; + print "</form>\r\n"; + } +} + +$updir = dirname($dir); + +print "<form name=\"getback\" id=\"getback\" method=\"post\" action=\"index.php\"><input name=\"action\" type=\"hidden\" id=\"action\" value=\"media\"/><input name=\"dir\" type=\"hidden\" id=\"dir\" value=\"{$updir}/\" /></form>\r\n"; +closedir($dir_handle); + +print "</ul></div>\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 "<div id=\"rightnav\">\r\n"; print "<a href=\"index.php\"><img alt=\"home\" src=\"images/home.png\" /></a></div>\r\n"; + print "<div id=\"title\">iStreamdev</div>\r\n"; print "</div>\r\n"; print "<div id=\"content\">\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 " <input name=\"name\" type=\"hidden\" id=\"name\" value=\"{$realname}\" />"; break; - default: case 2: + case 3: print " <input name=\"name\" type=\"hidden\" id=\"name\" value=\"{$url}\" />"; break; + } print " </form>\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 "<body onorientationchange=\"updateOrientation();\" onload=\"updateOrientation();\">\r\n"; @@ -148,9 +154,9 @@ else print " <input name =\"url\" type=\"hidden\" id=\"url\" value=\"{$vdrstreamdev}{$channum}\" />\r\n"; break; case 2: - default: + case 3: print " <input name =\"url\" type=\"hidden\" id=\"url\" value=\"{$name}\" />\r\n"; - break; + break; } print " </form>"; } @@ -168,6 +174,11 @@ else print " <input name =\"action\" type=\"hidden\" id=\"action\" value=\"recordings\" />"; print " <input name =\"dir\"type=\"hidden\" id=\"dir\" value=\"{$dir}\" />"; break; + case 3: + $dir = dirname($name); + print " <input name =\"action\" type=\"hidden\" id=\"action\" value=\"media\" />"; + print " <input name =\"dir\"type=\"hidden\" id=\"dir\" value=\"{$dir}\" />"; + break; } print " </form>\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 = ""; } @@ -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 ] |