Welcome to WebmasterWorld Guest from 54.163.52.98

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

ffmpeg producing 0kb files

     

alexelisenko

6:59 pm on Jul 12, 2009 (gmt 0)

5+ Year Member



I am converting all my uploaded files to flv, but for some reason, i get 0kb .flv files.

here is my code:

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

//coded filname
$flvcode = md5($filename);
$flvname = $flvcode.".flv";

// Set our source file
$srcFile = "/home/user/public_html/upload/".$newfilename;
$destFile = "/home/user/public_html/media_files/".$flvcode.".flv";
$ffmpegPath = "/usr/local/bin/ffmpeg";
$flvtool2Path = "/usr/bin/flvtool2";

// Create our FFMPEG-PHP class
$ffmpegObj = new ffmpeg_movie($srcFile);

// Save our needed variables
$srcWidth = makeMultipleTwo($ffmpegObj->getFrameWidth());
$srcHeight = makeMultipleTwo($ffmpegObj->getFrameHeight());
$srcFPS = $ffmpegObj->getFrameRate();
$srcAB = intval($ffmpegObj->getAudioBitRate()/1000);
$srcAR = $ffmpegObj->getAudioSampleRate();

// Call our convert using exec()
exec($ffmpegPath . " -i " . $srcFile . " -ar " . $srcAR . " -ab " . $srcAB . " -f flv -s " . $srcWidth . "x" . $srcHeight . " " . $destFile . " " . $flvtool2Path . " -U stdin " . $destFile);

Not sure what to do next?

Gibisan

5:52 am on Jul 13, 2009 (gmt 0)

10+ Year Member



It could be any number of things. First, run the exec command yourself from the console, you'll be able to see any error messages that ffmpeg produces during conversion.

alexelisenko

2:47 pm on Jul 13, 2009 (gmt 0)

5+ Year Member



I dont get any errors at all, just 0kb output files...
 

Featured Threads

Hot Threads This Week

Hot Threads This Month