MP4 Thumbnail to PHP

Posted by engineerisaac


Posted on 8 months ago

First install ffmpeg-php (http://ffmpeg-php.sourceforge.net/)

And then you can use of this simple code:

Script:

$frame = 10;
$movie = 'test.mp4';
$thumbnail = 'thumbnail.png';

$mov = new ffmpeg_movie($movie);
$frame = $mov->getFrame($frame);
if ($frame) {
$gd_image = $frame->toGDImage();
if ($gd_image) {
imagepng($gd_image, $thumbnail);
imagedestroy($gd_image);
echo '';
}
}


Leave a Comment:
Bill Murry - Posted 29 Minutes Ago.
This is a Test comment.