iPhone 4 AVFoundation : Capture from front and rear cameras simultaneously

别说谁变了你拦得住时间么 提交于 2019-12-03 20:05:23

问题


I was wondering if it was possible to capture from both cameras simultaneously using AVFoundation framework. Specifically, my question is whether both front and rear AVCaptureDevices can be active at the same time or not.

Currently I know that an AVCaptureSession instance can support only one input (and output). I create two AVCaptureSessions, attach front camera device to one and rear to other, I then point the outputs of the sessions to different SampleBufferDelegate functions. What I see is that one delegate function is active for a few frames, then the other takes over. It seems as if AVFoundation somehow turns off a camera device if another one is being used. Can anyone confirm this or share their experiences regarding this subject?

Thanks in advance


回答1:


Answering my own question:

  1. This is not possible.
  2. Switching between front and rear camera to emulate similar behavior is too slow (Takes about 500ms per switch according to my tests)

Source: https://devforums.apple.com/message/369748#369748



来源:https://stackoverflow.com/questions/4807619/iphone-4-avfoundation-capture-from-front-and-rear-cameras-simultaneously

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