我试图从视频中获取缩略图,我确实在非Yii项目的侧面项目上测试了这段代码,这里的工作正常是我的操作代码。
$ffmpeg = "C:\\ffmpeg\\bin\\ffmpeg";
$videoFile = $_FILES['Project']['tmp_name']['file'];
$imageFile = Yii::app()->basePath ."/../1.jpg";
$size = "200x200";
$getFromSecond = 5;
$cmd = "$ffmpeg -i $videoFile -an -ss $getFromSecond -s $size $imageFile";
shell_exec($cmd);
此操作通过使用dropzone Yii扩展名调用ajax。
$imageFile = "E:\xampp\htdocs\tme\protected\..\1.jpg"