本文介绍了在Java中访问网络摄像头的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Java访问网络摄像头。

现在用户可以看到网络摄像头工作,因为他的脸在屏幕上可见
(已经听到一些libs没有显示网络摄像头的视频输出)



  1. JMF - 现在已经死了


  2. VLCJ - 太多,因为我没有创建音乐/视频播放器,并希望安装VLC。

  3. > Xuggler - 过多和辛苦的工作

  4. JMyron - 没有工作

  5. JavaFX - 我认为它可以做到, 't

我甚至满意,如果图书馆只是做上述提到的,因为这对我来说足够了。但我期望它也很简单。真的很棒,如果它不使用DLL,因为它不是平台独立如果它。真的很欣赏,如果它可以检测相机,没有手动传递相机名称和其他信息,如在VLCJ(因为可能有成千上万的相机品牌,所以我不能创建一千个元素的列表)。而且,我正在创建一个桌面应用程序,而不是网络应用程序。



如果你知道这样的图书馆,请好好让我知道。其他图书馆(可能不适合我的所有要求,但适合基本要求)也欢迎。请帮助

解决方案

这已经在SO多次讨论过了。以下是几个链接,可帮助您开始:



SO:



SO:



config:


I need to access web camera using Java. This is what I want to do

  1. Access web cam

  2. Now the user can see web cam working because his face is visible on screen(have heard some libs are there which doesn't show the video output of webcam)

  3. when user click save button, take a snapshot and save it

I have tried number of ways to do this, from a long time.

  1. JMF - Now it is dead
  2. FMJ - Now it is dead too
  3. VLCJ - too much because I am not creating a music/video player and it expect VLC to be installed
  4. Xuggler - too much and hard work
  5. JMyron - didn't work
  6. JavaFX - I thought it could do it, but seems like it can't

I am even satisfied if the library is just ONLY doing the above mentioned, because that's enough for me. But I expect it to be simple too. Really great if it is not using DLLs, because it is not platform independent if it does. Really appreciate if it can DETECT the camera, without manually passing the camera name and other info as have do in VLCJ (because there might be thousands of camera brands, so I can't create a list of thousand elements in it). And, I am creating a desktop application, not web app.

If you know a library like this, please be kind enough to let me know. Other libraries (which might not suit to all of my requirements, but suits to the basic requirement) also welcome. Please help

解决方案

This has been discussed on SO multiple times. Here are a few links to get you started:

SO: Capturing image from webcam in java?

SO: What is the best method to capture images from a live video device for use by a Java-based application?

openCVF applet: http://www.colorfulwolf.com/blog/2011/07/05/accessing-the-webcam-from-inside-a-java-applet/

config: http://ganeshtiwaridotcomdotnp.blogspot.in/2011/12/opencv-javacv-eclipse-project.html

这篇关于在Java中访问网络摄像头的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-04 22:39