Here is my code,
PHP Code:
<?php
function makeMultipleTwo ($value){
$sType = gettype($value/2);
if($sType == "integer"){
return $value;
} else {
return ($value-1);
}
}
$srcFile = "kabhi-alvida.avi";
$destFile = ".flvs/kabhi-alvida.flv";
$ffmpegPath = "/usr/local/bin/ffmpeg";
$flvtool2Path = "/usr/local/bin/flvtool2";
$ffmpegObj = new ffmpeg_movie($srcFile);
$srcWidth = makeMultipleTwo($ffmpegObj->getFrameWidth());
$srcHeight = makeMultipleTwo($ffmpegObj->getFrameHeight());
$srcFPS = $ffmpegObj->getFrameRate();
$srcAB = intval($ffmpegObj->getAudioBitRate()/1000);
$srcAR = $ffmpegObj->getAudioSampleRate();
$command = $ffmpegPath . " -i " . $srcFile . " -ar " . $srcAR . " -ab " . $srcAB . " -f flv -s " . $srcWidth . "x" . $srcHeight . " " . $destFile . " | " . $flvtool2Path . " -U stdin " . $destFile;
$convert = exec($command);
if(!$convert){
echo "FAILED!!!";
}
?>
What's wrog with this. everything going okey, but output flv file is 0kb. Plz help