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,376 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySQL Sub-Select Query Returning Duplicate Result 7 45
php56-php-mcrypt for rhel7 php56 1 54
PHP Echo with auto submit 8 28
Correct syntax for subdirectories 9 19
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

839 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