This message was deleted.
# helpdesk
s
This message was deleted.
m
cc @better-house-11852
pls thread @worried-planet-6857 praying Venkat said:
We need control over the video recording part on our end
w
Thanks @magnificent-art-43333! @better-house-11852 we've got an app - it's like a monitor for pets. And everything works from an
AVCaptureSession
. 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?
d
@worried-planet-6857 Do you have the frames in a buffer? If so, you should create a BufferCapturer and feed in your own buffers
🙌 1
w
CC @enough-oil-45964 who is doing more of the work on the Swift app. Thanks!
@dry-elephant-14928 we were seeing here: https://github.com/livekit/client-sdk-swift/blob/4bb2f469899c0e8cd626e9dbc1f298363[…]345f1/Sources/LiveKit/Track/Capturers/MacOSScreenCapturer.swift That for a MacOS client for screen capturing, there is usage of `AVCaptureSession`:
Copy code
private 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
    }()
And then later:
Copy code
public 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)
    }
I am a little bit lost with this code though! Ideally it would be great if there was a capturer implementation that let us either pass in our own
AVCaptureSession
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?