MP4 Thumbnail to PHP

Posted by engineerisaac


Posted on 1 year 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 '';

}

}




Guests Cannot Post!

If you would like to Comment on this video! Consider joining the Blue community!

Register Login


Other Engineerisaac Articles