Welcome to WebmasterWorld Guest from 54.198.134.32

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

ffmpeg producing 0kb files

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

New User

5+ Year Member

joined:July 4, 2009
posts:21
votes: 0


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?

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

Junior Member

10+ Year Member

joined:Oct 6, 2004
posts:54
votes: 0


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.
2:47 pm on July 13, 2009 (gmt 0)

New User

5+ Year Member

joined:July 4, 2009
posts:21
votes: 0


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members