homepage Welcome to WebmasterWorld Guest from 54.198.139.141
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
ffmpeg producing 0kb files
alexelisenko




msg:3951089
 6:59 pm on Jul 12, 2009 (gmt 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?

 

Gibisan




msg:3951307
 5:52 am on Jul 13, 2009 (gmt 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.

alexelisenko




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved