ScreenCaptureKit

RSS for tag

ScreenCaptureKit brings high-performance screen capture, including audio and video, to macOS.

Posts under ScreenCaptureKit tag

126 Posts

Post

Replies

Boosts

Views

Activity

Presenter overlay causes AVAssetWriter failure
I work on a screen recorder app and having issues with the new presenter overlay mode on macOS 14. Switching to the "Small" overlay is fine, but switching to the "Large" overlay mode causes our AVAssetWriter to fail every time with the following error: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-16364), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x6000028729a0 {Error Domain=NSOSStatusErrorDomain Code=-16364 "(null)"}} which doesn't provide any helpful information. I'm not sure if we're doing something wrong, but I've tried to reduce our code as much as possible and still get the crash. I'm not sure if anyone has any clues or is experiencing the same thing? Alternatively, is there a way to disable presenter overlay until it's fixed? Our app displays a camera and uses ScreenCaptureKit to record the screen along with the camera, which automatically enables presenter overlay options. I can't find any way to opt-out or turn off the presenter overlay options which is a bummer. That seems like it should be controllable from either the AVCaptureSession or SCStreamConfiguration
2
0
831
Oct ’23
Issue with ScreenCaptureKit Performance(After Sonoma updates)
I'm encountering performance degradation with my application that utilizes ScreenCaptureKit. Even after explicitly disabling App Nap using the NSAppSleepDisabled key, the problem persists. My application, which relies heavily on ScreenCaptureKit for its core functionality, experiences significant performance drops after running for a short period. When I click on the application, the performance momentarily returns to normal but quickly deteriorates again. I've checked for memory leaks in my application and haven't found any issues in that regard. Has anyone experienced similar performance issues with ScreenCaptureKit? I'm keen to know if there are any known bugs or workarounds to mitigate this problem.
0
1
908
Oct ’23
Is there a delegate for the stop sharing button in Sonoma?
Hey team -- looking to receive a delegate callback in Sonoma for screencapturekit when the toolbar portion of stop sharing is called. Does this come through in any of these? /** @abstract stream :didStopStreamWithError: @param stream the SCStream object @param error the error denoted by the stopping of the stream @discussion notifies the delegate that the stream has stopped and the error associated with it */ optional func stream(_ stream: SCStream, didStopWithError error: Error) /** @abstract outputVideoEffectDidStartForStream: @param stream the SCStream object @discussion notifies the delegate that the stream's overlay video effect has started. */ @available(macOS 14.0, *) optional func outputVideoEffectDidStart(for stream: SCStream) /** @abstract stream:outputVideoEffectDidStart: @param stream the SCStream object @discussion notifies the delegate that the stream's overlay video effect has stopped. */ @available(macOS 14.0, *) optional func outputVideoEffectDidStop(for stream: SCStream)
1
0
695
Sep ’23
Applcation fotr screen share or screen capture for iphone
I am new to ios. I want to develop the application where I can able to share screen (display)from iphone(or from iphone to iphone) for remote support. For this this I need screen capture application or want to develop application .Can any apple developer help me on this.I want to chat and connect with Apple developer. If any freelancer is there then please connect with me.
0
0
588
Sep ’23
ScreenCaptureKit - Sample project need obtain screen recording permissions every time.
Get screen recording permission window show every time when I run the ScreenCaptureKit sample project on macOS Sonoma Beta5: Even though I've already provided permissions in the screen recording permissions: This box keeps popping up, and until I remove the old recorded "CaptureSample" screen-recording permissions in "System Settings->Screen Recording" and add them again, it won't be able to record. This issue happens many times a day! Does anyone know how to fix it? Thanks~
2
0
1.2k
Sep ’23
Screen recording- ScreenCaptureKit or AVFoundation?
Hi! I am building a Mac swift app to make screen recordings. I want to be able to record all the screen, a window or an area of the screen. I am very new to swift and am not sure if I should be using AVCaptureSession or SCScreenCaptureSession. I am trying to understand the differences and when I should use one over the other can anyone point me in the right direction? Thanks!
2
0
2.5k
Aug ’23
ScreenCaptureKit - Sample project doesn't work on macOS Sonoma
I'm getting this error when I try to run the ScreenCaptureKit sample project on macOS Sonoma: [ERROR] _SCStream_RemoteAudioQueueOperationHandlerWithError:1,053 streamOutput NOT found. Dropping frame [ERROR] _SCStream_RemoteVideoQueueOperationHandlerWithError:1,020 stream output NOT found. Dropping frame Both streamOutput are being set like this: try stream?.addStreamOutput(streamOutput, type: .screen, sampleHandlerQueue: videoSampleBufferQueue) try stream?.addStreamOutput(streamOutput, type: .audio, sampleHandlerQueue: audioSampleBufferQueue) Link to sample project https://developer.apple.com/documentation/screencapturekit/capturing_screen_content_in_macos Any idea of what is causing this?
3
5
2.4k
Aug ’23
SCFilter does not support multiple windows as the target source
SCFilter in ScreenCaptureKit has 5 methods to select the capture target. Only one method initWithDesktopIndependentWindow: accepts one SCWindow as its capture target. The other four methods target one SCDisplay and extra SCRunningApplication or SCWindow combinations to filter out items by their criteria. Compared to the old API to capture windows or displays snapshots: CGImageRef CGWindowListCreateImage(CGRect screenBounds, CGWindowListOption listOption, CGWindowID windowID, CGWindowImageOption imageOption); CGImageRef CGWindowListCreateImageFromArray(CGRect screenBounds, CFArrayRef windowArray, CGWindowImageOption imageOption); The second method accepts an array of CGWindowID, so the result is a composite image formed from these windows. Will Apple provide a substitute in SCFilter for this method in the future?
0
0
654
Jul ’23
SCScreenshotManager puts artifacts in window title bar
Hello, Our macOS app (https://www.rewind.ai) takes periodic screenshots when it runs, and does so in the background without user intervention. Back on macOS 13 and earlier, we were using CGImage(windowListFromArrayScreenBounds:...) to do this. Now that there's a nice new way to do this in macOS 14 with ScreenCaptureKit's SCScreenshotManager, we tried moving to SCKit. Unfortunately, SCScreenshotManager displays purple icons in the title bars of all windows that it captures. For our purposes, this results in constant flickering icons in all window title bars while our app is running. I couldn't find a way to control this behavior. Am I missing something? Is it possible to use SCKit to take screenshots without showing these icons in window title bars? Thanks!
1
0
929
Jun ’23
ScreenCaptureKit - Sample project doesn't capture audio on MacOS 13.3
It was working fine on previous versions. Error message: CaptureSample[13228:113286] [AVAB] AVAudioBuffer.mm:248 the number of buffers (810878176) does not match the format's number of channel streams (2) From what I've found, this error is coming from the function createPCMBuffer on CaptureEngine Link to sample project https://developer.apple.com/documentation/screencapturekit/capturing_screen_content_in_macos
3
3
1.9k
Apr ’23
No screen recording permission on MacOS 13.0 Ventura
I try to run ScreenCaptureKit sample code. That sample require macOS 13.0 for audio capture. When I run, the app shows with "No screen recording permission". I grant Screen Recording permission on System Settings -> Privacy & Security. But same error happens. I cannot find a way to grant the permission. I tried restart app, restart Xcode, reboot macOS and rm -rf ~/Library/Developer/Xcode/DerivedData/CaptureSample-... This sample app worked after comment out "streamConfig.capturesAudio" and related code on Monterey. This permission issue did not happen on Monterey. Env: macOS Ventura 13.0, Xcode 14.1(14B47b) Sample code URL : https://developer.apple.com/documentation/screencapturekit/capturing_screen_content_in_macos?language=objc
1
0
1.9k
Dec ’22
ScreenCaptureKit and frameworks using ObjC headers
I'm trying to include SCK in a C++ project I build with CMake. This works well for projects using Apple's frameworks with C header files: project(as_demo) find_library(AS ApplicationServices) add_executable(as_demo MACOSX_BUNDLE as_demo.cc) target_link_libraries(as_demo ${AS}) I can add an ObjC mm file to this executable if it's in my project and it works a-ok. However, SCK's headers are written in ObjC and it seems like it won't work with how I have this project set up. Header files are resolvable from my project, but any headers within the header I import is not findable, and all the ObjC source is error highlighted. This does not work: project(sc_demo) find_library(SCK ScreenCaptureKit) add_executable(sc_demo MACOSX_BUNDLE sc_demo.cc) target_link_libraries(sc_demo ${SCK}) Any suggestions?
1
0
989
Nov ’22
Presenter overlay causes AVAssetWriter failure
I work on a screen recorder app and having issues with the new presenter overlay mode on macOS 14. Switching to the "Small" overlay is fine, but switching to the "Large" overlay mode causes our AVAssetWriter to fail every time with the following error: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-16364), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x6000028729a0 {Error Domain=NSOSStatusErrorDomain Code=-16364 "(null)"}} which doesn't provide any helpful information. I'm not sure if we're doing something wrong, but I've tried to reduce our code as much as possible and still get the crash. I'm not sure if anyone has any clues or is experiencing the same thing? Alternatively, is there a way to disable presenter overlay until it's fixed? Our app displays a camera and uses ScreenCaptureKit to record the screen along with the camera, which automatically enables presenter overlay options. I can't find any way to opt-out or turn off the presenter overlay options which is a bummer. That seems like it should be controllable from either the AVCaptureSession or SCStreamConfiguration
Replies
2
Boosts
0
Views
831
Activity
Oct ’23
Issue with ScreenCaptureKit Performance(After Sonoma updates)
I'm encountering performance degradation with my application that utilizes ScreenCaptureKit. Even after explicitly disabling App Nap using the NSAppSleepDisabled key, the problem persists. My application, which relies heavily on ScreenCaptureKit for its core functionality, experiences significant performance drops after running for a short period. When I click on the application, the performance momentarily returns to normal but quickly deteriorates again. I've checked for memory leaks in my application and haven't found any issues in that regard. Has anyone experienced similar performance issues with ScreenCaptureKit? I'm keen to know if there are any known bugs or workarounds to mitigate this problem.
Replies
0
Boosts
1
Views
908
Activity
Oct ’23
Is there a delegate for the stop sharing button in Sonoma?
Hey team -- looking to receive a delegate callback in Sonoma for screencapturekit when the toolbar portion of stop sharing is called. Does this come through in any of these? /** @abstract stream :didStopStreamWithError: @param stream the SCStream object @param error the error denoted by the stopping of the stream @discussion notifies the delegate that the stream has stopped and the error associated with it */ optional func stream(_ stream: SCStream, didStopWithError error: Error) /** @abstract outputVideoEffectDidStartForStream: @param stream the SCStream object @discussion notifies the delegate that the stream's overlay video effect has started. */ @available(macOS 14.0, *) optional func outputVideoEffectDidStart(for stream: SCStream) /** @abstract stream:outputVideoEffectDidStart: @param stream the SCStream object @discussion notifies the delegate that the stream's overlay video effect has stopped. */ @available(macOS 14.0, *) optional func outputVideoEffectDidStop(for stream: SCStream)
Replies
1
Boosts
0
Views
695
Activity
Sep ’23
Applcation fotr screen share or screen capture for iphone
I am new to ios. I want to develop the application where I can able to share screen (display)from iphone(or from iphone to iphone) for remote support. For this this I need screen capture application or want to develop application .Can any apple developer help me on this.I want to chat and connect with Apple developer. If any freelancer is there then please connect with me.
Replies
0
Boosts
0
Views
588
Activity
Sep ’23
Screen capture app or API for ios
I want to develop the application where I can able to share screen (display)from iphone(or from iphone to iphone) for remote support(or any other method) for this this I need screen captute application or API or system call. If any app is there in iphone or app store or any screen sharing client which can give me screen capture support.
Replies
0
Boosts
0
Views
903
Activity
Sep ’23
ScreenCaptureKit - Sample project need obtain screen recording permissions every time.
Get screen recording permission window show every time when I run the ScreenCaptureKit sample project on macOS Sonoma Beta5: Even though I've already provided permissions in the screen recording permissions: This box keeps popping up, and until I remove the old recorded "CaptureSample" screen-recording permissions in "System Settings->Screen Recording" and add them again, it won't be able to record. This issue happens many times a day! Does anyone know how to fix it? Thanks~
Replies
2
Boosts
0
Views
1.2k
Activity
Sep ’23
How to get dirtyRect from SCScreenshotManager.captureSameplBuffer on Sonoma?
Hey, how can I retrieve dirtyRect from SCScreenshotManager.captureSampleBuffer? With streaming method, I can get it via attachments, but attachments are missing when using the SCScreenshotManager. If I have to compute it manually, would would be the most performant way of doing so?
Replies
0
Boosts
0
Views
557
Activity
Sep ’23
Screen Control for iOS Devices
Hey All, Do we have any Solution for screen control of iOS devices from Mac, like Vysor for android? Appreciate your help here. Thanks!
Replies
0
Boosts
0
Views
751
Activity
Sep ’23
Screen recording- ScreenCaptureKit or AVFoundation?
Hi! I am building a Mac swift app to make screen recordings. I want to be able to record all the screen, a window or an area of the screen. I am very new to swift and am not sure if I should be using AVCaptureSession or SCScreenCaptureSession. I am trying to understand the differences and when I should use one over the other can anyone point me in the right direction? Thanks!
Replies
2
Boosts
0
Views
2.5k
Activity
Aug ’23
Remove the menu area in SceenCaptureKit
from: to:
Replies
0
Boosts
0
Views
587
Activity
Aug ’23
ScreenCaptureKit - Sample project doesn't work on macOS Sonoma
I'm getting this error when I try to run the ScreenCaptureKit sample project on macOS Sonoma: [ERROR] _SCStream_RemoteAudioQueueOperationHandlerWithError:1,053 streamOutput NOT found. Dropping frame [ERROR] _SCStream_RemoteVideoQueueOperationHandlerWithError:1,020 stream output NOT found. Dropping frame Both streamOutput are being set like this: try stream?.addStreamOutput(streamOutput, type: .screen, sampleHandlerQueue: videoSampleBufferQueue) try stream?.addStreamOutput(streamOutput, type: .audio, sampleHandlerQueue: audioSampleBufferQueue) Link to sample project https://developer.apple.com/documentation/screencapturekit/capturing_screen_content_in_macos Any idea of what is causing this?
Replies
3
Boosts
5
Views
2.4k
Activity
Aug ’23
screen capture kit wwdc 2023
i saw SC kit wwdc 23 video, just awesome!!. any sample project available with latest update feature for reference to make my recording app
Replies
0
Boosts
0
Views
771
Activity
Jul ’23
SCFilter does not support multiple windows as the target source
SCFilter in ScreenCaptureKit has 5 methods to select the capture target. Only one method initWithDesktopIndependentWindow: accepts one SCWindow as its capture target. The other four methods target one SCDisplay and extra SCRunningApplication or SCWindow combinations to filter out items by their criteria. Compared to the old API to capture windows or displays snapshots: CGImageRef CGWindowListCreateImage(CGRect screenBounds, CGWindowListOption listOption, CGWindowID windowID, CGWindowImageOption imageOption); CGImageRef CGWindowListCreateImageFromArray(CGRect screenBounds, CFArrayRef windowArray, CGWindowImageOption imageOption); The second method accepts an array of CGWindowID, so the result is a composite image formed from these windows. Will Apple provide a substitute in SCFilter for this method in the future?
Replies
0
Boosts
0
Views
654
Activity
Jul ’23
SCScreenshotManager puts artifacts in window title bar
Hello, Our macOS app (https://www.rewind.ai) takes periodic screenshots when it runs, and does so in the background without user intervention. Back on macOS 13 and earlier, we were using CGImage(windowListFromArrayScreenBounds:...) to do this. Now that there's a nice new way to do this in macOS 14 with ScreenCaptureKit's SCScreenshotManager, we tried moving to SCKit. Unfortunately, SCScreenshotManager displays purple icons in the title bars of all windows that it captures. For our purposes, this results in constant flickering icons in all window title bars while our app is running. I couldn't find a way to control this behavior. Am I missing something? Is it possible to use SCKit to take screenshots without showing these icons in window title bars? Thanks!
Replies
1
Boosts
0
Views
929
Activity
Jun ’23
How to protect the content of my app from screenshot
How to protect the content of my app from screenshot and screen recording in a way that is accepted in the app store
Replies
2
Boosts
0
Views
823
Activity
Jun ’23
Could ScreenCaptureKit control which windows to share.
Could ScreenCaptureKit be used in SwiftUI app to configure which windows to be shared when an app shared by another app (such as Zoom, Google, FaceTime meets etc.)
Replies
0
Boosts
0
Views
916
Activity
May ’23
ScreenCaptureKit and the macOS app store
Are applications using the ScreenCaputreKit allowed on the macOS app store?
Replies
2
Boosts
0
Views
1k
Activity
May ’23
ScreenCaptureKit - Sample project doesn't capture audio on MacOS 13.3
It was working fine on previous versions. Error message: CaptureSample[13228:113286] [AVAB] AVAudioBuffer.mm:248 the number of buffers (810878176) does not match the format's number of channel streams (2) From what I've found, this error is coming from the function createPCMBuffer on CaptureEngine Link to sample project https://developer.apple.com/documentation/screencapturekit/capturing_screen_content_in_macos
Replies
3
Boosts
3
Views
1.9k
Activity
Apr ’23
No screen recording permission on MacOS 13.0 Ventura
I try to run ScreenCaptureKit sample code. That sample require macOS 13.0 for audio capture. When I run, the app shows with "No screen recording permission". I grant Screen Recording permission on System Settings -> Privacy & Security. But same error happens. I cannot find a way to grant the permission. I tried restart app, restart Xcode, reboot macOS and rm -rf ~/Library/Developer/Xcode/DerivedData/CaptureSample-... This sample app worked after comment out "streamConfig.capturesAudio" and related code on Monterey. This permission issue did not happen on Monterey. Env: macOS Ventura 13.0, Xcode 14.1(14B47b) Sample code URL : https://developer.apple.com/documentation/screencapturekit/capturing_screen_content_in_macos?language=objc
Replies
1
Boosts
0
Views
1.9k
Activity
Dec ’22
ScreenCaptureKit and frameworks using ObjC headers
I'm trying to include SCK in a C++ project I build with CMake. This works well for projects using Apple's frameworks with C header files: project(as_demo) find_library(AS ApplicationServices) add_executable(as_demo MACOSX_BUNDLE as_demo.cc) target_link_libraries(as_demo ${AS}) I can add an ObjC mm file to this executable if it's in my project and it works a-ok. However, SCK's headers are written in ObjC and it seems like it won't work with how I have this project set up. Header files are resolvable from my project, but any headers within the header I import is not findable, and all the ObjC source is error highlighted. This does not work: project(sc_demo) find_library(SCK ScreenCaptureKit) add_executable(sc_demo MACOSX_BUNDLE sc_demo.cc) target_link_libraries(sc_demo ${SCK}) Any suggestions?
Replies
1
Boosts
0
Views
989
Activity
Nov ’22