ios - 拍照前访问设备相机曝光值

标签 ios

我正在使用精彩的GPUImage framework来自 Brad Larson 和我在某个时刻有一个 AVCaptureDevice 实例(来自 GPUImageVideoCamera 类的属性 inputCamera),我想在拍照之前读取实际曝光值,就像在创建但仅在图片之后的元数据信息中一样被采取。有没有办法让这个值活起来?

最佳答案

设置一个 AVCaptureSession,然后你可以从以下位置实时获取曝光数据:

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer  fromConnection:(AVCaptureConnection *)connection{

   lightSamp++;
   if(lightSamp>30){
      CFDictionaryRef metadataDictionary = CMGetAttachment(sampleBuffer, kCGImagePropertyExifDictionary, NULL);
      NSDictionary *metaDict= (__bridge NSDictionary*)metadataDictionary;

      NSLog(@"exposure %@",metaDict );
      lightSamp=0;
    }
}

}

关于ios - 拍照前访问设备相机曝光值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15743046/

相关文章:

ios - 如何管理 iOS 中可移动 View 的约束?

ios - iPad SplitViewController - 使用 iPhone Storyboard ViewController

ios - 当手机处于锁定状态时,我可以通过一些手势启动应用程序吗?

ios - swift :- Thread 1: Fatal error: Remainder of or division by zero

ios - 如何在应用内添加 3D touch 快速操作?喜欢联系人

ios 8 UITextView UIDataDetectorTypeLink 不起作用

ios - 在 TableView 单元格中使用步进器 - 但返回到 VC 的数据未正确更新

iphone - 横向隐藏 UITabBar

ios - 如何防止修改字典副本

ios - 跟踪触摸事件而不覆盖 UIWindow 和 UIApplication 中的发送事件方法