开发者

extracting image from a video in java

i want to know how can i extract images from a video using JMF开发者_Python百科.


Player player = Manager.createRealizedPlayer(cdi.getLocator());
player.start();
FrameGrabbingControl frameGrabber = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl");


//////////////////////////////

private Image grab() {
Buffer buf = frameGrabber.grabFrame();
// Convert frame to an buffered image so it can be processed and saved
Image img = (new BufferToImage((VideoFormat) buf.getFormat()).createImage(buf));
    return img;
}

for more info see complete example: http://www.comp.rgu.ac.uk/staff/fh/CM4062/mis/jmf/FrameGrab.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜