Camera differences between UIImagePickerController and AVCaptureSession on iPhone

[亡魂溺海] 提交于 2019-11-30 12:33:48

问题


I'm trying to build a replacement for UIImagePickerController, using AVCaptureSession with AVCaptureDeviceInput and AVCaptureStillImageOutput, as input/output respectively.

To preview the camera stream I'm using AVCaptureVideoPreviewLayer.

It's now working correctly for capturing and storing photos just like the default camera.

However, I found 3 problems I was unable to solve:

  • photos captured don't get the same quality the default camera provides
  • the viewing/capture angle is shortened, just like using the video capture on the default camera
  • no way to control camera specific options like flash

Is there any way to get to the level of UIImagePickerController using a more customizable approach (i.e. AVFoundation or any other)?


回答1:


Check out "Session 409 - Using the Camera with AV Foundation" in the WWDC 2010 videos. Based on the video, it looks like you can resolve all three of your issues with AVFoundation.

Hope this helps!



来源:https://stackoverflow.com/questions/4866927/camera-differences-between-uiimagepickercontroller-and-avcapturesession-on-iphon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!