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.4.0-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f439b767f03269f8322af7883e99102897a2e2b8eee05a65437233ea02857c9 |
|
MD5 | 8d9ebeac0a0e0dd1f706cda7313fd117 |
|
BLAKE2b-256 | c17eddae42c9cc63f2dc050aad79826b4d9bd19ba99c34be24326aa6bf4d44e5 |
Hashes for zbl-0.4.0-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29673e7f7292739410210df86ba96e2c69c4a63d7b0158bbbfc2c7f3bcfe409f |
|
MD5 | 34af18862ebbac9c4b692fab6ecf1e74 |
|
BLAKE2b-256 | f4ed90ba6b42c934169bb423f276c42881ecb9130c78139ebd965761e31e610e |
Hashes for zbl-0.4.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37c09ae76eb986b20efc80e4693a5c2f998dfa5a2ca92cfd650f4eb2a74c89f9 |
|
MD5 | 94046dc986d5b222a1bb777a444e9a18 |
|
BLAKE2b-256 | 488ee829f4243683e7a95b3431a0d8ecec48436e3604f37de3ed4a99528bde1a |
Hashes for zbl-0.4.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6974104660d40061d8bd53d39ecb9bf4ad6976983466132b198873289c0c1321 |
|
MD5 | 2d417836985c88f173bc567e4a3bf5b5 |
|
BLAKE2b-256 | a8f8aaad7d75df30c6b7522d98a65b3d0bb2837ce694c2ce55c07ce27ea76ef3 |
Hashes for zbl-0.4.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b75dc81aab0f76b28170c13432298edc4976eedc1fa0cc32580160fe52c25ae0 |
|
MD5 | 05b9ac21bf0d50e6fbe9dbd79be42fe4 |
|
BLAKE2b-256 | a690d7d811f507fac481a5a0534fa80c5d5ac22828ac21a8f8af666529a56377 |
Hashes for zbl-0.4.0-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ae13857fec289748ed87fe5ce15d82e04f478d05d0813139b4104d2fa3cd932 |
|
MD5 | 41af3560611f581c692c62e63b1b62b7 |
|
BLAKE2b-256 | 909543f3936bdd1fe2f43fa7479cc1a9234c3da05b4dab3411204fe3fe8a3dc4 |