Unable to detect Capture Device (webcam) through JMF

会有一股神秘感。 提交于 2019-12-24 10:45:22

问题


I am using JMF to operate my web cam.My usb webcam works perfectly with JMF, I used it in JMStudio however,when I make this call from my java code

deviceListVector = CaptureDeviceManager.getDeviceList( null );

my USB "webcam" is detected however when i am trying to detect webcam on my laptop it is not detecting any device.

How can I properly detect the webcam of laptop, and its formats, from JMF API?


回答1:


  1. Make sure that the system you're using it on contains all the required files eg On Windows it requires certain dlls. The easiest way to do this is to use the setup program.
  2. Once JMF is properly installed run JMFRegistry?, detect the camera, then register and/or save the results. (In vista you'll need to run it as Administrator for it work)
  3. The code should now be returning the list of devices. Assuming the code has jmf.jar added to its project files.

You might be interested in alternatives: http://en.wikipedia.org/wiki/Java_Media_Framework#Alternatives The FMJ project is one that is designed to be API compatible(not everything is implemented yet) and does dynamic device detection.




回答2:


Be sure to include jmf.jar & sound.jar in your project classpath. Although I had it in my CLASSPATH, it didn't work until I included those files in my project libraries.



来源:https://stackoverflow.com/questions/2570944/unable-to-detect-capture-device-webcam-through-jmf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!