Modern applications and games require efficient screen capture with support for:
- 3D graphics (DirectX, OpenGL)
- Protected content (DRM, Netflix)
- HDR content
- High frame rates
- Low latency
Traditional screen capture methods (GDI, PIL, PyAutoGUI) have significant limitations:
- Cannot capture 3D content (shows black screen)
- Do not work with protected content
- Have high latency
- No HDR support
- High CPU usage
Windows Graphics Capture (WGC) API provides a modern solution to these problems:
- Direct access to DirectX frame buffer
- Support for all content types
- Minimal latency
- Efficient GPU utilization
- Low CPU usage
The graph above shows the performance comparison between different capture methods:
- FPS (Frames Per Second)
- Frame capture time
- Frame delays
- Non-empty frame percentage
- High-performance screen capture
- Real-time frame processing
- Support for multiple monitors
- Low latency capture
- HDR content support
- Protected content support (e.g., Netflix)
- 3D applications and games support
- Full DirectX support
- OpenGL applications support
- Games capture support
- Hardware-accelerated video capture
- HDR content support
- Protected content support
- Best performance for 3D applications
- Basic DirectX support
- Limited OpenGL support
- No HDR support
- May have performance issues with 3D content
- No DirectX support
- No OpenGL support
- No HDR support
- May show black screen for 3D content
- Suitable for static content only
- No DirectX support
- No OpenGL support
- No HDR support
- May show black screen for 3D content
- Suitable for basic screen capture
- No DirectX support
- No OpenGL support
- No HDR support
- May show black screen for 3D content
- Suitable for static images
pip install wgc-captureBasic usage:
import wgc_capture
# Initialize capture
capture = wgc_capture.WGCCapture()
# Get frame
frame = capture.get_frame()Run the performance test:
python test_capture_comparison.pyThis will test different capture methods and generate a comparison report.
The test measures:
- FPS (Frames Per Second)
- Frame capture time
- Frame delays
- Non-empty frame percentage
- Memory usage
- Windows 10 version 1803 or later
- Python 3.7 or later
- DirectX 11 compatible GPU
python setup.py build_ext --inplaceMIT License
Contributions are welcome! Please feel free to submit a Pull Request.
