function makethumbnail()
{
//this is the path of the video that you want to take snapshot
$video = $this->baseDir."/".$this->video_name;
// where you'll save the image
JFolder::Create($this->baseDir."/images");
// after how many second you want to take the snapshot
$second= $this->image_duration;
//this the duration of the video
$duration = $this->getDuration();
$no_of_image = intval($duration /$second);
for($i=1; $i<=$no_of_image; $i++)
{
$image = $this->baseDir."/images/".$i.'.jpg';
$cmd = "$this->ffmpeg -i $video -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg $image 2>&1";
$return = `$cmd`;
$second += $this->image_duration;
}
}
these lines of code will take the snapshot after a particular time