ra1nty/DXcam
A Python high-performance screen capture library for Windows using Desktop Duplication API - Updated 2026
What it solves
DXcam is a high-performance screen capture library for Windows that overcomes the latency and throughput limitations of standard Python screenshot tools. It specifically addresses the need for high-FPS, low-latency capture of the desktop and full-screen Direct3D applications, which is often a bottleneck for real-time AI agents and computer vision pipelines.
How it works
The library utilizes the Windows Desktop Duplication API (DXGI) and the Windows Graphics Capture (WinRT) backends to acquire frames directly from the GPU. It provides two modes of operation: one-shot snapshots (grab()) and a continuous capture thread that stores frames in an in-memory ring buffer for asynchronous consumption. To maintain performance, it supports zero-copy views of the buffer and optional color conversion via OpenCV or compiled Cython/NumPy kernels.
Who it’s for
This tool is designed for developers building AI agents, computer vision applications, or high-speed video recording software on Windows who require frame rates exceeding 60 FPS (up to 240+ FPS) with minimal CPU overhead.
Highlights
- Extreme Throughput: Capable of 240+ FPS at 1080p, significantly outperforming alternatives like python-mss.
- Lateny-Focused: Designed for low-latency pipelines and stable capture of full-screen exclusive Direct3D apps.
- Dual Backends: Supports both
dxgifor general use andwinrtfor cases where cursor rendering is required. - Flexible Output: Returns frames as NumPy arrays in various color modes (RGB, RGBA, BGR, BGRA, GRAY).
- Resource Efficient: Offers zero-copy views to avoid unnecessary memory allocation during high-speed capture.
Related
- Project
- Project
- Project
- Project