Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ScreenCaptureKit is Apple’s modern API for capturing selected Mac displays, windows, video, and audio. A typical app discovers shareable content with SCShareableContent, selects it with an SCContentFilter, sets video and audio behavior in SCStreamConfiguration, then receives CMSampleBuffer objects through an SCStream. Apple describes ScreenCaptureKit as the replacement for ReplayKit when you need screen streaming or mirroring.

The macOS sample discussed here requires macOS 15 or later and Xcode 16 or later. Those are the sample’s prerequisites, not a universal minimum for every ScreenCaptureKit deployment; check the API reference for the OS versions your app supports.

What the Apple Screen Capture API does

ScreenCaptureKit is a framework for capturing chosen screen content and delivering media to your app. You can capture an entire display, an individual window, or an app’s content, and you can request system audio and microphone input in addition to video. Samples arrive as CMSampleBuffer values with timing and format metadata, so your app can encode them, display them, stream them, or write them to a file.

Apple lists ScreenCaptureKit across iOS, iPadOS, macOS, tvOS, and visionOS. The setup and code below are specifically for a macOS app because Apple’s detailed sample and permission flow are macOS-focused.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

How a ScreenCaptureKit capture works

  1. Discover sources. Ask SCShareableContent for displays, applications, and windows currently available to capture.
  2. Choose a scope. Create an SCContentFilter for a display or window, optionally excluding applications or other content.
  3. Configure output. Set dimensions, frame interval, pixel format, queue depth, and audio options on SCStreamConfiguration.
  4. Create and register the stream. Initialize SCStream, add output handlers for screen, audio, and microphone sample types, and start capture.
  5. Process samples. Convert or encode each CMSampleBuffer, dispatch expensive work off the capture queue, and stop the stream when finished.

Use Apple’s SCContentSharingPicker when people must choose what to share. It supplies the system source-selection UI and manages active streams, avoiding a custom picker that could expose more content than the user intended.

Project and privacy setup on macOS

Requirements

  • A Mac running macOS 15 or later for the cited Apple sample.
  • Xcode 16 or later for that sample.
  • A macOS app target that links ScreenCaptureKit and the frameworks used by your media pipeline.

Declare the reason for capture

Add NSScreenCaptureUsageDescription to the target’s Info pane (or directly to Info.plist). Use a plain-language explanation such as “This app captures the selected screen or window for recording and streaming.” The system uses this text when asking for access.

Grant permission and restart

On first capture, macOS asks the user for Screen Recording access. The Apple macOS sample says the app must be restarted after permission is granted. Build a clear state in your UI for “permission required,” send the user to System Settings, and explain that a restart may be necessary before trying again.

Minimal Swift capture example

The following example shows the core flow: pick the first available display, capture its video, and print the incoming sample timestamps. A production app should present a source picker, validate permission, and send samples to an encoder or file writer instead of only logging them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import Foundation
import ScreenCaptureKit
import CoreMedia

final class DisplayCapture: NSObject, SCStreamOutput, SCStreamDelegate {
    private var stream: SCStream?

    func start() async throws {
        let shareable = try await SCShareableContent.excludingDesktopWindows(false,
                                                                             onScreenWindowsOnly: true)
        guard let display = shareable.displays.first else {
            throw NSError(domain: "DisplayCapture", code: 1,
                          userInfo: [NSLocalizedDescriptionKey: "No display is available"])
        }

        let filter = SCContentFilter(display: display, excludingApplications: [], exceptingWindows: [])
        let configuration = SCStreamConfiguration()
        configuration.width = display.width
        configuration.height = display.height
        configuration.minimumFrameInterval = CMTime(value: 1, timescale: 60)
        configuration.queueDepth = 5
        configuration.showsCursor = true
        configuration.capturesAudio = false

        let newStream = SCStream(filter: filter, configuration: configuration, delegate: self)
        try newStream.addStreamOutput(self, type: .screen, sampleHandlerQueue: DispatchQueue(label: "screen.samples"))
        stream = newStream
        try await newStream.startCapture()
    }

    func stop() async throws {
        try await stream?.stopCapture()
        stream = nil
    }

    func stream(_ stream: SCStream, didOutputSampleBuffer sampleBuffer: CMSampleBuffer,
                of type: SCStreamOutputType) {
        guard type == .screen else { return }
        let time = sampleBuffer.presentationTimeStamp
        print("Video sample at (time.seconds)s")
        // Encode, display, or write the sample here.
    }

    func stream(_ stream: SCStream, didStopWithError error: Error) {
        print("Capture stopped: (error.localizedDescription)")
    }
}

let capture = DisplayCapture()
Task {
    do {
        try await capture.start()
    } catch {
        print("Unable to start capture: (error.localizedDescription)")
    }
}

The exact initializer overloads and availability can vary with the SDK you target. Compile against your deployment SDK and consult the current ScreenCaptureKit API reference when supporting older releases.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Capturing a window or app instead of a display

After discovering shareable.windows or shareable.applications, build a filter for the selected object rather than the display. A window filter limits capture to that window’s content; a display filter captures everything in the selected display unless you provide exclusions. Keep selection and output configuration separate: the filter answers “what,” while SCStreamConfiguration answers “how.”

For user-driven selection, prefer SCContentSharingPicker. It gives users the system-controlled choice of display, window, or app and lets them manage an active share. Your app can then apply the resulting content filter to an existing stream.

Video configuration and buffering

Frame rate and dimensions

Set width, height, and minimumFrameInterval to match your encoder or network target. The sample uses a 60 fps interval and the display’s dimensions. Apple’s WWDC22 session says ScreenCaptureKit can deliver video up to a display’s native resolution and frame rate, but that is a 2022 capability statement, not an independent benchmark or a guarantee for every Mac and configuration.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Queue depth

Apple’s sample uses a queue depth of five. The documented default is three, and the sample guidance says not to exceed eight frames. A larger queue consumes more memory but can keep capture moving while your processing code catches up; a smaller queue limits memory but makes stalls more likely to affect the stream. Measure your own encoder and network path before changing it.

Pixel format and dynamic range

Choose a pixel format that your downstream pipeline accepts. Apple’s update history identifies HDR capture as a capability area, but the available formats and minimum OS release depend on the SDK and deployment target, so verify those details in the current API reference.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

System audio and microphone capture

Audio capture is disabled by default. Set the relevant configuration options before starting the stream, then register output handlers for the audio sample types you need. Apple’s sample demonstrates separate handling for screen, system audio, and microphone output, including an option to exclude the app’s own audio.

configuration.capturesAudio = true
configuration.excludesCurrentProcessAudio = true

try newStream.addStreamOutput(self,
                              type: .audio,
                              sampleHandlerQueue: DispatchQueue(label: "audio.samples"))
try newStream.addStreamOutput(self,
                              type: .microphone,
                              sampleHandlerQueue: DispatchQueue(label: "mic.samples"))

Only enable microphone capture when the user expects it, and describe that behavior in your UI. The WWDC22 session attributes support for audio samples up to 48 kHz stereo to Apple’s ScreenCaptureKit team; treat that as a dated capability statement rather than a promise about every device, source, or processing path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Changing a running capture

ScreenCaptureKit supports applying a new content filter or configuration to a running stream. This is useful when a user switches from a display to a window, changes resolution, or turns audio on. Coordinate updates on the stream’s control path, stop accepting assumptions about the old dimensions, and reconfigure your encoder when the format changes. If your pipeline cannot handle a live format change safely, stop, rebuild, and restart the stream.

Reliability, performance, and cost decisions

  • Capture scope: a window or app filter reduces unrelated content and simplifies privacy review; a display filter is appropriate for presentations or full-desktop recording.
  • Output size: native-resolution frames preserve detail but increase memory, encoding work, and bandwidth. Downscale when the destination does not need native pixels.
  • Frame interval: 60 fps is useful for games and cursor movement; a slower rate can reduce processing load for static software screens.
  • Media: screen-only capture is simpler. System audio and microphone add synchronization, permissions, and mixing decisions.
  • Buffering: increase queue depth only when measured processing stalls justify the extra memory.
  • Privacy: let the system picker define the source where possible, and never assume that a display-wide filter is equivalent to a single-window share.

Apple positions ScreenCaptureKit as performance-focused and says it leverages Mac GPUs with lower CPU overhead than existing capture methods. That statement comes from WWDC22; it is not a comparative test result for your application.

Troubleshooting common failures

No sources are returned

Check that a display or window is actually available, that the app is running in a normal logged-in user session, and that the source has not disappeared between discovery and filter creation. Refresh SCShareableContent before retrying.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Permission errors or a black/empty capture

Confirm the app has Screen Recording access in macOS privacy settings and that NSScreenCaptureUsageDescription is present. Follow the sample’s restart requirement after granting access. If the user selected a window that closed, ask them to choose a new source.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Capture stops with dropped frames

Move encoding and file/network writes off the sample callback queue, reduce output dimensions or frame rate, and inspect memory use. A modest queue-depth increase can absorb short processing spikes, but Apple’s sample guidance limits the value to eight frames.

Audio is missing

Audio is off by default. Enable the appropriate configuration, register the matching output type, and verify that the selected source and macOS permissions allow the audio path you requested. Handle system audio and microphone as separate streams when your mixer needs independent control.

The app crashes after a format change

Rebuild or reconfigure your encoder when dimensions, pixel format, or audio format changes. Do not continue feeding samples under assumptions from the previous configuration.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Testing checklist

  • Test display, window, and app selections, including a window that closes during capture.
  • Test permission denied, permission granted followed by restart, and permission revoked while the app is running.
  • Test screen-only, system-audio, microphone, and combined capture paths.
  • Test native and reduced dimensions, 60 fps and slower intervals, and sustained recording long enough to expose memory growth.
  • Verify that your UI clearly indicates what source and audio devices are active.

Or skip the browser setup

If your goal is a website image or PDF rather than a user’s Mac desktop, ScreenshotNeo provides a single HTTP request. It handles consent banners before capture, removes more than 60 known consent platforms plus newsletter popups and chat widgets, and bills only clean shots. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the ScreenshotNeo API documentation for all options. cURL:

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. Every feature is on every plan: 1,000 screenshots per month are free with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it.

Frequently Asked Questions

Does ScreenCaptureKit record the desktop without user permission?

No. macOS requires the user to grant Screen Recording access, and your app must explain its need with NSScreenCaptureUsageDescription.

Can I capture only one application window?

Yes. Discover windows or applications with SCShareableContent and create an SCContentFilter for the selected item instead of an entire display.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is ReplayKit required for Mac screen streaming?

Apple describes ScreenCaptureKit as replacing ReplayKit for screen streaming and mirroring, so a macOS implementation can use ScreenCaptureKit directly.

Can ScreenCaptureKit create a finished MP4 file by itself?

It delivers CMSampleBuffer media to your app. You must connect those samples to an encoder or media writer suited to your output format.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.