简体   繁体   English

Java JMF如何控制我的Mac相机?

[英]How can Java JMF control my Mac camera?

I try to use JMF to capture image using my Mac's camera. 我尝试使用JMF使用Mac的相机捕获图像。 But the result of following code shows I have no available device. 但是以下代码的结果显示我没有可用的设备。

Vector v = CaptureDeviceManager.getDeviceList(null);
System.out.println("size = " + v.size());

Is it the case that Mac does not allow JMF to control its camera? Mac是否不允许JMF控制其相机? How can I solve it? 我该如何解决?

AFAIR JMF could only handle camera resolutions up to 640 x 480 px. AFAIR JMF只能处理高达640 x 480像素的相机分辨率。 As such, I would not be surprised if it does not detect/support modern cameras, which went past that resolution a long time ago. 因此,如果它不检测/支持很久以前就超过该分辨率的现代相机,我不会感到惊讶。

The solution might be to not use an API that was abandoned by Sun over a decade ago. 解决方案可能是使用Sun十年前放弃的API。 It was a great API in its time, but times change, and it ..didn't. 在那个时代,它是一个很棒的API,但是时代在变化,..没有。

  • Java-FX ? Java-FX I added a ? 我加了一个? to that since I have not used it, and am not sure if the Media source of the MediaPlayer can be a video camera. 因为我还没有使用它,所以不确定MediaPlayerMedia来源是否可以是摄像机。
  • VLCJ . VLCJ Is a more general purpose media handling API, though again I've never used it personally. 是更通用的媒体处理API,尽管我再也没有亲自使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM