This is my php code to generate thumbnail of a video frame.
extension_loaded('ffmpeg') or die('Error in loading ffmpeg');
$vid = realpath('./Wildlife.wmv');
header("Content-type: image/jpeg");
$moviefile = $vid;
$mov = new ffmpeg_movie($moviefile,false);
$img = $mov->getFrame(10);
$showImg = $img->toGDImage();
$mkNewImg = new ffmpeg_frame($showImg);
$maxWid = 150;
$oldWid = $mkNewImg->getWidth();
if($oldWid > $maxWid) {
$newWid = $maxWid;
}
$newHgt = $newWid / $movRatio;
$mkNewImg->resize($newWid,$newHgt);
$newImg = $mkNewImg->toGDImage();
imagejpeg($newImg,$mkThumbFile,40);
imagedestroy($newImg);
When i execute this script i got error like
Fatal error: Unable to locate ffmpeg_frame resource in this object. in C:\xampp\htdocs\ffmpeg\ffmpeg.php on line 14