这是将flv文件转换为mp4的功能
public function convertVideoToMp4($tempFilePath, $finalFilePath)
{
$cmd = "$this->ffmpegPath -i $tempFilePath $finalFilePath 2>&1";
$outputLog = array();
exec($cmd, $outputLog, $returnCode);
if($returnCode != 0)
{
foreach($outputLog as $line)
{
echo $line . "<br>";
}
return false;
}
return true;
}
这些是函数调用时接收的参数值
$tempFilePath = "uploads/videos/5d0e525372a7bbarsandtone.flv";
$finalFilePath = "uploads/videos/5d0e525372aa3.mp4";
$this->ffmpegPath = "fmpeg/bin/ffmpeg";