real-time window capture library based on D3D11 and Windows.Graphics.Capture
Project description
zbl
zbl
is a Rust and Python library for screen/window capturing. It provides an interface
to Windows.Graphics.Capture
API with a focus on simplifying integrating computer vision applications for Windows Desktop apps.
This library is in early development stage. This means that it's only verified to work for a 'happy path' scenarios - beware of bugs!
Python
Installation
pip install zbl
Alternatively, you can install suitable wheel from releases page.
Usage
from zbl import Capture
with Capture(window_name='visual studio code') as cap:
frame = next(cap.frames())
print(frame.shape)
The snippet above will capture a window which title contains the string visual studio code
, take one frame (which is represented as a numpy
array) and print its shape.
See Capture
constructor for more options. It is possible to capture the entire screen using display_id
argument,
for example.
To run an example using OpenCV's highgui
:
- Install
opencv-python
- Run
python -m zbl --display-id 0
Rust
See examples. Note: if you are getting OpenCV build errors when building the example, check out how to build OpenCV rust bindings.
Comparison to mss
/ pyautogui
Both are very slow at the time of writing. mss
tops at 30-50 fps in a tight loop, pyautogui
is
even slower than that. zbl
is able to capture an order of magnitude faster (at 500-700 fps). This allows a lot more time for the actual processing.
Plans
- (in progress) Integration with
GpuMat
s & full on-GPU processing
Credits
zbl
is heavily inspired by screenshot-rs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for zbl-0.5.0-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8caafe15ce556fef330bc120516e7de9bdad3caf98cf1ce49986ad7067b887bd |
|
MD5 | 02d4eb4406426b1c3a43940bf10d3f91 |
|
BLAKE2b-256 | 6d3e7618d48d365dec91722d0e55bee25f37cd972df715ca080660d66e8198c3 |
Hashes for zbl-0.5.0-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a30f0efde2cb0ccb2d284e11d6e985b67c77fb638ca02e7a50b96efef77e6dee |
|
MD5 | d763c55a829ae1394c39d13ea15f8b0a |
|
BLAKE2b-256 | 7c7de9924cf5a31d45316031cd98a229a3cf748f97c9b12a57df6f50ce238f9e |
Hashes for zbl-0.5.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24302beafac942008b80eb4a5a957dc815ebfbdc2e4d599df40f9070c9e6dc65 |
|
MD5 | a30178b82e13da15ed59a35fbe9addbe |
|
BLAKE2b-256 | 5fa6e99e2782b8a75c65f6a5ca2708234607a57f76395fce9343101907cb6329 |
Hashes for zbl-0.5.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00689d330327505763e269fb1399449fdb1b45765b3c7c088ca65ca83670b40e |
|
MD5 | f1b277d84dedb555c8719143766b68e4 |
|
BLAKE2b-256 | 55a9ddd57f0f7718c0cfba1151ffcfe5228520112e98d6598e56db699de47735 |
Hashes for zbl-0.5.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff760f2d38d9392fd147938313e202757df11f694d7ddb0f497110e7aa7b15d8 |
|
MD5 | 2e0d64ad7d48a182c9d0459895410498 |
|
BLAKE2b-256 | 9dccb96ca70d181fa157b3b769a2c109bc2c5dd54399f8b22c823b51e4c1b1ce |
Hashes for zbl-0.5.0-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e6465a17b54704930834470887a3cb209ae5960ccc623410056ccbe0eb3c48c |
|
MD5 | 3d95d62757cef5caca94046473d15f44 |
|
BLAKE2b-256 | 88e9da27c203ff1008329b0cf0abbc063f54414c616eef08fd1a0d4eeabd61e4 |