Fatal error Cannot instantiate non-existent class

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Fatal error Cannot instantiate non-existent class

Post by amir »

Hi Guys
I have a script that converts any video format into a flv file using ffmpeg,
the issues is I have installed it, here is the config

running on windows , apache, php and mysql.

I can open the website fine, I can login, when I try to upload a video i get the following error.

"Fatal error: Cannot instantiate non-existent class: ffmpeg_movie in C:\Program Files\Apache Group\Apache2\htdocs\testtube\upload.php on line 83"

here is the section of upload.php that has line 83.
--------------------------------------------------------------------------------------------------------------------------------------------------

Code: Select all

if(isset($_FILES['field_uploadfile']['tmp_name']) && is_uploaded_file($_FILES['field_uploadfile']['tmp_name']))
                    {
                              $ff = $config[vdodir]."/".$vdoname;
                         if(move_uploaded_file($_FILES['field_uploadfile']['tmp_name'], $ff))
(THIS IS LINE 83)------------------->>>       {     $mov = new ffmpeg_movie($ff);
                                   video_to_frame($ff,$vid,&$mov,$listch[0]);
                                   $duration=$mov->getDuration();
                                   //exec("$config[ffmpeg] -i $config[vdodir]/$vdoname -acodec mp3 -ar 22050 -ab 32 -f flv $config[flvdodir]/".$vid.".flv");
                                   exec("c:/ffmpeg/ffmpeg -i $config[vdodir]/$vdoname -acodec mp3 -ar 22050 -ab 32 -f flv $config[flvdodir]/".$vid.".flv");
----------------------------------------------------------------------------------------------------------------------------------------------------

All help is appreiciated.

Thanks
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Have you got the ffmpeg-php extension installed?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

did you require the class into the page?

require 'ffmpeg.class.php';
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Post by amir »

I have looked all over, can you give me exact step by step instruction on how to install ffmpeg-php. I assumed the script came with the extension installed.
I am new to php that is why if you can give detailed info for setting that up on a windows machine atleast I will be able to check if it is installled or not and if it is not I can install it.

Thanks
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Post by Jade »

They should have instructions on php.net if you search for ffmpeg-php
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Jade wrote:They should have instructions on php.net if you search for ffmpeg-php
sure? A short google search "only" found a project hosted at sourceforge.
http://ffmpeg-php.sourceforge.net/ wrote:Compatibility
Some users have posted Windows builds to the ffmpeg-php google group. I hear from folks that they work great but I haven't had time to test them personally yet.
Post Reply