I want to capture images with 5 MP resolution in an iOS device where maximum image sensor capture resolution is 8 MP.
The presets provided in Avfoundations AVCaptureSessionPresetPhoto gives - 3264x2448 - 8 MP resolution VCaptureSessionPresetHigh gives - 1920x1080 - 2 MP resolution
Is there any way/workaround for capturing 5MP directly, instead of capturing 8MP and then downscaling?
iOS gives very limited output resolutions from Camera.
You mentioned correctly that largest size is 8MP and next preset goes down to 1080p or ~2MP. The expectation it seems is to downscale/crop the image as the application requires, however the SDK doesn't give a single API to get required resolution or output image.
Hope this helps.
AVCaptureSessionPreset gives only constants resolutions (You can see API references). If you want to save image in custom resolution, you can find here Save image with custom resolution
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