note 47785 deleted from function.getimagesize by cmb
| From: | cmb@php.net | Date: | Sun, 18 Dec 2016 09:46:42 +0000 |
| Subject: | note 47785 deleted from function.getimagesize by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208643@lists.php.net to get a copy of this message | ||
Note Submitter: sixzero4 at hotmail dot com
----
This is just to add to the comment by robertks at hotmail dot com on
05-Mar-2003 12:12 regarding trying to derive the dimensions of a video file. The package referenced
(http://www.getid3.org/) had been updated, and below is a script I use to get the size. You can get
many other attributes of media files as well.
<?php
// include getID3() library (can be in a different directory if full path is specified)
include_once('getid3.php');
// Initialize getID3 engine
$getID3 = new getID3;
// File to get info from
$file_location = './your/path/to/file.mov';
// Get information from the file
$fileinfo = $getID3->analyze($file_location);
getid3_lib::CopyTagsToComments($fileinfo);
// Output results
if (!empty($fileinfo['video']['resolution_x'])) { echo '<p> video
width: '.$fileinfo['video']['resolution_x'].'</p>'; }
if (!empty($fileinfo['video']['resolution_y'])) { echo '<p> video
height: '.$fileinfo['video']['resolution_y'].'</p>'; }
?>
Hope that helps others looking for a function similar to getimagesize() for a video or media file.