在Xuggler中保存时图像损坏 [英] Broken images when saving in Xuggler

查看:123
本文介绍了在Xuggler中保存时图像损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了从网络摄像头捕获视频,我使用了 DisplayWebcamVideo.java

To capture video from a web-camera, I used the example code from the DisplayWebcamVideo.java

修改后的决议:

It was amended resolution:

params.setValue ("video_size", "640x480");

要保存添加到该行的图像:

To save images added to the line:

private static void updateJavaWindow (BufferedImage javaImage)
   {
     mScreen.setImage (javaImage);
     ImageIO.write (javaImage, "jpg", new File (fileOut));
   }

所有遗体,但保持图像的周期性部分为灰色。
此外,如果我理解正确,在保存下一帧之前 - 从HDD中删除上一张图像,然后创建一个新图像。因此,有时带有网络摄像头的图像并没有存储在sozhranenie应该发生的文件夹中 - 而不是所需的文件。

All the remains, but while maintaining the periodic part of the image is painted gray. Besides, if I understood correctly, before saving the next frame - the previous image is deleted from the HDD, then create a new one. As a result, sometimes the image with a web-camera and are not stored in the folder where sozhranenie should happen - not the desired file.

你能告诉我怎么样从WEB摄像头正确保存图像?

Can you please tell how to properly save images from the WEB-cameras?

推荐答案

我正在使用Xuggler进行格式之间的代码转换,这是一个这些功能使我能够彻底搜索它遇到的各种问题。第一个问题是您尝试过的问题,更改分辨率,例如320X240,但无论何时更改为更高,都会导致某些或其他错误,这可能是由于

I am using Xuggler for my project for transcoding between formats and this was one of the features that lead me to search thoroughly for various problems that it encounters. First problem is the one that you have tried, changing the resolution which in example is 320X240 but whenever it is changed to higher it leads to some or the other error which might be due to the fact that


Xuggle网络摄像头支持很糟糕 - 正如开发人员说的那样

Xuggle webcam support is lousy--As said by developer

检查Xuggler的 Google网上论坛了解详情。我建议你在320X240中使用它,大部分时间都可以使用它,或者使用LTI-CIVIL(我也在使用),如果你想以比Xuggler提供的更多方式与网络摄像头连接。

Check at Xuggler's Google groups for more details. I would suggest you to either use it in 320X240 which works most of the time or use LTI-CIVIL (which I am also using) if you want to interface with webcam in more ways than Xuggler can provide.

这篇关于在Xuggler中保存时图像损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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