Hi
I am trying to convert videos in some format into flv using ffmpeg. The converted video that is create is 0 kb. I need some help to get it working thanks.
This is the code:
<?Php
function makeMultipleTwo ($value){
$sType = gettype($value/2);
if($sType == "integer"){
return $value;
} else {
return ($value-1);
}
}
$srcFile = "Videos/robot.avi";
$destFile = "Videos/robot.flv";
$ffmpegPath = "ffmpeg";
$flvtool2Path = "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!!!";
}
?>
I must say I do not have flvtools on my server but I guess it does not matter as flvtools is only used for getting meta data.
Thanks.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
Closed Thread
Results 1 to 2 of 2
Thread
-
-
Tonybot, Do not post the same topic on several forums.
Please do not cross post, once is enough.
Continue in: https://forum.videohelp.com/threads/335647-php-ffmpeg-video-conversion
Moderator redwudz
Similar Threads
-
Windows , PHP, ffmpeg , flvtool2 to convert and stream video on website
By jeffshead in forum Video ConversionReplies: 26Last Post: 4th Jan 2012, 07:49 -
Ffmpeg N/A video conversion problem
By livestream in forum Video ConversionReplies: 3Last Post: 15th Sep 2011, 16:17 -
solved = struggling to get ffmpeg-php to compile
By richiedood in forum Video ConversionReplies: 30Last Post: 12th Jul 2011, 20:39 -
php-ffmpeg video conversion
By Tonybot in forum Video ConversionReplies: 6Last Post: 7th Jun 2011, 03:37 -
php error - viewforumlatest.php?topicdays=1&start=100
By offline in forum FeedbackReplies: 9Last Post: 29th May 2008, 22:52