我正在尝试使用 Java 中的 FMJ 库调整相机设置,例如曝光和白平衡。我可以动态创建一个播放器:
new net.sf.fmj.media.cdp.civil.CaptureDevicePlugger().addCaptureDevices();
final java.util.Vector vectorDevices = CaptureDeviceManager.getDeviceList(null);
Player player = null;
CaptureDeviceInfo cdi = ((CaptureDeviceInfo) vectorDevices.get(2)); // For simplicity now
try {
player = Manager.createPlayer(cdi.getLocator());
player.start();
} catch (NoPlayerException | IOException e) {
e.printStackTrace();
}
那么我需要获取Control
sPlayer
来更改相机设置:
Control[] ctrls = player.getControls();
但是,这只是返回 a RateControl
,当我需要 aFrameGrabbingControl
抓取单个帧并且(我假设)FormatControl
更改相机设置(source)时。
如果这些不归还getControls()
,我就完蛋了吗?对于这些相机,我得到了相同的结果:Microsoft Lifecam Studio 和内置的 Lenovo EasyCam