Here is what i have so far:
<?php
// Set our source file
$root_path = dirname(__FILE__).'/';
$srcFile = $root_path."video.wmv";
$destFile = $root_path."video.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);
exec("{$ffmpegPath} -i {$srcFile} -f flv -acodec mp3 -ab 64 -ac 1 {$destFile}");
echo "done";
// -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 video.flv
// Make multiples function
function makeMultipleTwo ($value)
{
$sType = gettype($value/2);
if($sType == "integer")
{
return $value;
}
else
{
return ($value-1);
}
}That doesn't work. No error but the flv file is not created. Any ideas?
Thanks.

Sign In
Register
Help








MultiQuote