From 275c3cd3d4532aa927945a940bb9c5b8304ba365 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Sat, 27 Mar 2010 19:46:30 +0100 Subject: Added debug mode --- bin/files.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'bin/files.php') diff --git a/bin/files.php b/bin/files.php index 483eefc..64ebc7b 100755 --- a/bin/files.php +++ b/bin/files.php @@ -4,6 +4,8 @@ function mediagetinfostream($stream) { $info = array(); + addlog("Requesting media info from " .$stream); + // Get info $getid3 = new getID3; $fileinfo = $getid3->analyze($stream); @@ -32,6 +34,8 @@ function mediagentb($stream, $dest) { global $ffmpegpath; + addlog("Generating thumbnail for stream " .$stream ." to " .$dest); + // Get info $getid3 = new getID3; $fileinfo = $getid3->analyze($stream); @@ -72,9 +76,11 @@ 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"); + $cmd = "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); + $cmd = $ffmpegpath ." -y -i \"" .$stream ."\" -an -ss 00:00:05.00 -r 1 -vframes 1 -s " .$resx ."x" .$resy ." -f mjpeg " .$dest; + + addlog("Thumbnail generation command: " .$cmd); if (!file_exists($dest)) exec('cp ../logos/nologoMEDIA.png ' .$dest); @@ -107,6 +113,8 @@ function filegettype($file) function mediagetmusicinfo($file) { + addlog("Getting info for music file: " .$file); + // Get info $getid3 = new getID3; $fileinfo = $getid3->analyze($file); @@ -133,6 +141,8 @@ function mediagetmusicinfo($file) function generatelogo($type, $name, $dest) { + addlog("Generating stream logo for file " .$name ." of type " .$type); + switch ($type) { case 'tv': @@ -158,6 +168,8 @@ function generatelogo($type, $name, $dest) function filesgetlisting($dir) { + addlog("Listing dir: " .$dir); + $filelisting = array(); $folderlisting = array(); -- cgit v1.2.3