iOS - How to caputre image : resolution 3840x2160, using GPUImageStillCamera?

643 Views Asked by At

I need to capture highest resolution image using GPUImageStillCamera, I have tried these properties like : AVCaptureSessionPresetPhoto, AVCaptureSessionPreset1920x1080. It gives me little bit fine result. Please note that when I capture image using property AVCaptureSessionPresetPhoto instead of AVCaptureSessionPresetHigh, then it (AVCaptureSessionPresetPhoto) gives better result than AVCaptureSessionPresetHigh. But when I use properties AVCaptureSessionPreset3840x2160 means :

videoCamera = [[GPUImageStillCamera alloc] initWithSessionPreset:AVCaptureSessionPreset3840x2160 cameraPosition:AVCaptureDevicePositionBack]; .

My app crashes (even in latest iPhone version) and shows this message (I am using iPhone 5 S, version:9.3.1, Xcode version: 7.3)

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'AVCaptureSessionPreset3840x2160 is not a supported preset.

Is there a way to check whether is concrete AVCaptureSessionPreset supported on iOS device? I want to set a resolution of AVCaptureSession, but I do not know how to check whether the device is capable to capture camera frames using selected resolution. In short I need highest quality, largest size image for all different iPhone Devices. Any suggestion will be great. Thanks guys.

1

There are 1 best solutions below

0
Ketan Parmar On

You can use AVCaptureSession's sessionPreset property something like below,

  cameraSession.sessionPreset = AVCaptureSessionPresetHigh;

You should try AVCaptureSessionPresetHigh in your code also.

Hope this will help :)