From bdfebadb0d8f241dea056417cb14ce314c0c4ae9 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Wed, 17 Mar 2010 19:27:09 +0100 Subject: Generate video logo and print info --- bin/files.php | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'bin/files.php') diff --git a/bin/files.php b/bin/files.php index f39ee98..ba82d21 100755 --- a/bin/files.php +++ b/bin/files.php @@ -2,22 +2,21 @@ function mediagetinfostream($stream) { + $info = array(); + // Get info $getid3 = new getID3; $fileinfo = $getid3->analyze($stream); - $title = "Media:"; - $info = "Duration: " .sec2hms($fileinfo['playtime_seconds']) ."
"; - if ($fileinfo['fileformat']) - $info .= "Format: " .$fileinfo['fileformat'] ."
"; - if ($fileinfo['video']['codec']) - $info .= "Video: " .$fileinfo['video']['codec'] ."
"; - if ($fileinfo['audio']['codec']) - $info .= "Audio: " .$fileinfo['audio']['codec'] ."
"; - if ($fileinfo['video']['resolution_x']) - $info .= "Resolution: " .$fileinfo['video']['resolution_x'] ."x" .$fileinfo['video']['resolution_y'] ."
"; - - return array($title, $info); + $info['name'] = basename($stream); + $info['desc'] = ""; + $info['duration'] = sec2hms($fileinfo['playtime_seconds']); + $info['format'] = $fileinfo['fileformat']; + $info['video'] = $fileinfo['video']['codec']; + $info['audio'] = $fileinfo['audio']['codec']; + $info['resolution'] = $fileinfo['video']['resolution_x'] ."x" .$fileinfo['video']['resolution_y']; + + return $info; } function mediagentb($stream, $dest) @@ -64,12 +63,12 @@ function mediagentb($stream, $dest) } if ($file) - exec("cp \"" .$file ."\" ram/stream-tb-tmp.jpg; " .$ffmpegpath ." -y -i ram/stream-tb-tmp.jpg -s " .$resx ."x" .$resy ." " .$dest ." ; rm ram/stream-tb-tmp.jpg"); + exec("cp \"" .$file ."\" ../ram/stream-tb-tmp.jpg; " .$ffmpegpath ." -y -i ../ram/stream-tb-tmp.jpg -s " .$resx ."x" .$resy ." " .$dest ." ; rm ../ram/stream-tb-tmp.jpg"); else exec($ffmpegpath ." -y -i \"" .$stream ."\" -an -ss 00:00:05.00 -r 1 -vframes 1 -s " .$resx ."x" .$resy ." -f mjpeg " .$dest); if (!file_exists($dest)) - exec('cp logos/nologoMEDIA.png ' .$dest); + exec('cp ../logos/nologoMEDIA.png ' .$dest); } function mediagetwidth($file) -- cgit v1.2.3