$page = 10;
$prefix = 'screencap';
$mov = new ffmpeg_movie('gt.avi');
$count = $mov->getFrameCount();
$range = (int)round($count/($page+1));
for($i=1; $i
$frameNum = $range*$i;
$imgFile = $prefix.'_'.$i.'.png';
$frame = $mov->getFrame($frameNum);
if(!$frame){ continue; }
$gdImage = $frame->toGDImage();
if(!$gdImage){ continue; }
imagepng($gdImage, $imgFile);
imagedestroy($gdImage);
echo '
';
}