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.2.1-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 464e212a462f66b776ba8d50d0f2f382cc3d9d87b5ad02cd7f51ddc32b3dc681 |
|
MD5 | b606d6567010e9e3ec6f29005f2360a7 |
|
BLAKE2b-256 | 227e20cf975fb0bba921bb196881cf5142529927575c06ab0429a52ee627a3ce |
Hashes for zbl-0.2.1-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1022b9ec9c4d90bcdc059f316b2af5578150e90c6ed462b87a5e0ce751a96ff3 |
|
MD5 | b1f519b5288fb4d2dc5a2c3dda12a1c3 |
|
BLAKE2b-256 | dd69a8e66efde65b399d41b647fe9480d6a78b3865e4d4a14cb471f495b3fe81 |
Hashes for zbl-0.2.1-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec02b0f7fd66b608256940f25b623a6449c87482140b47678f4ab65f71f29747 |
|
MD5 | 593c6c8cf49396c8e8357b2b6c3800ae |
|
BLAKE2b-256 | 36fdc5f060f823d0f9245bd752428053a0c276ac30d0a9adb9711d0353b40918 |
Hashes for zbl-0.2.1-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e47bef632c7ccfe48f0a460ec08ccacc357af3a39cf516aeb4b7ee564bdc89ef |
|
MD5 | 0ec0fa73f9fe952dd547bf9b3d7abf0a |
|
BLAKE2b-256 | 7a53907432acafb6622d10a523b91853c16dde5add1be2f5c5a7406e4c7bc49c |
Hashes for zbl-0.2.1-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6f5611891446e399adac846b246f3606e61a46fc9dd271c7699fe15cdeb3fa6 |
|
MD5 | 3002be0a6ea5207bd121a998a26abe2b |
|
BLAKE2b-256 | 475975256f27fedadce7abadc904af27c2dd138392d3758a33f4eeeb1edcb033 |
Hashes for zbl-0.2.1-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbc2cb5adfc3b3adb8052e845fd372e8bb8e9ca32050c3703ddf07731566f28e |
|
MD5 | e93e687081fa9878248bd2224ea6b3ec |
|
BLAKE2b-256 | 5ec1a5dbcbb7f49df46255542494a4d509ca61d0467817b732a6ee267044de24 |