【问题标题】:AVFoundation capture a still Image too slowlyAVFoundation 捕捉静止图像太慢
【发布时间】:2016-10-19 03:26:44
【问题描述】:

我使用AVFoundation 拍摄静止图像,大约需要 0.8 秒。我觉得真的很慢。但是当我使用系统的penter code hererimary camera时,速度要快得多。

这是我使用的功能:真的很慢,也许有什么我不知道的,谁能帮帮我?

- (void)captureStillImageAsynchronouslyFromConnection:(AVCaptureConnection *)connection completionHandler:(void (^)(CMSampleBufferRef imageDataSampleBuffer, NSError *error))handler;

【问题讨论】:

    标签: ios objective-c avfoundation


    【解决方案1】:

    这似乎是您的 AVCaptureSession 分辨率的问题。如果您将 sessionPreset 设置为 AVCaptureSessionPresetPhoto,那么这是来自相机的最高分辨率照片,解析速度可能很慢。

    尝试将您的 sessionPreset 设置为 AVCaptureSessionPresetHigh。在某些设备上,分辨率差异(照片中的像素数量)接近 50%!设备照片分辨率详细表见:https://stackoverflow.com/a/31964333/4769084

    【讨论】:

      猜你喜欢
      • 2012-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多