我正在使用webcam capture通过以下代码在Java中获取网络摄像头图像:
Webcam webcam = Webcam.getWebcamByName("VF0415 Live! Cam Vid. IM Ultra 1"); // USB webcam
webcam.open();
BufferedImage image = webcam.getImage();
ImageIO.write(image, "JPG", new File("test.jpg"));
不幸的是,我超时并出现以下错误:
[main] INFO com.github.sarxos.webcam.Webcam - WebcamDefaultDriver capture driver will be used
[atomic-processor-1] INFO com.github.sarxos.webcam.ds.cgt.WebcamOpenTask - Opening webcam VF0415 Live! Cam Vid. IM Ultra 1
[frames-refresher-[1]] ERROR com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Timeout when requesting image!
[shutdown-hook-1] INFO com.github.sarxos.webcam.WebcamShutdownHook - Automatic VF0415 Live! Cam Vid. IM Ultra 1 deallocation
[shutdown-hook-1] INFO com.github.sarxos.webcam.Webcam - Disposing webcam VF0415 Live! Cam Vid. IM Ultra 1
[frames-refresher-[1]] ERROR com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Timeout when requesting image!
我已经查看了GitHub上的相关问题,并尝试了keeping my USB power on和intercepting the OS signals,但是错误消息保持不变,这给了我实质上是黑色的图像,如下所示:< / p>
还有什么我可以尝试解决的吗?