[ACCEPTED]-AVCaptureSession specify resolution and quality of captured images obj-c iphone app-avcapture

Accepted answer
Score: 14

Refer to Apple's guide Capturing Still Images section 3 regarding which sizes you'll get if you 2 set one or another preset.

The parameter 1 you should change is captureSession.sessionPreset

Score: 0

Try to go with something like this where 1 cx and cy are your custom resolutions:

NSDictionary *videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:
                              AVVideoScalingModeResizeAspectFill,AVVideoScalingModeKey,
                           AVVideoCodecH264, AVVideoCodecKey,
                           [NSNumber numberWithInt:cx], AVVideoWidthKey,
                           [NSNumber numberWithInt:cx], AVVideoHeightKey,
                           nil];
_videoInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:videoSettings];

More Related questions