Supported on iPhone
XS, XS Max, XR, iPad Pro 3rd GenAVCaptureMultiCamSession
Multiple
AVCaptureDeiceInputs,AVCaptureDeiceOutputsof the same type,AVCaptureVideoPreviewLayersDon’t use implicit connection forming but use
addInputWithNoConnections,addOutputWithNoConnectionsorAVCaptureVideoPreviewLayer.setSessionWithNoConnection
AVCaptureSession is still the way to got for single cam session
Simultaneous photo shooting, movie recording, barcode scanning, etc.
Limitiations
only one input per camera in a session
connecting one camera to multiple video data outouts is not possible
no presets supported on session since different cams might run with different qualities
multi-cam session has
hardwareCostreporting. Session runnable when0 <= cost <= 1lower cost by
lower resolution,choose binned format,deviceInput.videoMinFrameDurationOverride = CMTimeMake(1, 30) to set max framerate override /* 30 FPS */lower system pressure like
temperature, power demands, infrared projector temperaturebylowering frame rates, throttle GPU/CPU processing code, disable one camera
run indefinitely with
multiSession.systemPressureCost < 1.0; device shutdown withcost > 3.0iOS can run only one session at a time (with mutli cams though)
Virtual Camera is the new name wor software cameras like
True-Tone- or Dual-Cameradevice.isVirtualDevice- get its physical devices bydevice.constituentDevicesfor e.g. synchronized camera streamingAVCaptureDataOutputSynchronizerensures you get two outputs in one callbackvirtual devices have secret ports so you can get 2 streams - you need to explicitly query them
Dual Camera Hography Aids
CameraIntrinsics(Optical center / focal length) andCameraExtrinsics(rotation matrix / translation vector for both wide- and tele cameras)
Multi-Microphone capture
By default front cam uses
front micand back cam usesback micactually
front micandback micare a lie since different devices have multiple mics but not explicitly fron/back ones. This is achieved byMicrophone Beam Forming- done automatically by CoreAudiomicInput.ports(for: .audio, sourceDeviceType: micDevice.deviceType, sourceDevicePosition: .front).firstBeam forming only works with built-in mics
audio can be arbitrarily configured by creating custom
AVAudioSession
Introducing Multi-Camera Capture for iOS
In AVCapture on iOS 13 it is now possible to simultaneously capture photos and video from multiple cameras on iPhone XS, iPhone XS Max, iPhone XR, and the latest iPad Pro. It is also possible to configure the multiple microphones on the device to shape the sound that is captured. Learn how to leverage these powerful capabilities to bring creative new features like picture-in-picture and spatial audio to your camera apps. Gain a deeper understanding of the performance considerations that may influence your app design.
Missing anything? Corrections? Contributions are welcome!
Written By

Blackjacx