我正在尝试使用以下方法设置捕获会话的相机分辨率:
[session setSessionPreset:AVCaptureSessionPresetLow]; // or any others resolutions
它似乎没有任何区别。它始终使用相机可以提供的最高分辨率。这是一款符合 UVC 标准的 USB 摄像头,并非由 Apple 制造。
问题:setSessionPreset 可以应用于外接 USB 非苹果相机吗?还是我的问题是别的?
编辑:我也试过这个测试:
if ([session canSetSessionPreset:AVCaptureSessionPresetLow])
{
NSLog(@"can presetlow"); // this part got called.
[session beginConfiguration];
session.sessionPreset = AVCaptureSessionPresetLow;
[session commitConfiguration];
}
else
{
NSLog(@"no, can't presetlow");
}
赏金问题:在这种情况下如何设置相机分辨率?