iPhone 上 UIImagePickerController 和 AVCaptureSession 的相机差异 [英] Camera differences between UIImagePickerController and AVCaptureSession on iPhone

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

问题描述

我正在尝试构建 UIImagePickerController 的替代品,使用 AVCaptureSessionAVCaptureDeviceInputAVCaptureStillImageOutput,分别作为输入/输出.

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

要预览我正在使用的相机流 AVCaptureVideoPreviewLayer.

To preview the camera stream I'm using AVCaptureVideoPreviewLayer.

它现在可以像默认相机一样正常拍摄和存储照片.

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

但是,我发现了 3 个我无法解决的问题:

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

  • 拍摄的照片质量与默认相机提供的不同
  • 观看/拍摄角度缩短,就像在默认相机上使用视频拍摄一样
  • 无法控制闪光灯等相机特定选项

有没有办法使用更可定制的方法(即 AVFoundation 或任何其他方法)达到 UIImagePickerController 的级别?p>

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

推荐答案

查看 WWDC 2010 视频.根据视频,看起来您可以使用 AVFoundation 解决所有三个问题.

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.

希望这会有所帮助!

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

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