I am trying to set the camera's resolution for the capture session using this:
[session setSessionPreset:AVCaptureSessionPresetLow]; // or any others resolutions
It doesn't seem to make any difference. It always uses the highest resolution the camera can offer. This is a UVC compliant USB camera and wasn't made by Apple.
Question: Can setSessionPreset apply to external USB non-Apple camera? Or my problem is something else?
Edit: I also tried this test:
if ([session canSetSessionPreset:AVCaptureSessionPresetLow])
{
NSLog(@"can presetlow"); // this part got called.
[session beginConfiguration];
session.sessionPreset = AVCaptureSessionPresetLow;
[session commitConfiguration];
}
else
{
NSLog(@"no, can't presetlow");
}
Bounty question: How to set the camera resolution in this case?
Make sure the USB or USB-C cable is properly connected to your camera and the computer. If your computer has another USB port, try plugging the cable into it. Check your camera to make sure it's turned on and set to the correct mode for importing photos.
Select the "Photo Booth" program. 3. Click on the Camera in menu bar and select the external USB Camera from the list once it has been detected and installed. The computer will switch from the default iSight/Built-in webcam to the external webcam.
USB provides a convenient way to hook up external cameras to your MacBook Pro. The 13-inch and 15-inch MacBook Pro models provide two USB ports; the 17-inch model includes three.
It may not be possible, depending on the camera. UVC compatible does not mean that all features are supported.
http://www.mac-compatible-web-cam.com/?ID=McRmr2
A work-around, depending on your application, might be to take the high-res image and convert it to lower res in your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With