Skip to main content

capturekit

Python library for monitor capture, exclusive window capture (the window's own pixels, even when covered by other windows) and audio capture (microphone, system audio, individual applications), with synchronised recording to H.264 MKV/MP4 through FFmpeg and hardware encoders.

  • Windows 10/11 — DXGI Desktop Duplication, Windows Graphics Capture, WASAPI (including per-process loopback). Implemented and tested.
  • Linux X11 / Xvfb (explicit display strings such as ":99") — MIT-SHM, XComposite, PulseAudio protocol (per-application capture via monitor streams). Implemented and tested on Xvfb; native desktops/PipeWire untested (see capabilities).
  • Wayland-only sessions are detected and rejected; macOS is out of scope.

Pure Python + ctypes (no compiled extension). Runtime dependency: numpy.

Install

pip install capturekit            # library
pip install capturekit[ffmpeg]    # + bundled FFmpeg binary (imageio-ffmpeg)

Recording needs an FFmpeg executable: PATH, CAPTUREKIT_FFMPEG, EncoderConfig(ffmpeg_path=...), or the [ffmpeg] extra.

Quick start

import capturekit as ck

print(ck.get_capabilities().summary())

# One frame of the primary monitor (BGRA numpy array)
img = ck.screenshot()

# Exclusive capture of a window, cropped relative to its client area
win = next(w for w in ck.list_windows() if "Notepad" in w.title)
with ck.ScreenCapture(ck.WindowSource(win, client_area_only=True,
                                      region=ck.Rect(0, 0, 400, 300))) as cap:
    for frame in cap.frames(fps=30, max_frames=60):
        process(frame.data)                       # (300, 400, 4) uint8

# Record the window + only that application's audio + the microphone
rec = ck.Recorder(
    ck.WindowSource(win),
    [ck.ProcessAudioSource.for_window(win), ck.MicrophoneSource()],
    "notepad.mkv",
    ck.RecordingConfig(fps=60, audio_mix=ck.AudioMixMode.BOTH),
    on_error=print,
)
rec.start()
...
rec.pause(); rec.resume()
result = rec.stop()
print(result.stats.video)          # slots, new/duplicated/dropped frames, timings

More: examples/ · API guide.

Documentation

Topic
What works where docs/capabilities.md
Windows requirements & behaviour docs/guide/windows.md
Linux X11 / Xvfb docs/guide/linux.md
Audio sources, process selection docs/guide/audio.md
Encoders & hardware encoding docs/guide/encoding.md
Performance numbers & tuning docs/guide/performance.md
Troubleshooting docs/guide/troubleshooting.md
Architecture / decisions docs/architecture.md, docs/decisions.md
Contributing CONTRIBUTING.md

Responsible use

Recording starts only through explicit API calls; capturekit has no background, hidden or persistent recording features. Windows asking to be excluded from capture (display affinity) and protected content are respected, never bypassed. Windows draws its capture border unless you request otherwise and the OS permits it.

Status

Alpha. Windows and Linux X11 backends are implemented and covered by integration tests that run on real hardware (Windows) and private Xvfb servers (Linux). See docs/PROGRESS.md.

Metadata

Release files for capturekit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for capturekit 0.1.0
File Size Uploaded Provenance Actions
capturekit-0.1.0.tar.gz 157.1 kB With provenance Details for capturekit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for capturekit 0.1.0
File Interpreter ABI Platform Actions
capturekit-0.1.0-py3-none-any.whl Python 3 none any Details for capturekit-0.1.0-py3-none-any.whl

Total release size: 252.0 kB

Release files / capturekit-0.1.0.tar.gz

Download URL capturekit-0.1.0.tar.gz
Size 157.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c251b9a9d2089a1bdef0836c00e2aecff0cb26d0fa72a272b638af6f23af36f3
BLAKE2b-256 checksum
How to use checksums
f00a2829660c31322932dfc5c1b86eb73fec50ad4c6e14ff5397a3e0b07e2b10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / capturekit-0.1.0-py3-none-any.whl

Download URL capturekit-0.1.0-py3-none-any.whl
Size 94.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6044a19e608bf3d8fdb6a7790a73a441d5b12ae6a3f4bc937670a9e6071dd9d
BLAKE2b-256 checksum
How to use checksums
de4537e272a132e944ac725ae18a172a87f334ec7c8a20bd27bc176e24044156
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Security for capturekit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for capturekit-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page