Post

Replies

Boosts

Views

Activity

Reply to ScreenCaptureKit - Sample project doesn't work on macOS Sonoma
I downloaded the sample project as well and I was getting the same error. Funnily enough, an idea came to my mind while showering. Maybe now in Sonoma SCStream keeps a weak reference to the outputs, and because the sample project declares the CaptureEngineStreamOutput instance locally, it gets discarded right away. That was my guess. I came back to the Xcode and confirmed when I saw this line: func startCapture(configuration: SCStreamConfiguration, filter: SCContentFilter) -> AsyncThrowingStream<CapturedFrame, Error> { AsyncThrowingStream<CapturedFrame, Error> { continuation in // The stream output object. let output = CaptureEngineStreamOutput(continuation: continuation) So I declared right above the method a property to keep the reference alive: private var streamOutput: CaptureEngineStreamOutput? And then, assign the local property to the instance one: streamOutput = output That immediately fixed the error!
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’23