Skip to main content

recap

Cross-platform headless screen and audio capture library and CLI.

Features

  • Cross-platform: Windows, macOS, and Linux
  • Record an entire monitor or a single window
  • Record system audio (loopback capture)
  • Per-application audio capture (Windows only via WASAPI process loopback)
  • Video-only, audio-only, or audio+video modes
  • Crop support with configurable size and anchor position
  • CLI tool (recap) and importable Python library
  • Uses FFmpeg for encoding/muxing only

Platform Support

Feature Windows macOS Linux
Monitor capture ✓ GDI BitBlt ✓ CoreGraphics ✓ X11 XGetImage
Window capture ✓ PrintWindow ✓ CGWindowListCreateImage ✓ X11 XGetImage
System audio ✓ WASAPI loopback ⚠ Requires BlackHole/Soundflower ✓ PulseAudio monitor
Per-app audio ✓ WASAPI process loopback ✗ Not supported ✗ Not supported
HW encoding NVENC / QSV / AMF VideoToolbox / NVENC NVENC / VAAPI / QSV

macOS Notes

  • Screen Recording permission must be granted in System Settings → Privacy & Security → Screen Recording.
  • System audio capture requires a virtual audio loopback device such as BlackHole. Install BlackHole, then set it as your system output (or use a Multi-Output Device to hear audio simultaneously). Recap auto-detects BlackHole/Soundflower when available.
  • Per-application audio capture is not supported; system-wide audio is captured instead.

Linux Notes

  • Video capture requires X11 (XWayland is acceptable). Native Wayland capture is not yet supported. If running under Wayland, ensure DISPLAY is set for XWayland.
  • Discovery commands support selecting an explicit X11 display with --display (for example recap windows --display :99).
  • Audio capture uses PulseAudio/PipeWire loopback (default.monitor). Ensure pactl is available (pulseaudio-utils or pipewire-pulse).
  • Per-application audio capture is not directly supported; system-wide audio is captured instead.

Requirements

  • Python 3.10–3.13
  • FFmpeg on PATH or specified via --ffmpeg

Platform-specific requirements

  • Windows: Windows 10 version 2004+ for per-app audio capture
  • macOS: macOS 11+ recommended; Screen Recording permission required
  • Linux: X11 or XWayland; PulseAudio or PipeWire; xrandr for multi-monitor detection

Installation

From PyPI (prebuilt wheels)

pip install recap-capture

From source (editable)

git clone https://github.com/Lexian-droid/recap.git
cd recap
pip install -e .

Architecture

The project uses a Python package with a platform abstraction layer:

recap/              Python package (CLI, config, orchestration)
  __init__.py       Public API and version
  cli.py            CLI entry point
  config.py         RecordingConfig dataclass
  recorder.py       Orchestrates capture threads + FFmpeg
  video.py          Platform-dispatching video capture
  audio.py          Platform-dispatching audio capture
  discovery.py      Platform-dispatching monitor/window/device enumeration
  ffmpeg.py         FFmpeg discovery and process wiring
  exceptions.py     Exception hierarchy
  platforms/        Platform abstraction layer
    __init__.py     Platform detection utilities
    macos/          macOS backends (CoreGraphics + FFmpeg avfoundation)
    linux/          Linux backends (X11 + FFmpeg pulse/alsa)

Platform dispatch

The video.py, audio.py, and discovery.py modules contain the Windows implementation at the top level. On macOS or Linux, platform-specific implementations are imported from recap/platforms/ and replace the module-level names. This means the public API (from recap import VideoCapture) works identically regardless of platform.

Window-specific recording

When a window is targeted via --window-title or --window-handle:

  • Video is captured using the platform's native window capture API
  • Audio on Windows uses WASAPI process loopback to isolate audio from that process. On macOS/Linux, system-wide audio is captured instead (with a warning).

Releasing

GitHub Actions will publish the package to PyPI when you push a tag that starts with v (e.g. v0.5.0). Wheels are built for Python 3.10–3.13.

For local validation and manual publishing, use the built-in helper command:

# install editable package (one-time per env)
pip install -e .

# smoke-test local install
recap-release test-local

# build wheel + sdist
recap-release build

# validate metadata before upload
recap-release check-dist

# upload manually
recap-release publish-testpypi
# or
recap-release publish-pypi

Notes:

  • publish-* runs twine check automatically unless --skip-check is used.
  • test-local runs recap version, recap doctor, recap monitors, and recap devices.

CLI Usage

# Check environment
recap doctor

# List available capture targets
recap monitors
recap windows
recap devices

# List targets on a virtual X11 display
recap monitors --display :99
recap windows --display :99

# Record primary monitor with audio
recap record --output recording.mp4

# Record a specific window (video + window-specific audio on Windows)
recap record --window-title "Notepad" --output notepad.mp4

# Record from a window on a virtual X11 display
recap record --window-title "Videos - WeAnimate" --display :99 --output weanimate.mp4

# Record video only
recap record --video-only --output silent.mp4

# Record a 1280x720 crop from the top-left of the selected source
recap record --crop-size 1280x720 --crop-position top-left --output cropped.mp4

# Record a centered 1280x720 crop from a specific window
recap record --window-title "Notepad" --crop-size 1280x720 --crop-position middle --output notepad-cropped.mp4

# Record audio only
recap record --audio-only --output audio.wav

# Record for 30 seconds
recap record --duration 30 --output clip.mp4

Crop positions

--crop-position supports:

  • top-left, top-middle, top-right
  • middle-left, middle, middle-right
  • bottom-left, bottom-middle, bottom-right

Center aliases are also accepted (center, top-center, middle-center, etc.).

Library Usage

from recap import Recorder, RecordingConfig

config = RecordingConfig(output="recording.mp4")
recorder = Recorder(config)
recorder.start()
# ... do work ...
recorder.stop()
recorder.wait()

Library usage with virtual displays (Linux)

from recap import Recorder, RecordingConfig, list_windows

# Discover windows on a virtual X11 display.
windows = list_windows(display=":99")

config = RecordingConfig(
  output="weanimate.mp4",
  window_title="Videos - WeAnimate",
  display=":99",
  duration=10,
)
recorder = Recorder(config)
recorder.start()
recorder.wait()

Window-specific recording

from recap import Recorder, RecordingConfig

config = RecordingConfig(
    output="discord.mp4",
    window_title="Discord",
)
recorder = Recorder(config)
recorder.start()
# captures the Discord window's video (and per-app audio on Windows)
recorder.stop()
recorder.wait()

License

MIT

Metadata

Release files for recap-capture 0.6.3

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

Source distribution (sdist)

Source distribution for recap-capture 0.6.3
File Size Uploaded Provenance Actions
recap_capture-0.6.3.tar.gz 48.5 kB With provenance Details for recap_capture-0.6.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for recap-capture 0.6.3
File Interpreter ABI Platform Actions
recap_capture-0.6.3-py3-none-any.whl Python 3 none any Details for recap_capture-0.6.3-py3-none-any.whl

Total release size: 103.7 kB

Release files / recap_capture-0.6.3.tar.gz

Download URL recap_capture-0.6.3.tar.gz
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ee5ec58bbe940168b10291cff4ae9a9f9bfe9a6be68f0bd3aae2eaf163708138
BLAKE2b-256 checksum
How to use checksums
5068f04d8f201defdfc2bac866c8a65de24dc545a5df0d75173e1486ecc269e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 5, 2026.

Transparency log

Release files / recap_capture-0.6.3-py3-none-any.whl

Download URL recap_capture-0.6.3-py3-none-any.whl
Size 55.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e114b712afd318ee9c22755cb8d2476982117059a2fdf298b290cb56b7e33fa4
BLAKE2b-256 checksum
How to use checksums
6a17c1cf8d6d73bbc107b869a4acc490bceb07d28fc23c0b5ebf26f8e22020f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 5, 2026.

Transparency log

Security for recap-capture 0.6.3

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for recap_capture-0.6.3.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 Jul 5, 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.

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