diff options
author | TheTroll <trolldev@gmail.com> | 2010-02-26 18:14:05 +0100 |
---|---|---|
committer | TheTroll <trolldev@gmail.com> | 2010-02-26 18:14:05 +0100 |
commit | f25b6cae418e4262681cc52a626f943c94366424 (patch) | |
tree | 0c9c1d7e67e66addf94b299d6425997d7a7293bd /includes | |
parent | 9f48deba3bfbba05d6e8944026f73391dbc777fa (diff) | |
download | istreamdev-f25b6cae418e4262681cc52a626f943c94366424.tar.gz istreamdev-f25b6cae418e4262681cc52a626f943c94366424.tar.bz2 |
Fixed tb when Y>X
Diffstat (limited to 'includes')
-rwxr-xr-x | includes/inc_files.php | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/includes/inc_files.php b/includes/inc_files.php index a968dce..3215493 100755 --- a/includes/inc_files.php +++ b/includes/inc_files.php @@ -25,9 +25,6 @@ function mediagetinfostream($stream = "") exec("rm ram/stream-tb.*"); $path = dirname($stream); - //Default res Y - $resy = 100; - if (file_exists(substr($stream, 0, -4) .".tbn")) $file = substr($stream, 0, -4) .".tbn"; else if (file_exists($path ."/poster.jpg")) @@ -37,22 +34,34 @@ function mediagetinfostream($stream = "") else $file = ""; + $resx = 180; + $resy = 100; + if ($file) { - $getid3 = new getID3; + $getid3 = new getID3; $fileinfo = $getid3->analyze($file); - if ($fileinfo['video']['resolution_y'] && $fileinfo['video']['resolution_x']) - $resy = ($fileinfo['video']['resolution_y'] * 180) / $fileinfo['video']['resolution_x']; - - exec("cp \"" .$file ."\" ram/stream-tb-tmp.jpg; " .$ffmpegpath ." -y -i ram/stream-tb-tmp.jpg -s 180x" .$resy ." ram/stream-tb.jpg"); } - else + + if ($fileinfo['video']['resolution_y'] && $fileinfo['video']['resolution_x']) { - if ($fileinfo['video']['resolution_y'] && $fileinfo['video']['resolution_x']) + if ($$fileinfo['video']['resolution_y'] < $fileinfo['video']['resolution_x']) + { + $resx = 180; $resy = ($fileinfo['video']['resolution_y'] * 180) / $fileinfo['video']['resolution_x']; + } + else + { + $resx = ($fileinfo['video']['resolution_x'] * 100) / $fileinfo['video']['resolution_y']; + $resy = 100; + } + } + + if ($file) + exec("cp \"" .$file ."\" ram/stream-tb-tmp.jpg; " .$ffmpegpath ." -y -i ram/stream-tb-tmp.jpg -s 180x" .$resy ." ram/stream-tb.jpg"); + else exec($ffmpegpath ." -y -i \"" .$stream ."\" -an -ss 00:00:05.00 -r 1 -vframes 1 -s 180x" .$resy ." -f mjpeg ram/stream-tb.png"); - } return array($title, $info); } |