I have grasped the understanding of how grabbing frames from a movie works, but does anyone understand exactly how to slice a movie into segments? Here is how i'm cutting the clip into 5 thumbnails
<?php
$mov = new ffmpeg_movie('test.mpg');
$frame_count = $mov->getFrameCount();
$movie_name = $mov->getFilename();
echo 'Movie Title : '.$movie_name .'<br>';
flush();
$frame_cut = intval($frame_count/5);
for ($i = 20; $i < $frame_count; $i+=$frame_cut) {
$num++;
$ff_frame = $mov->getFrame($i);
if ($ff_frame) {
$gd_image = $ff_frame->toGDImage();
if ($gd_image) {
imagejpeg($gd_image, 'tmp/'.$movie_name.'_'.$num.'.jpg',100);
imagedestroy($gd_image);
$current = $mov->getFrameNumber();
echo 'Frame #: '.$current .'<br>';
flush();
}
}
}
?>
How do I use a similar structure to cut a movie into segments? If you have any ideas or even sites that could put me in the right direction I would appreciate it.