Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Taking high resolution photo from captureStillImageAsynchronouslyFromConnection

Currently captureStillImageAsynchronouslyFromConnection returns an image at 640x480 pixels from a AVCaptureSession of AVCaptureSessionPreset640x480.

The reason for a relative low-res AVCaptureSessionPreset640x480 is I need to process the video frames. Lower resolution gives better speed.

At certain point, when I want to take a photo, I want a hi-res image. How can I tell captureStillImageAsynchronouslyFromConnection to return a higher than 640x480 image?

like image 239
ohho Avatar asked Dec 10 '25 20:12

ohho


1 Answers

You tell captureStillImageAsynchronouslyFromConnection to return a higher-resolution image by setting a higher-resolution preset.

Since 4.2, AVCaptureVideoDataOutput will return approximately screen-sized video frames for AVCaptureSessionPresetPhoto, which it sounds like would be ideal for your purposes. OTOH, in 4.1 and earlier it will return nothing. If you have to target 4.1 and earlier, you'll have to take the very slow way of changing the preset before capturing.

like image 133
Anomie Avatar answered Dec 12 '25 09:12

Anomie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!