steep-balloon-41261
08/02/2023, 3:22 PMmagnificent-art-43333
08/02/2023, 3:36 PMmagnificent-art-43333
08/02/2023, 3:37 PMWe need control over the video recording part on our end
worried-planet-6857
08/02/2023, 3:51 PMAVCaptureSession. We've got ML models, ARKit, and other things built from that.
So ideally, we can to publish the output of that session to the track of the local participant. Is this currently supported?dry-elephant-14928
08/03/2023, 2:42 AMworried-planet-6857
08/03/2023, 12:39 PMworried-planet-6857
08/03/2023, 12:42 PMprivate lazy var session: AVCaptureSession = {
assert(.legacy == captureMethod, "Should be only executed for legacy mode")
let session = AVCaptureSession()
let output = AVCaptureVideoDataOutput()
output.videoSettings = [
kCVPixelBufferPixelFormatTypeKey as String: kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
]
session.addOutput(output)
output.setSampleBufferDelegate(self, queue: captureQueue)
return session
}()worried-planet-6857
08/03/2023, 12:44 PMpublic func captureOutput(_ output: AVCaptureOutput,
didOutput sampleBuffer: CMSampleBuffer,
from connection: AVCaptureConnection) {
assert(.legacy == captureMethod, "Should be only executed for legacy mode")
guard case .started = captureState else {
log("Skipping capture since captureState is not .started")
return
}
capture(sampleBuffer)
}worried-planet-6857
08/03/2023, 12:47 PMAVCaptureSession
If one doesn't exist, I suppose we could use a AVCaptureVideoDataOutput and call setSampleBufferDelegate to get a hold of the buffer? Is that accurate?