如何从网络摄像头拍摄单个快照? [英] How to take single snapshots from a webcam?

查看:224
本文介绍了如何从网络摄像头拍摄单个快照?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用java拍摄我的网络摄像头快照并将其保存到jpg文件中。这样做需要做什么步骤?非常感谢教程。

I want to take a snapshot with my webcam using java and save it to a jpg file. What are the steps needed to do so? A tutorial would be greatly appreciated.

问候,

Burkhard

Greetings,
Burkhard

推荐答案

JMF(Java Media Framework)是一个很好的起点。但是,我没有成功。

the JMF (Java Media Framework) is a good starting point. However, I did not succeed with it.

我终于找到了解决方案这里

I finally found the solution here.

重要的部分是:

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));
buffImg = new BufferedImage(img.getWidth(this), img.getHeight(this), BufferedImage.TYPE_INT_RGB);
//TODO saving the buffImg

这篇关于如何从网络摄像头拍摄单个快照?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆