From 5dd7d3eb46a9f86da3f8cba5b4920534c163946d Mon Sep 17 00:00:00 2001 From: rWatcher Date: Thu, 16 Sep 2010 23:32:00 -0400 Subject: [PATCH] Added a library for determining FLV height and width. --- modules/noffmpeg/helpers/movie.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/noffmpeg/helpers/movie.php b/modules/noffmpeg/helpers/movie.php index 801796b8..40d0940a 100644 --- a/modules/noffmpeg/helpers/movie.php +++ b/modules/noffmpeg/helpers/movie.php @@ -23,6 +23,9 @@ * * Note: by design, this class does not do any permission checking. */ + +include MODPATH . "noffmpeg/libraries/MP4Info.php"; + class movie_Core { static function get_edit_form($movie) { $form = new Forge("movies/update/$movie->id", "", "post", array("id" => "g-edit-movie-form")); @@ -113,7 +116,17 @@ class movie_Core { $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? "video/mp4" : "video/x-flv"; - return array(320, 240, $mime_type, $extension); + $vid_width = 320; + $vid_height = 240; + if (strtolower($extension) == "flv") { + $flvinfo = new FLVMetaData($file_path); + $info = $flvinfo->getMetaData(); + if (($info["width"] != "") && ($info["height"] != "")) { + $vid_width = $info["width"]; + $vid_height = $info["height"]; + } + } + return array($vid_width, $vid_height, $mime_type, $extension); //throw new Exception("@todo MISSING_FFMPEG"); // END rWatcher Edit. }