2012-11-02 3 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을 만들고 싶습니다. phpinfo에서 보여 주듯이 정확하게 fmpmpeg를 xamp 으로 설정했습니다. 내 코드가 올바르게 실행되고 있으며 오류가 표시되지 않습니다. 그러나 비디오 썸 네일은 생성하지 않습니다. 소스 코드를 제공해주십시오. 만약에 가능하다면 . 매우 긴급한가xamp php에서 ffmpeg에서 비디오 미리보기 이미지를 만드는 방법

변경

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

$video = '"C:\Users\Public\Videos\Sample Videos\upload.mp4"'; 
에 인용해야하므로 동영상에 대한 귀하의 경로에 공백이 포함

답변

1

관련 문제