PDA

View Full Version : ffmpeg


mainegate
10-21-2007, 10:05 PM
I don't understand what is wrong with this. Can someone see what is wrong..this is what I have in my .php file.

<? exec("/usr/local/bin/ffmpeg -i /home/bytehcom/public_html/test/test_video.avi -vcodec flv -f flv -r 29.97 -b 464kb -qscale 1 -ab 56kb -ac 1 -ar 22050 -s 480X360 /home/bytehcom/public_html/test/test.flv", $output); print_r($output); ?>

When I enter the address of the .php file on the server it says Array(). Anyone know what to do? FFMPEG is installed...ssh converts fine.

Andan
10-23-2007, 04:52 PM
Submit a support ticket and have one of the techs look at it. It might just be something simple you overlooked. :)

froghost
10-24-2007, 04:03 PM
I don't know if this is the problem but:

Q: I have uploaded a video but I can’t play it
A: Check if you have ALL required modules installed and configured on your server. Check if the paths to the module binaries are set correctly in config.php.
Check if there are any .flv or x.flv files in /flvideo folder.

You can try changing this line in convert.php:
exec("flvtool2 -Uv $config[flvdodir]/".$vid."x.flv $config[flvdodir]/".$vid.".flv");
to
exec("$config[metainject] -Uv $config[flvdodir]/".$vid."x.flv $config[flvdodir]/".$vid.".flv");


this information is on the ClipShare Documentation, Trouble Shooting Topic :D

Josh
10-24-2007, 05:53 PM
"Check if the paths to the module binaries are set correctly in config.php."

Can you paste this part of your config please - or check them with these:
http://support.cirtex.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=11
http://support.cirtex.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=25

Are the thumbnails etc appearing or is just the video?

realecom
12-20-2007, 10:25 AM
I'm one of your hosting clients (user name = realecom)
and the domain is - http://realtortape.com

I want to use in site ffmpeg functions:
I naw ffmpeg installed and worked properly in your hosting:
I checked it and i now the extension is loading and working true:

But... When i converting *wmv file to flv with this script

<?php
function makeMultipleTwo ($value){
$sType = gettype($value/2);
if($sType == "integer"){
return $value;
} else {
return ($value-1);
}
}

$FileName='clock.avi';
$flvName='clock.flv';

//$FileName='test.wmv';
//$flvName='test.flv';
$flvtool2 = "/usr/bin/flvtool2";
$ffmpeg = "/usr/local/bin/ffmpeg";
$FileName = escapeshellcmd($FileName);
$justName = explode(".",$FileName);
$wmvName = "videos/".$FileName;
$flvPath = "flvdodir/".$flvName;
$ffmpegObj = new ffmpeg_movie($wmvName);
$srcWidth = makeMultipleTwo($ffmpegObj->getFrameWidth());
$srcHeight = makeMultipleTwo($ffmpegObj->getFrameHeight());
$srcFPS = $ffmpegObj->getFrameRate();
$srcAB = intval($ffmpegObj->getAudioBitRate()/1000);
$srcAR = $ffmpegObj->getAudioSampleRate();
$frameSnap = $ffmpegObj->getFrame(3);
$snapWidth = $frameSnap->getWidth();
$snapHeight = $frameSnap->getHeight();
$imageSnap = $frameSnap->toGDImage();
$thumbname = $justName[0].".jpg"; // just get the first part of the name
$imagePath = "videos/".$thumbname;
imagejpeg($imageSnap, $imagePath, 100);
$cmd = $ffmpeg . " -i " . $wmvName . " -ar " . $srcAR . " -ab " . $srcAB . " -acodec mp3 -f flv -deinterlace -nr 500 -s 320x240 -aspect 4:3 -r ".$srcFPS." -b 270k -me_range ".$srcFPS." -i_qfactor 0.71 -g 500 " . $flvPath . " | " . $flvtool2 . " -U stdin " . $flvPath;
exec($cmd, $errArr);
unset($justName);
imagedestroy($imageSnap);
unset($frameSnap);
unset($ffmpegObj);
?>

The tumbnail image is creating normal, but the flv file is converting with 0 bytes:

Please Halp me...
Thank you!

Andan
12-20-2007, 05:04 PM
Real, could you submit your problem/issue to Cirtex Helpdesk? The techs there can help you better.

realecom
12-26-2007, 04:41 PM
Ooo thanks!!!!