note 30060 added to function.getimagesize
| From: | robertks at hotmail dot com | Date: | Wed, 05 Mar 2003 15:12:28 +0000 |
| Subject: | note 30060 added to function.getimagesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-44879@lists.php.net to get a copy of this message | ||
For those of you trying to derive the dimensions of a video file (e.g. Video for Windows AVI,
Quicktime MOV, MPEG MPG, Windows Media Video WMV or ASF, etc.), you will find the getid3 library to
be indispensible. Found at http://getid3.sourceforge.net, here's an example of
its use in a script:
include_once('getid3.php'); // or wherever you actually put the getid3 scripts
$file_location = './myvideo.avi';
$file_info = GetAllFileInfo($file_location) // calls getid3 function
$file_width = $file_info['video']['resolution_x'];
$file_height = $file_info['video']['resolution_y'];
You can then use your OBJECT and EMBED tags in HTML to put the video into a web page, and make the
PHP template independent of the size parameters of the particular video it happens to be loading.
(Just remember to add pixels to the video height to accomodate the controller of the embedded
player: typically, 16 pixels for Quicktime, 46 pixels for Windows Media Player 6, and 64 pixels for
Windows Media Player 7.
--
http://www.php.net/manual/en/function.getimagesize.php
http://master.php.net/manage/user-notes.php?action=edit+30060
http://master.php.net/manage/user-notes.php?action=delete+30060
http://master.php.net/manage/user-notes.php?action=reject+30060