开发者

Hard Question: How to access ffmpeg_php getFrame in Imagick without convert to GD?

I have thousands of movie clips need to be process in Imagick frame-by-frame. I'm currently obtain the frames using ffmpeg-php and process each frame by Imagick. The Imagick can not (at least I don't know how) access the frame directly so I have to convert the frames to GD and capture it into binary string. This is slow for thousands of clips with over million frames. How can I access / convert the frame from ffmpeg getFrame in Imagick? Or other quick / dirty ways for such conversion? Thanks in advance!

$movie = new ffmpeg_movie('any.avi', 0);

 $im = new Imagick();

 ob_start();

 imag开发者_如何学Cejpeg($movie->getFrame($i)->toGDImage());

 $im->readImageBlob(ob_get_contents());

 ob_end_clean();


// do Imagick process....

 echo $im_im;


Not that hard with Imagick delegates, see:

<?php

$im = new imagick();
$im->newPseudoImage( 200, 200, "ffmpeg:test1.mpg[40]" );
$im->setImageFormat( "png" );

header( "Content-Type: image/png" );
echo $im;

?>

And the full link

http://valokuva.org/?p=13

Hope it helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜