Page 1 of 1

Extracting video dimensions from an FLV file?

Posted: Thu Jul 09, 2009 11:35 pm
by Wolf_22
Without using the getid3 library, can this be accomplished with "getimagesize()"?

In my code, I have 2 conditions:

Code: Select all

if(!getimagesize("movies/{$file}")){
    $info = 'Someone call the police!';
    $width = $info;
    $height = $info;
}else{
    $info = getimagesize("movies/{$file}");
    $width = $info[0];
    $height = $info[1];
}
I'm ignorantly unable to understand why it keeps hitting the first IF. Anyone know? I know for a fact that $file is the name of the file (I've checked using echo--it's the correct name). It seems as if the script is unable to look in the sub-directory "movies."

Re: Extracting video dimensions from an FLV file?

Posted: Fri Jul 10, 2009 9:09 am
by Skara
php.net wrote:The getimagesize() function will determine the size of any given image file...
An flv is not an image file.

I think this will get you what you want: http://getid3.sourceforge.net/

Re: Extracting video dimensions from an FLV file?

Posted: Fri Jul 10, 2009 1:39 pm
by Wolf_22
Yep, it would appear you're right. I was just trying to avoid using that thing because it seems huge.

I'll give it a go, though.