PHP Code:
$file=htmlspecialchars(@$_GET['file']);
/*
* Withdrawal of a screenshot from the video 3gp
* 12.02.2011
*
*/
if (!class_exists(ffmpeg_movie))
{
die('This script wont work, you need to ffmpeg hosting !! Try ');
}
//creating an object (a test file test.3gp)
if (file_exists($file))
{
$mov = new ffmpeg_movie($file);
}
else
{
die('Error !! Can not find file !!');
}
//frame number
$frame = 10;
//width
$w = $mov->GetFrameWidth();
//height
$h = $mov->GetFrameHeight();
//extract frame
$ff_frame = $mov->getFrame($frame);
if ($ff_frame)
{
//format GD
$gd_image = $ff_frame->toGDImage();
if ($gd_image)
{
//output (for example, in the gif)
header('Content-type: image/gif');
imagegif($gd_image);
/*You can make a change in size, causing copyrights and watermarks, in general all that apply for GD*/
}
else
{
die('cannot be converted to GD');
}
}
else
{
die('can not extract frame');
}
/*
descriptions of all methods ffmpeg_movie look here
http://ffmpeg-php.sourceforge.net/doc/api/ffmpeg_movie.php
*/
i am getting this error msg in ffmpeg script for video preview i got this error msg, "Fatal error: Call to undefined method ffmpeg_frame::toGDImage() "
ffmpeg php- gd alredy installed, plz help
Comment