WYS
WYS

Reputation: 1647

AVCaptureSessionPreset Photo and High Optimization

I have been trying all kinds of settings for the AVCaptureSessionPreset to match my desired output, but I don't seem to be able to get it right.

The Photo preset captures a photo where the resolution is too high, so it takes some time before the image is finished processing.

The High preset is perfect in the sense of performance. The image gets processed and returned almost instantaneously. But the aspect ratio is not right, it is 16:9 compared to the Photo preset which is 4:3.

I have also tried changing the AVCaptureDevice's activeFormat to a lower resolution. But the performance is just not as good as when using the High preset.

Someone with a similar problem from 2014: AVCaptureSession preset creates a photo that is too big

Upvotes: 2

Views: 872

Answers (1)

matt
matt

Reputation: 534958

The problem seems to be that you are attempting to perform some kind of time-consuming processing on the large photo data returned from the capture. Don't. It's large! Instead, when you configure the session, ask for a preview image at the desired size, and when the capture takes place, obtain the preview image and operate on that.

Upvotes: 2

Related Questions