ClipShare Community Forums  

Go Back   ClipShare Community Forums > ClipShare - Video Sharing Community Script - General Forum > General Discussion
Register FAQ Bug Tracker Members List Calendar Mark Forums Read

General Discussion Discuss about ClipShare hosting, promotion, SEO, niches or anything else that does not fit in the other forums


Reply
 
Thread Tools Display Modes
Old 06-14-2009, 03:24 PM   #1
rg45
Member
|Forum Newbie|
 
Join Date: Jun 2009
Posts: 9
rg45 is on a distinguished road
Default Problems with MEncoder, Conversion does not work

All modules are installed, clipshare detects them.
MEconder is not converting video files into flv. Uploads are working and I can see thumbnails being generated. so its not a mplayer issue either.
After uploading I get a uploading was success msg and when i try to play the video. it does not play.

I manually tried not converting videos with command life, after that clipshare is playing them normally.

here is my convert.php
Code:
PHP Code:
<?php require('include/config.php'); require('include/function.php'); // Get arguments from the argv array $vdoname $_SERVER['argv']['1']; $vid $_SERVER['argv']['2']; $ff $_SERVER['argv']['3']; if( ( $vdoname != '' ) && ( $vid != '' ) && ( $ff != '') ) {     $ext                strtolower(substr($vdonamestrrpos($vdoname'.') + 1));     $ofps               = ( $ext == 'wmv' ) ? '-ofps 25000/1001' NULL;     $mencoder_version   '1.0rc1';     exec($config['mencoder'], $mencoder_check);     if ( isset($mencoder_check['0']) ) {         if ( !strstr($mencoder_check['0'], 'MEncoder 1.0rc1') ) {             $mencoder_version '1.0rc2';         }     }     $options            = ( $mencoder_version == '1.0rc1' ) ? '-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames' NULL; if($config[vresize] == 1) {$encodecommand="$config[mencoder] $config[vdodir]/$vdoname -o $config[flvdodir]/".$vid."x.flv -demuxer lavf -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=$config[vbitrate]:mbd=2:mv0:trell:v4mv:keyint=10:cbp:last _pred=3 -vf scale=$config[vresize_x]:$config[vresize_y] -srate $config[sbitrate]";}         log_conversion($config['LOG_DIR']. '/' .$vid'.log'$encodecommand);         $ext strtolower(substr($vdonamestrrpos($vdoname'.') + 1));         if ( $config['vresize'] != && $ext == 'flv' )                 copy($ff$config['FLVDO_DIR']. '/' .$vid'x.flv');         else                 exec($encodecommand' 2>&1'$output);         log_conversion($config['LOG_DIR']. '/' .$vid'.log'implode("\n"$output));         //update flv metatags         exec($config['metainject']. ' -Uv ' .$config['FLVDO_DIR']. '/' .$vid'x.flv ' .$config['FLVDO_DIR']. '/' .$vid'.flv');         //remove temporary         @unlink($config['FLVDO_DIR']. '/' .$vid'x.flv');         //create thumbnails         video_to_frame($ff$vid);         //delete log if conversion was successfuly         if ( file_exists($config['FLVDO_DIR']. '/' .$vid'.flv') && filesize($config['FLVDO_DIR']. '/' .$vid'.flv') > 10 )                 @unlink($config['TMP_DIR']. '/logs/' .$vid'.log');         //delete original video         if($config['del_original_video'] == 1)  {                 if(filesize($config['FLVDO_DIR']. '/' .$vid'.flv') > 100 && file_exists($config['FLVDO_DIR']. '/' .$vid'.flv')) {                         $del_upvid $config['VDO_DIR']. '/' .$vdoname;                         @chmod($del_upvid0777);                         @unlink($del_upvid);                 }         } exec($config['mencoder'], $mencoder_check);     if ( isset($mencoder_check['0']) ) {         if ( !strstr($mencoder_check['0'], 'MEncoder 1.0rc1') ) {             $mencoder_version '1.0rc2';         }     }     $options            = ( $mencoder_version == '1.0rc1' ) ? '-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames' NULL; if($config[vresize] == 1) {$encodecommand="$config[mencoder] $config[vdodir]/$vdoname -o $config[flvdodir]/".$vid."x.flv -demuxer lavf -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=$config[vbitrate]:mbd=2:mv0:trell:v4mv:keyint=10:cbp:last _pred=3 -vf scale=$config[vresize_x]:$config[vresize_y] -srate $config[sbitrate]";}         log_conversion($config['LOG_DIR']. '/' .$vid'.log'$encodecommand);         $ext strtolower(substr($vdonamestrrpos($vdoname'.') + 1));         if ( $config['vresize'] != && $ext == 'flv' )                 copy($ff$config['FLVDO_DIR']. '/' .$vid'x.flv');         else                 exec($encodecommand' 2>&1'$output);         log_conversion($config['LOG_DIR']. '/' .$vid'.log'implode("\n"$output));         //update flv metatags         exec($config['metainject']. ' -Uv ' .$config['FLVDO_DIR']. '/' .$vid'x.flv ' .$config['FLVDO_DIR']. '/' .$vid'.flv');         //remove temporary         @unlink($config['FLVDO_DIR']. '/' .$vid'x.flv');         //create thumbnails         video_to_frame($ff$vid);         //delete log if conversion was successfuly         if ( file_exists($config['FLVDO_DIR']. '/' .$vid'.flv') && filesize($config['FLVDO_DIR']. '/' .$vid'.flv') > 10 )                 @unlink($config['TMP_DIR']. '/logs/' .$vid'.log');         //delete original video         if($config['del_original_video'] == 1)  {                 if(filesize($config['FLVDO_DIR']. '/' .$vid'.flv') > 100 && file_exists($config['FLVDO_DIR']. '/' .$vid'.flv')) {                         $del_upvid $config['VDO_DIR']. '/' .$vdoname;                         @chmod($del_upvid0777);                         @unlink($del_upvid);                 }         }         // Delete Tmp Files         $picA $config['TMP_DIR']. '/thumbs/' .$vid'/00000001.jpg';         $picB $config['TMP_DIR']. '/thumbs/' .$vid'/00000002.jpg';         $picC $config['TMP_DIR']. '/thumbs/' .$vid'/00000003.jpg';         $picD $config['TMP_DIR']. '/thumbs/' .$vid'/00000004.jpg';         if(file_exists($picA)) @unlink($picA);         if(file_exists($picB)) @unlink($picB);         if(file_exists($picC)) @unlink($picC);         if(file_exists($picD)) @unlink($picD);         @rmdir($config['TMP_DIR']. '/thumbs/' .$vid); } ?>
rg45 is offline   Reply With Quote
Old 06-14-2009, 03:24 PM   #2
rg45
Member
|Forum Newbie|
 
Join Date: Jun 2009
Posts: 9
rg45 is on a distinguished road
Default

here is my convert.php
PHP Code:
<?php
require('include/config.php');
require(
'include/function.php');

// Get arguments from the argv array
$vdoname $_SERVER['argv']['1'];
$vid $_SERVER['argv']['2'];
$ff $_SERVER['argv']['3'];

if( ( 
$vdoname != '' ) && ( $vid != '' ) && ( $ff != '') ) {
    
$ext                strtolower(substr($vdonamestrrpos($vdoname'.') + 1));
    
$ofps               = ( $ext == 'wmv' ) ? '-ofps 25000/1001' NULL;
    
$mencoder_version   '1.0rc1';
    
exec($config['mencoder'], $mencoder_check);
    if ( isset(
$mencoder_check['0']) ) {
        if ( !
strstr($mencoder_check['0'], 'MEncoder 1.0rc1') ) {
            
$mencoder_version '1.0rc2';
        }
    }
    
$options            = ( $mencoder_version == '1.0rc1' ) ? '-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames' NULL;

if(
$config[vresize] == 1) {$encodecommand="$config[mencoder] $config[vdodir]/$vdoname -o $config[flvdodir]/".$vid."x.flv -demuxer lavf -of lavf -oac

mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=$config[vbitrate]:mbd=2:mv0:trell:v4mv:keyint=10:cbp:last _pred=3 -vf

scale=$config[vresize_x]:$config[vresize_y] -srate $config[sbitrate]"
;}

        
log_conversion($config['LOG_DIR']. '/' .$vid'.log'$encodecommand);

        
$ext strtolower(substr($vdonamestrrpos($vdoname'.') + 1));
        if ( 
$config['vresize'] != && $ext == 'flv' )
                
copy($ff$config['FLVDO_DIR']. '/' .$vid'x.flv');
        else
                
exec($encodecommand' 2>&1'$output);

        
log_conversion($config['LOG_DIR']. '/' .$vid'.log'implode("\n"$output));

        
//update flv metatags
        
exec($config['metainject']. ' -Uv ' .$config['FLVDO_DIR']. '/' .$vid'x.flv ' .$config['FLVDO_DIR']. '/' .$vid'.flv');

        
//remove temporary
        
@unlink($config['FLVDO_DIR']. '/' .$vid'x.flv');

        
//create thumbnails
        
video_to_frame($ff$vid);

        
//delete log if conversion was successfuly
        
if ( file_exists($config['FLVDO_DIR']. '/' .$vid'.flv') && filesize($config['FLVDO_DIR']. '/' .$vid'.flv') > 10 )
                @
unlink($config['TMP_DIR']. '/logs/' .$vid'.log');

        
//delete original video
        
if($config['del_original_video'] == 1)  {
                if(
filesize($config['FLVDO_DIR']. '/' .$vid'.flv') > 100 && file_exists($config['FLVDO_DIR']. '/' .$vid'.flv')) {
                        
$del_upvid $config['VDO_DIR']. '/' .$vdoname;
                        @
chmod($del_upvid0777);
                        @
unlink($del_upvid);
                }
        }
exec($config['mencoder'], $mencoder_check);
    if ( isset(
$mencoder_check['0']) ) {
        if ( !
strstr($mencoder_check['0'], 'MEncoder 1.0rc1') ) {
            
$mencoder_version '1.0rc2';
        }
    }
    
$options            = ( $mencoder_version == '1.0rc1' ) ? '-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames' NULL;

if(
$config[vresize] == 1) {$encodecommand="$config[mencoder] $config[vdodir]/$vdoname -o $config[flvdodir]/".$vid."x.flv -demuxer lavf -of lavf -oac

mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=$config[vbitrate]:mbd=2:mv0:trell:v4mv:keyint=10:cbp:last _pred=3 -vf

scale=$config[vresize_x]:$config[vresize_y] -srate $config[sbitrate]"
;}

        
log_conversion($config['LOG_DIR']. '/' .$vid'.log'$encodecommand);

        
$ext strtolower(substr($vdonamestrrpos($vdoname'.') + 1));
        if ( 
$config['vresize'] != && $ext == 'flv' )
                
copy($ff$config['FLVDO_DIR']. '/' .$vid'x.flv');
        else
                
exec($encodecommand' 2>&1'$output);

        
log_conversion($config['LOG_DIR']. '/' .$vid'.log'implode("\n"$output));

        
//update flv metatags
        
exec($config['metainject']. ' -Uv ' .$config['FLVDO_DIR']. '/' .$vid'x.flv ' .$config['FLVDO_DIR']. '/' .$vid'.flv');

        
//remove temporary
        
@unlink($config['FLVDO_DIR']. '/' .$vid'x.flv');

        
//create thumbnails
        
video_to_frame($ff$vid);

        
//delete log if conversion was successfuly
        
if ( file_exists($config['FLVDO_DIR']. '/' .$vid'.flv') && filesize($config['FLVDO_DIR']. '/' .$vid'.flv') > 10 )
                @
unlink($config['TMP_DIR']. '/logs/' .$vid'.log');

        
//delete original video
        
if($config['del_original_video'] == 1)  {
                if(
filesize($config['FLVDO_DIR']. '/' .$vid'.flv') > 100 && file_exists($config['FLVDO_DIR']. '/' .$vid'.flv')) {
                        
$del_upvid $config['VDO_DIR']. '/' .$vdoname;
                        @
chmod($del_upvid0777);
                        @
unlink($del_upvid);
                }
        }

        
// Delete Tmp Files
        
$picA $config['TMP_DIR']. '/thumbs/' .$vid'/00000001.jpg';
        
$picB $config['TMP_DIR']. '/thumbs/' .$vid'/00000002.jpg';
        
$picC $config['TMP_DIR']. '/thumbs/' .$vid'/00000003.jpg';
        
$picD $config['TMP_DIR']. '/thumbs/' .$vid'/00000004.jpg';
        if(
file_exists($picA)) @unlink($picA);
        if(
file_exists($picB)) @unlink($picB);
        if(
file_exists($picC)) @unlink($picC);
        if(
file_exists($picD)) @unlink($picD);

        @
rmdir($config['TMP_DIR']. '/thumbs/' .$vid);
}
?>
rg45 is offline   Reply With Quote
Old 06-15-2009, 04:41 PM   #3
kumbaia
Member
|Forum Regular|
 
Join Date: Apr 2008
Posts: 161
kumbaia is on a distinguished road
Default

It has nothing to do with convert.php the code works just fine. Its a server configuration issue. Pm me.
kumbaia is offline   Reply With Quote
Old 06-29-2009, 11:03 AM   #4
muspages
Member
|Forum Newbie|
 
Join Date: Jun 2009
Posts: 3
muspages is on a distinguished road
Default

Undefined index: vdodir in .../user/htdocs/convert.php on line 22
PHP Notice: Undefined index: flvdodir in .../user/htdocs/convert.php on line 22
PHP Warning: filesize(): stat failed for .../user/htdocs/flvideo/32.flv in .../user/htdocs/convert.php on line 51
No file given
PHP Notice: Use of undefined constant vresize - assumed 'vresize' in .../user/htdocs/convert.php on line 22
PHP Notice: Undefined index: vdodir in .../user/htdocs/convert.php on line 24
PHP Notice: Undefined index: flvdodir in .../user/htdocs/convert.php on line 24
PHP Warning: filesize(): stat failed for .../user/htdocs/flvideo/33.flv in .../user/htdocs/convert.php on line 51
muspages is offline   Reply With Quote
Old 07-09-2009, 06:08 AM   #5
noobz
Member
|Forum Newbie|
 
noobz's Avatar
 
Join Date: May 2008
Posts: 38
noobz is on a distinguished road
Default

why dont try use ffmpeg? If that not working you need to recompile your ffmpeg and ffmpeg-php
__________________
Recommended VPS/Hosting for clipshare

noobz is offline   Reply With Quote
Old 05-10-2010, 05:58 AM   #6
PRIZM
Member
|Forum Newbie|
 
Join Date: Jul 2009
Location: Palm Beach
Posts: 6
PRIZM is on a distinguished road
Send a message via Yahoo to PRIZM Send a message via Skype™ to PRIZM
Default

This is my convert.php code but its not converting and im not getting thumbnail images ether. I am getting video uploads to the /video/ Directory but will not convert to the /flvideo/ directory for playback. Hmmm. Clipshare is detecting all the modules in admin. Any help would be great.

<?php
require('include/config.php');
require('include/function.php');

// Get arguments from the argv array
$vdoname = $_SERVER['argv']['1'];
$vid = $_SERVER['argv']['2'];
$ff = $_SERVER['argv']['3'];

if( ( $vdoname != '' ) && ( $vid != '' ) && ( $ff != '') ) {
$ext = strtolower(substr($vdoname, strrpos($vdoname, '.') + 1));
$ofps = ( $ext == 'wmv' ) ? '-ofps 25000/1001' : NULL;
$mencoder_version = '1.0rc1';
exec($config['mencoder'], $mencoder_check);
if ( isset($mencoder_check['0']) ) {
if ( !strstr($mencoder_check['0'], 'MEncoder 1.0rc1') ) {
$mencoder_version = '1.0rc2';
}
}
$options = ( $mencoder_version == '1.0rc1' ) ? '-lavfopts i_certify_that_my_video_stream_does_not_use_b_fram es' : NULL;

if( $config['vresize'] == 1) {
$encodecommand="$config[mencoder] $config[VDO_DIR]/$vdoname -o $config[FLVDO_DIR]/".$vid."x.flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=$config[vbitrate]:mbd=2:mv0:trell:v4mv:keyint=10:cbp:last_pred=3 -vop scale=$config[vresize_x]:$config[vresize_y] -srate $config[sbitrate] $options $ofps";
} else {
$encodecommand="$config[mencoder] $config[VDO_DIR]/$vdoname -o $config[FLVDO_DIR]/".$vid."x.flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=$config[vbitrate]:mbd=2:mv0:trell:v4mv:keyint=10:cbp:last_pred=3 -srate $config[sbitrate] $options $ofps";
}

log_conversion($config['LOG_DIR']. '/' .$vid. '.log', $encodecommand);

$ext = strtolower(substr($vdoname, strrpos($vdoname, '.') + 1));
if ( $config['vresize'] != 1 && $ext == 'flv' )
copy($ff, $config['FLVDO_DIR']. '/' .$vid. 'x.flv');
else
exec($encodecommand. ' 2>&1', $output);

log_conversion($config['LOG_DIR']. '/' .$vid. '.log', implode("\n", $output));

//update flv metatags
exec($config['metainject']. ' -Uv ' .$config['FLVDO_DIR']. '/' .$vid. 'x.flv ' .$config['FLVDO_DIR']. '/' .$vid. '.flv');

//remove temporary
@unlink($config['FLVDO_DIR']. '/' .$vid. 'x.flv');

//create thumbnails
video_to_frame($ff, $vid);

//delete log if conversion was successfuly
if ( file_exists($config['FLVDO_DIR']. '/' .$vid. '.flv') && filesize($config['FLVDO_DIR']. '/' .$vid. '.flv') > 10 )
@unlink($config['TMP_DIR']. '/logs/' .$vid. '.log');

//delete original video
if($config['del_original_video'] == 1) {
if(filesize($config['FLVDO_DIR']. '/' .$vid. '.flv') > 100 && file_exists($config['FLVDO_DIR']. '/' .$vid. '.flv')) {
$del_upvid = $config['VDO_DIR']. '/' .$vdoname;
@chmod($del_upvid, 0777);
@unlink($del_upvid);
}
}

// Delete Tmp Files
$picA = $config['TMP_DIR']. '/thumbs/' .$vid. '/00000001.jpg';
$picB = $config['TMP_DIR']. '/thumbs/' .$vid. '/00000002.jpg';
$picC = $config['TMP_DIR']. '/thumbs/' .$vid. '/00000003.jpg';
$picD = $config['TMP_DIR']. '/thumbs/' .$vid. '/00000004.jpg';
if(file_exists($picA)) @unlink($picA);
if(file_exists($picB)) @unlink($picB);
if(file_exists($picC)) @unlink($picC);
if(file_exists($picD)) @unlink($picD);

@rmdir($config['TMP_DIR']. '/thumbs/' .$vid);
}
?>
__________________
Big Pimpin!
$PRIZOMATIC$
PRIZM is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT +1. The time now is 04:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright © 2006-2008 Envient. All Rights Reserved.

An Envient product.