我怎么知道 ffmpeg 命令发生错误?以及如何在我的 php 中得到错误?
下面是我的代码
<?php
$cmd = "$ffmpeg -i $vid -an -ss $getfromsecond -s $size -vframes 1 $imageFile";
if(!shell_exec($cmd)){
echo "Thumbnail created" . "<br/>";
}else{
echo "Error Creating thumbnail". "<br/>";
}
?>
我不确定上述方法是否正确。我也尝试过下面的代码
exec($cmd, $output, $return);
echo '$output :' ; print_r($output); echo "<br/>";echo '$return :' . $return . "<br/>";exit;
但在服务器中它只是显示为
$output :Array ( )
$return127
我不明白那个错误是什么 不,如何知道是否发生错误并返回
ffmpeg
错误号和ffmpeg
错误文本,在 php.ini 中。
最佳答案
用它
exec($cmd,$test);
然后检查
if(file_exists($image))
{
echo 'suc';
}
关于php - 获取FFMPEG返回的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27293337/