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:






$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 '';

}

}





Comments are For the Community.

If you would like to Comment, Consider joining the Community!

We believe in accountability. Your comments are connected to your profile.

Register Login


Other Engineerisaac Articles