问题
I'm developing an application similar to Instagram iOS app. Instagram have a custom camera preview. I want to develop something similar and the question is - what to use better for this purpose - UIImagePickerController with custom cameraOverlayView property or should I use AVCaptureSession ? Maybe someone have such experience and can give me an advice. Will be appreciate.
回答1:
AVCaptureSession is more customisable than UIImagePickerController. In case of speed, there is not much difference. If you are using AVCaptureSession it is possible to switch between whiteBalanceMode, focusMode and exposureMode when taking still images. Also we can specify the quality of the taking photo. In case of UIImagePickerController, the camera view will be presented and we can add overlay on it. But in case of AVCaptureSession, we can manage the camera as a normal view and add controls over it. So I think AVCaptureSession will be more suitable for your requirement.
The below link will give you more details about implementing AVCaptureSession. https://developer.apple.com/library/prerelease/ios/samplecode/AVCam/Introduction/Intro.html
来源:https://stackoverflow.com/questions/32348398/avcapturesession-vs-uiimagepickercontroller-camera-preview