Solved

250 points -You Tube Clone - Fatal error: Cannot instantiate non-existent class: ffmpeg_movie in /hsphere/local/home/nnishp/komalvish.nishantpatel.net/videos/upload.php line 83

Posted on 2006-11-23
4
2,366 Views
Last Modified: 2012-06-21
I am trying to install the youtube clone script on my site hosted by ixwebhosting and am getting this error:

Fatal error: Cannot instantiate non-existent class: ffmpeg_movie in /hsphere/local/home/nnishp/komalvish.nishantpatel.net/videos/upload.php line 83

I am told by the host that everything is ok from their end. The script for that page is:

<?php
include("include/config.php");
session_start();
include("include/function.php");
chk_member_login();
isMailVerified();
if($config['enable_package']=="yes")
{
        check_subscriber(100);
}


if($_REQUEST[action_upload]!="")
{
        if($_REQUEST[field_myvideo_title]==""){
                  $err="Upload: Please Provide a video title.";
            }
        elseif($_REQUEST[field_myvideo_descr]==""){
                  $err="Upload: Please Provide a video description.";
            }
        elseif($_REQUEST[field_myvideo_keywords]==""){
                  $err="Upload: Please provide tag/s.";
            }
        elseif(count($_REQUEST[chlist])<1 || count($_REQUEST[chlist])>3){
                  $err="Upload: Please check (1 to 3) channel/s.";
            }

        if($err==""){
                  $page = "second";
                  STemplate::assign('secondpage',"second");
                  $listch=implode("|",$_REQUEST[chlist]);
                  STemplate::assign('listch',$listch);
                  $var = "<script language=javascript>
                              var field_myvideo_title = $_REQUEST[field_myvideo_title];
                              var field_myvideo_descr = $_REQUEST[field_myvideo_descr];
                              var field_myvideo_keywords = $_REQUEST[field_myvideo_keywords];
                              var listch = $listch;
                              </script>";
                  STemplate::assign("var", $var);
        }
}
if($_POST[upload_final]!="")
{
        if($_FILES['field_uploadfile']['tmp_name']=="") $err="Please provide the video location.";
        if($err=="" && $_FILES['field_uploadfile']['tmp_name']!="")
                {
                $p=$_FILES['field_uploadfile']['name'];
                $pos=strrpos($p,".");
                $ph=strtolower(substr($p,$pos+1,strlen($p)-$pos));
                /* Space in Megabytes (MB) */
                $space = round($_FILES['field_uploadfile']['size']/(1024*1024));
                if($config['enable_package']=="yes")
                {
                        check_subscriber($space);
                }
               
                if(($ph!="mpg" && $ph!="avi" && $ph!="mpeg" && $ph!="wmv" && $ph!="rm" && $ph!="dat") || $space>$config[max_video_size])
                $err="Invalid Video Format.";
                }

        if($err=="")
        {
                $sql="insert into video set
                        UID=$_SESSION[UID],
                        title='$_REQUEST[field_myvideo_title]',
                        description='$_REQUEST[field_myvideo_descr]',
                        keyword='$_REQUEST[field_myvideo_keywords]',
                        channel='0|$_REQUEST[listch]|0',
                        space = '$_REQUEST[space]',
                        addtime='".time()."',
                        adddate='".date("Y-m-d")."',
                        vkey='".mt_rand()."',
                        type='$_REQUEST[field_privacy]',
                        filehome='$_REQUEST[p]'";
                $conn->execute($sql);
                $vid=mysql_insert_id();
                $vdoname=$vid.".".$ph;
             
                    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))
*******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");
                                    }
                       
                    }
                //END

                $key=substr(md5($vid),11,20);
                $sql="update video set
                        vdoname='$vdoname',
                        flvdoname='".$vid.".flv',
                        duration='$duration',
                        vkey='$key' WHERE VID=$vid";
                $conn->execute($sql);
       
                if($config['enable_package']=="yes")
                {
                        $sql = "update subscriber set used_space=used_space+$space, used_bw=used_bw+$space, total_video=total_video+1 where UID=$_SESSION[UID]";
                        $conn->execute($sql);
                }
       
                header("Location:$config[baseurl]/upload_success.php?viewkey=$key&upload=yes&vid=$vid");
        }
}


STemplate::assign('err',$err);
STemplate::assign('msg',$msg);
STemplate::assign('head_bottom',"blank.tpl");
STemplate::display('head1.tpl');
STemplate::display('err_msg.tpl');
STemplate::display('upload.tpl');
STemplate::display('footer.tpl');
?>

Can anyone see what could be cauing this problem? I thought it may be something to do with ym config.php file, here it is:

<?
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
session_start();
$config = array();
$config['BASE_DIR']        =  '/hsphere/local/home/nnishp/komalvish.nishantpatel.net/videos';
$config['BASE_URL']        =  'http://komalvish.nishantpatel.net/videos';
$config['CONF_FILE']        =  $config['BASE_DIR'].'/include/conf.ini';
$config['IMG_DIR']        =  $config['BASE_DIR'].'/images';
$config['IMG_URL']        =  $config['BASE_URL'].'/images';
$config['VDO_DIR']      =  $config['BASE_DIR'].'/video';
$config['VDO_URL']      =  $config['BASE_URL'].'/video';
$config['ADO_DIR']      =  $config['BASE_DIR'].'/audio';
$config['ADO_URL']      =  $config['BASE_URL'].'/audio';
$config['FLVDO_DIR']      =  $config['BASE_DIR'].'/flvideo';
$config['FLVDO_URL']      =  $config['BASE_URL'].'/flvideo';
$config['TMB_DIR']      =  $config['BASE_DIR'].'/thumb';
$config['TMB_URL']      =  $config['BASE_URL'].'/thumb';
$config['baseurl']      =  $config['BASE_URL'];
$config['basedir']      =  $config['BASE_DIR'];
$config['vdodir']       =  $config['VDO_DIR'];
$config['vdourl']       =  $config['VDO_URL'];
$config['audiodir']       =  $config['ADO_DIR'];
$config['audiourl']       =  $config['ADO_URL'];
$config['flvdodir']       =  $config['FLVDO_DIR'];
$config['flvdourl']       =  $config['FLVDO_URL'];
$config['imgurl']         =  $config['IMG_URL'];
$config['imgpath']        =  $config['IMG_DIR'];
$config['ffmpeg']       =   '#ffmpeg /usr/bin/ffmpeg';
$config['guest_limite'] = 200;
require_once($config['BASE_DIR'].'/smarty/libs/Smarty.class.php');
require_once($config['BASE_DIR'].'/classes/mysmarty.class.php');
require_once($config['BASE_DIR'].'/classes/SConfig.php');
require_once($config['BASE_DIR'].'/classes/SError.php');
require_once($config['BASE_DIR'].'/include/adodb/adodb.inc.php');
require_once($config['BASE_DIR'].'/include/phpmailer/class.phpmailer.php');
require_once($config['BASE_DIR'].'/classes/SEmail.php');

$DBTYPE = 'mysql';
$DBHOST = SConfig::get("Database", "host");
$DBUSER = SConfig::get("Database", "user_name");
$DBPASSWORD = SConfig::get("Database", "password");
$DBNAME = SConfig::get("Database", "db_name");

$conn = &ADONewConnection($DBTYPE);
$conn->PConnect($DBHOST, $DBUSER, $DBPASSWORD, $DBNAME);

$sql = "SELECT * from sconfig";
$rsc = $conn->Execute($sql);

if($rsc){while(!$rsc->EOF)
{
$field = $rsc->fields['soption'];
$config[$field] = $rsc->fields['svalue'];
STemplate::assign($field, $config[$field]);
@$rsc->MoveNext();
}}

STemplate::assign('bgcolor','#E8E8E8');
STemplate::assign('BASE_URL',       $config['BASE_URL']);
STemplate::assign('BASE_DIR',       $config['BASE_DIR']);
STemplate::assign('IMG_URL',        $config['IMG_URL']);
STemplate::assign('baseurl',       $config['BASE_URL']);
STemplate::assign('basedir',       $config['BASE_DIR']);
STemplate::assign('imgurl',        $config['IMG_URL']);
STemplate::assign('vdourl',        $config['VDO_URL']);
STemplate::assign('adourl',        $config['ADO_URL']);
STemplate::assign('flvdourl',       $config['FLVDO_URL']);
STemplate::assign('tmburl',        $config['TMB_URL']);
STemplate::setCompileDir($config['basedir']."/templates_c");
STemplate::setTplDir($config['basedir']."/templates");
?>

Please help!
0
Comment
Question by:nnishp
  • 2
4 Comments
 
LVL 11

Expert Comment

by:ch2
Comment Utility
Hi

You have to install ffmpeg_movie module, but it depence on your hosting.

ch2
0
 
LVL 11

Accepted Solution

by:
ch2 earned 250 total points
Comment Utility
You need ffmpeg php and also ffmpeg

http://ffmpeg-php.sourceforge.net/
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now