2012-11-02 136 views
2
<?php 
$ffmpeg = 'C:\ffmpeg\ffmpeg.exe'; 

//video dir 
$video = 'C:\Users\Public\Videos\Sample Videos\upload.mp4'; 
echo $video ; 
//where to save the image 
$image = 'C:\ffmpeg\image\image.jpg'; 

//time to take screenshot at 
$interval = 5; 

//screenshot size pn 
$size = '640x480'; 

//ffmpeg command 
//$cmd = "$ffmpeg -i ".$video "-deinterlace -an -ss".$interval". -f mjpeg -t 1 -r 1 -y -s". $size." ". $image." 2>&1"; 
$cmd="$ffmpeg -i ".$video." -ss 00:00:14.435 -f image2 -vframes 1 ".$image; 
echo $cmd 
//$cmd = "$ffmpeg -i $video -f mjpeg -vframes 1 -s 150x150 -an myimage.jpg"; 
exec($cmd); 
//$return = '$cmd'; 
//print_r($outputData); 
?> 

我想从视频文件创建thunbnail。我已经正确配置ffmpeg到xamp ,因为它在phpinfo中显示。我的代码运行正常,没有错误显示。 但视频拇指钉是没有生成的地方。 请为我提供源代码。如果可能 。它非常紧迫如何在xamp中创建ffmpeg的视频缩略图php

回答

1

您对视频路径中包含空格,所以必须用引号引起来

变化

$video = 'C:\Users\Public\Videos\Sample Videos\upload.mp4'; 

$video = '"C:\Users\Public\Videos\Sample Videos\upload.mp4"'; 
相关问题