Primeiramente vc deve instalar as Classes no PHP,
ffmpeg (http://ffmpeg.mplayerhq.hu/ffmpeg-export-snapshot.tar.bz2),
ffmpeg_php (http://sourceforge.net/project/showfiles.php?group_id=122353&package_id=133626)
despois dede processo de instalação, simplesmente instanciei o obj,
$movie = new FFmpeg_movie($srcFile, false);
peguei o frame do FLV que eu desejava,
$frame = $movie->getFrame(rand(1, ceil($movie->getFrameRate())));
gerei a imagem GD com,
$frame_thumb = $frame->toGDImage();
e criei o thumbcomo normalmente….
Codigo:
getFrame(rand(1, ceil($movie->getFrameRate())));
$frame_thumb = $frame->toGDImage();
$width = imagesx( $frame_thumb );
$height = imagesy( $frame_thumb );
$frame = "";
$movie = null;
$thumb = @imagecreatetruecolor( $thumbW, $thumbH );
@imagecopyresized($thumb, $frame_thumb, 0, 0, 0, 0, $thumbW, $thumbH, $width, $height);
@imagedestroy($frame_thumb);
return $thumb;
One Response
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
Continuing the Discussion