Just get length of media and put into variable?

The place for "I can't figure out how to..." questions.
Post Reply
spoofm0nkey
User
Posts: 2
Joined: Sun Jan 21, 2007 7:43 pm
Location: Brooklyn, NY

Just get length of media and put into variable?

Post by spoofm0nkey » Sun Jan 21, 2007 7:55 pm

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!

James Heinrich
getID3() v1 developer
Posts: 1476
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Post by James Heinrich » Mon Jan 22, 2007 1:17 pm

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'];

spoofm0nkey
User
Posts: 2
Joined: Sun Jan 21, 2007 7:43 pm
Location: Brooklyn, NY

Post by spoofm0nkey » Sat Jan 27, 2007 3:19 am

All I need is that code? I don't need any of the files in the script?

James Heinrich
getID3() v1 developer
Posts: 1476
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Post by James Heinrich » Sat Jan 27, 2007 2:27 pm

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.

Post Reply