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,378 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
ID: 18004571
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
ID: 18004573
You need ffmpeg php and also ffmpeg

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

685 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