Page 1 of 1

Just get length of media and put into variable?

Posted: Sun Jan 21, 2007 7:55 pm
by spoofm0nkey
This script is amazing but extremely complicated. I'm pretty new at php.

I'm looking for something that gets only the length of a .mov and puts it into a variable. Couldn't find anything that has this feature besides this script.

Basically... if I knew php better I could possibly take a chunk out of this code. I don't though, was wondering if someone could just post it for me...

That's be freakin' awesome. Thanks!

Posted: Mon Jan 22, 2007 1:17 pm
by James Heinrich
Take a look at the supplied /demos/demo.basic.php

In short:

Code: Select all

$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($filename);

// take your pick which type you want:
$length_float     = $ThisFileInfo['playtime'];
$length_formatted = $ThisFileInfo['playtime_string'];

Posted: Sat Jan 27, 2007 3:19 am
by spoofm0nkey
All I need is that code? I don't need any of the files in the script?

Posted: Sat Jan 27, 2007 2:27 pm
by James Heinrich
No, you need most of the files in getID3. That's just how you call it and get the value you need. See the demo files for more usage examples.