[OGG INFO REMOTE script]
Avaliable active streams on giss.tv server:
";
echo "[click to get ogginfo]
";
// list of active streams:
include ('../getstatus.php'); // Getting an array of active mountpoints
foreach ($mps as $m) {
if (strstr($m, ".mp3")) {
$listmp3s .= " - ($m is a mp3 stream)
";
} else {
$listoggs .= " - $m -> ogginfo - ogginfo AND cortado - Only itheora
";
}
}
echo "";
echo $listoggs;
echo "
";
echo $listmp3s;
echo "
";
echo "
Note: you can use this script passing variables through GET method:
http://giss.tv/~jaume/getogginfo/getogginfo.php?s=[Name-of_the_stream.ogg]&cortado=[si/no]
WARNING, currently this script is only usable for local streams (giss.tv streams).
DOWNLOAD the script ogginforemote here
";
} else {
$oggdata = "";
$rnd = rand(1,1000);
$oggfile = "temp/".$stream."-".$rnd."ogg";
$ogginfo = "temp/".$stream."-".$rnd."ogginfo";
$system_query = "curl -m 5 http://localhost:8000/$stream > $oggfile; ogginfo $oggfile > $ogginfo;";
$output = exec("$system_query");
// turn the content in rows
if ($handle = @fopen("./$ogginfo", "r")) {
while (!feof($handle)) {
$part = fread($handle, 1024);
$content .= $part;
}
fclose($handle);
$lines = preg_split("/\r?\n|\r/", $content); // turn the content in rows
foreach ($lines as $val) {
if (strstr($val, "Width:")) { $oggdata .= "".$val."
";$w = substr($val, -3, 3); }
if (strstr($val, "Height:")) { $oggdata .= "".$val."
";$h = substr($val, -3, 3); }
if (strstr($val, "Framerate")) { $oggdata .= "".$val."
"; }
//if (!preg_match('/\d{1,3}/',$w)) { $oggdata = "this is an AUDIO stream
"; }
$ogginfo .= $val."
";
}
// Cortado applet include on demand
$cortado = $_GET["cortado"];
// soft protection for GET vars
if ((strstr($cortado,";")) or (strstr($cortado,"&")) or (strstr($cortado,"\\"))) { $cortado = ""; }
if ($cortado == "si") {
$slavenum = rand (1,1);
$slave = "http://giss.tv/cortado-sized.php?mount=".$stream."&w".$w."&h".$h."";
echo "This is the stream ".$stream."
";
if (!$w or !$h) {
echo "[This is an audio stream]
";
echo "";
} else {
echo "[This is video stream]
";
echo "";
}
}
// Writing ogginforemote
echo "- Ogginfo for the streaming: http://giss.tv:8000/$stream:
";
echo "";
echo "
".$ogginfo."
";
}
// resetting system
exec("rm -Rf ./temp/*;");
}
echo "
go back
";
?>