first time I am trying to create thumbnail preview from video file, uploaded 700mb .avi film with 209747 frames. Now I am trying to create 1 thumbnail, but it takes 4.7 seconds, because I've set frame 10000, if I set it just to 1000, it takes only 0.4 seconds to generate thumbnail.
How could I generate like 5-10 thumbnails from different frames on-the-go in less than a second? Is it even possible? Is it different to use exec(ffmpeg) or php-ffmpeg? Using 0.6-svn ffmpeg, Debian 6.0.7, php 5.4.14 on machine 2x Xeon L5420 and still slow... Any ideas? How about to use ffmpeg + time of the video instead of frame?
$movie = 'ai.avi';
$thumbnail = 'thumbnail.jpg';
$mov = new ffmpeg_movie($movie);
$frame = 10000;
$frame = $mov->getFrame($frame);
if($frame) {
$gd_image = $frame->toGDImage();
if($gd_image) {
imagejpeg($gd_image, $thumbnail, 100);
imagedestroy($gd_image);
}
}
echo '<img src="'.$thumbnail.'" ><br />';