AVCaptureSession VS UIImagePickerController相机预览 [英] AVCaptureSession VS UIImagePickerController camera preview

查看:124
本文介绍了AVCaptureSession VS UIImagePickerController相机预览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发与Instagram iOS应用类似的应用. Instagram具有自定义的相机预览.我想开发类似的东西,问题是-为此目的最好使用什么-具有自定义cameraOverlayView属性的UIImagePickerController还是应该使用AVCaptureSession?也许有人有这样的经验,可以给我建议.将不胜感激.

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.

推荐答案

AVCaptureSession比UIImagePickerController更可自定义.在速度方面,没有太大的区别.如果您使用的是AVCaptureSession,则在拍摄静止图像时可以在whiteBalanceMode,focusMode和ExposureMode之间切换.我们也可以指定拍照质量.在使用UIImagePickerController的情况下,将显示摄影机视图,我们可以在其上添加叠加层.但是在使用AVCaptureSession的情况下,我们可以将摄像机作为普通视图进行管理并对其添加控件.因此,我认为AVCaptureSession将更适合您的需求.

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.

下面的链接将为您提供有关实现AVCaptureSession的更多详细信息. https://developer.apple.com/library/prerelease/ios/samplecode/AVCam/Introduction/Intro.html

The below link will give you more details about implementing AVCaptureSession. https://developer.apple.com/library/prerelease/ios/samplecode/AVCam/Introduction/Intro.html

这篇关于AVCaptureSession VS UIImagePickerController相机预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆