Expand description
§ScreenCaptureKit-rs
Rust bindings for macOS ScreenCaptureKit framework.
This crate provides safe, idiomatic Rust bindings for capturing screen content, windows, and applications on macOS 12.3+.
§Features
- Screen and window capture
- Audio capture
- Real-time frame processing
- Configurable capture settings
- Zero external dependencies (uses custom Swift bridge)
§Quick Start
use screencapturekit::prelude::*;
// Get shareable content
let content = SCShareableContent::get()?;
let display = &content.displays()[0];
// Create filter and configuration
let filter = SCContentFilter::builder()
.display(display)
.exclude_windows(&[])
.build();
let mut config = SCStreamConfiguration::default();
config.set_width(1920);
config.set_height(1080);
// Create and start stream
let mut stream = SCStream::new(&filter, &config);
stream.start_capture()?;§Module Organization
Re-exports§
pub use cm::codec_types;pub use cm::media_types;pub use cm::AudioBuffer;pub use cm::AudioBufferList;pub use cm::CMFormatDescription;pub use cm::CMSampleBuffer;pub use cm::CMSampleTimingInfo;pub use cm::CMTime;pub use cm::CVPixelBuffer;pub use cm::CVPixelBufferPool;pub use cm::IOSurface;pub use cm::SCFrameStatus;pub use utils::four_char_code::FourCharCode;
Modules§
- async_
api - Async API for
ScreenCaptureKit - cg
- Core Graphics types for screen coordinates and dimensions
- cm
- Core Media types and wrappers
- content_
sharing_ picker SCContentSharingPicker- UI for selecting content to share- dispatch_
queue - Dispatch Queue wrapper for custom queue management
- error
- Error types for
ScreenCaptureKitoperations - ffi
- Swift FFI bridge to
ScreenCaptureKit - output
- Frame buffer and pixel access
- prelude
- Prelude module for convenient imports
- recording_
output SCRecordingOutput- Direct video file recording- screenshot_
manager SCScreenshotManager- Single-shot screenshot capture- shareable_
content - Shareable content types - displays, windows, and applications
- stream
- Screen capture stream functionality
- utils
- Utility modules