Can't get getId3 to return anything

The place for "I can't figure out how to..." questions.
Post Reply
derekjackson
User
Posts: 3
Joined: Mon Jul 30, 2007 3:33 pm

Can't get getId3 to return anything

Post by derekjackson » Mon Jul 30, 2007 3:46 pm

Hi,
I'm trying to use getId3 to return a quicktime movie's dimensions in pixels.

I've copied the contents of the getID3 zip file into my root directory including all the various subfolders it came with.

I've used the following code in my php file:

Code: Select all


// include getID3() library (can be in a different directory if full path is specified) 
                        include_once ('getid3/getid3/getid3.php'); 
  
                        // Initialize getID3 engine 
                        $getID3 = new getID3; 

                        // File to get info from 
                        $file_location = 'images/' . $section . '/' . $sector . '/' . $sector . '_' . $projecttext[$proj_num][9] . '_' . $i . '.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>'; 
                        }
                        else print "file empty"; 
                        if (!empty($fileinfo['video']['resolution_y'])) { 
                            echo '<p> video height: ' . $fileinfo['video']['resolution_y'] . '</p>'; 
                        }  
                        else print "file empty";
I just get the 'file empty' message each time.

Any ideas what might be wrong? Feeling very lost here!![/code]

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

Post by James Heinrich » Tue Jul 31, 2007 6:33 pm

Code: Select all

print_r($fileinfo);
Or, try browsing the file with demo.browse.php to see all the data returned for that file. Pay particular attention to the contents of [error] and [warnings] keys.

derekjackson
User
Posts: 3
Joined: Mon Jul 30, 2007 3:33 pm

Post by derekjackson » Wed Aug 01, 2007 8:22 am

The print_r command returns:

Code: Select all

Array ( [error] => Array ( [0] => "C:\Inetpub\wwwroot\LSI-Website\getid3\getid3\..GETID3_OS_DIRSLASHhelperapps" cannot be defined as GETID3_HELPERAPPSDIR because it does not exist ) )
Pointing the demo.browse to the directory of my movie file just returns:

Code: Select all

ERROR: Could not open directory: / 
I've installed the windows helperapps files into the default helperapps directory but I'm guessing it's not picking them up?

Any idea where the issue might be?! Have I installed getId3 incorrectly or something? Any help appreciated!

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Thu Aug 02, 2007 9:21 am

There is a bug in 1.7.7 on non-English versions of Windows. Try adding

define('GETID3_HELPERAPPSDIR', 'C:/helperapps/');

to your script at the top or try out the 1.7.8 beta - it should have the bug fixed.

derekjackson
User
Posts: 3
Joined: Mon Jul 30, 2007 3:33 pm

Post by derekjackson » Tue Aug 14, 2007 4:17 pm

That seems to have fixed it - cheers! :)

Post Reply