---
title: "captureSampleBuffer(contentFilter:configuration:completionHandler:)"
framework: screencapturekit
role: symbol
role_heading: Type Method
path: "screencapturekit/scscreenshotmanager/capturesamplebuffer(contentfilter:configuration:completionhandler:)"
---

# captureSampleBuffer(contentFilter:configuration:completionHandler:)

Captures a single frame directly from a stream’s buffer, using a filter.

## Declaration

```swift
class func captureSampleBuffer(contentFilter: SCContentFilter, configuration config: SCStreamConfiguration, completionHandler: (@Sendable (CMSampleBuffer?, (any Error)?) -> Void)? = nil)
```

```swift
class func captureSampleBuffer(contentFilter: SCContentFilter, configuration config: SCStreamConfiguration) async throws -> CMSampleBuffer
```

## Parameters

- `contentFilter`: The content filter used to select the stream.
- `config`: Configuration information for how to record the stream buffer.
- `completionHandler`: Closure that processes the capture taken from streaming content.

## See Also

### Individual frame capture

- [captureImage(contentFilter:configuration:completionHandler:)](screencapturekit/scscreenshotmanager/captureimage(contentfilter:configuration:completionhandler:).md)
