Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAC OS X: Set external USB camera resolution with AVCaptureSession's sessionPreset doesn't work

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?

like image 854
user523234 Avatar asked Oct 03 '12 22:10

user523234


People also ask

Why won't my Mac recognize my USB camera?

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.

How do I set my external camera as default on Mac?

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.

Can I connect an external camera to my MacBook Pro?

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.


1 Answers

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.

like image 132
Daniel Saban Avatar answered Oct 17 '22 00:10

Daniel Saban