summaryrefslogtreecommitdiff
path: root/includes/inc_files.php
diff options
context:
space:
mode:
authorroot <root@mediaserver.Belkin>2010-02-18 17:59:35 +0100
committerroot <root@mediaserver.Belkin>2010-02-18 17:59:35 +0100
commit86f80a5da2cdf92283113ff80e48a0fd4b266e7e (patch)
tree019ee9965fe7417147ee5de1a3f84ded3505323a /includes/inc_files.php
parentee59e19183a839784e6ac30ed639548e4f36615e (diff)
downloadistreamdev-86f80a5da2cdf92283113ff80e48a0fd4b266e7e.tar.gz
istreamdev-86f80a5da2cdf92283113ff80e48a0fd4b266e7e.tar.bz2
added missing ram folder & changes in inc_files.php
Committer: Alib <aliboba@free.fr> new file: includes/inc_files.php new file: ram/dummy.txt
Diffstat (limited to 'includes/inc_files.php')
-rwxr-xr-xincludes/inc_files.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/includes/inc_files.php b/includes/inc_files.php
new file mode 100755
index 0000000..f6dff09
--- /dev/null
+++ b/includes/inc_files.php
@@ -0,0 +1,36 @@
+<?php
+
+function mediagetinfostream($stream = "")
+{
+
+ global $mediainfopath, $ffmpegpath;
+
+ // Get info
+ exec($mediainfopath ." \"" .$stream ."\"", $mediainfo);
+
+ $info = "";
+ $title = "";
+
+ // Parse info
+ $count = count($mediainfo);
+ for ($i = 0; $i < $count; $i++)
+ {
+ if (!strncmp($mediainfo[$i], "Video", strlen("Video")) || !strncmp($mediainfo[$i], "Audio", strlen("Audio")))
+ break;
+
+ if (!strncmp($mediainfo[$i], "Format", strlen("Format")))
+ $title = substr(strstr($mediainfo[$i], ": "), 2);
+ else if (!strncmp($mediainfo[$i], "Format/Info", strlen("Format/Info")))
+ $title = substr(strstr($mediainfo[$i], ": "), 2);
+ else if (!strncmp($mediainfo[$i], "Duration", strlen("Duration")))
+ $info = substr(strstr($mediainfo[$i], ": "), 2);
+ }
+
+ // Extract a thumbnail
+ exec("rm ram/stream-tb.png");
+ exec($ffmpegpath ." -y -i \"" .$stream ."\" -an -ss 00:00:05.00 -r 1 -vframes 1 -s 80x80 -f mjpeg ram/stream-tb.png");
+
+ return array($title, $info);
+}
+
+