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

Starting from macOS 12.3, use the ScreenCaptureKit framework for screen recording instead of AVCaptureScreenInput. Although AVCaptureScreenInput can define a cropRect to indicate the portion of the screen area to be captured, ScreenCaptureKit provides rich APIs to identify and capture specific windows, such as SCShareableContent and SCWindow.

Thanks for the reply! So if I use ScreenCaptureKit how would I go about recording just part of a window (I want to define a rect and record for that area only) rather than the whole window. I can see cropRect for AVCapture is there something similar for ScreenCapture?

Thanks for your help!

Post not yet marked as solved Up vote reply of na88 Down vote reply of na88