[ACCEPTED]-AVCaptureSession specify resolution and quality of captured images obj-c iphone app-avcapture
Accepted answer
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
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];
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.