Is there anything similar to getimagesize to get the width and the height of a video?
I´ve uploaded some videos to my server and would like to find out those infos using php.
Any ideas?
Printable View
Is there anything similar to getimagesize to get the width and the height of a video?
I´ve uploaded some videos to my server and would like to find out those infos using php.
Any ideas?
I have yet to see this done. I even checked at PHP Classes.
Well depending on the video formats you have you can use
http://getid3.sourceforge.net/
That gets tag information. Dimensions are not stored in ID3 tags.
getid3() is not only about id3 tags!
From the HP
"getID3() is a PHP script that extracts useful information from MP3s & other multimedia file formats"
e.g.
will give you backPHP Code:<?php
require_once('getid3-2.0.0b4/getid3/getid3.php');
$getID3 = new getID3;
$filename = "vid/clock.avi";
$fileinfo = $getID3->analyze($filename);
echo "<pre>";
print_r($fileinfo);
echo "</pre>";
?>
check-outPHP Code:.............................
.............................
[video] => Array
(
[bitrate_mode] => vbr
[dataformat] => avi
[resolution_x] => 321
[resolution_y] => 321
[total_frames] => 12
[frame_rate] => 1
[fourcc] => RLE
[codec] => Microsoft Run Length Encoder
[pixel_aspect_ratio] => 1
[lossless] =>
[bits_per_sample] => 8
[bitrate] => 43622.6666667
[compression_ratio] => 0.0529190645795
)
......................
......................
http://getid3.sourceforge.net/source/structure.txt
for the whole structure
Here you can find more examples
http://getid3.org/phpBB2/viewforum.php?f=3
Ah, I missed that. Nice work!!! :thumb: