Skip to main content

real-time window capture library based on D3D11 and Windows.Graphics.Capture

Project description

zbl

PyPI version

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:

  1. Install opencv-python
  2. 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 GpuMats & full on-GPU processing

Credits

zbl is heavily inspired by screenshot-rs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

zbl-0.6.1-cp312-none-win_amd64.whl (179.2 kB view details)

Uploaded CPython 3.12 Windows x86-64

zbl-0.6.1-cp311-none-win_amd64.whl (180.1 kB view details)

Uploaded CPython 3.11 Windows x86-64

zbl-0.6.1-cp310-none-win_amd64.whl (181.9 kB view details)

Uploaded CPython 3.10 Windows x86-64

zbl-0.6.1-cp39-none-win_amd64.whl (182.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

zbl-0.6.1-cp38-none-win_amd64.whl (182.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

File details

Details for the file zbl-0.6.1-cp312-none-win_amd64.whl.

File metadata

  • Download URL: zbl-0.6.1-cp312-none-win_amd64.whl
  • Upload date:
  • Size: 179.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for zbl-0.6.1-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 326f5ec5429dfe7f04b5698ac7f266ec9b5609e9ee4e9d78559cdfc8453c0782
MD5 4a76c5470b854494b58843bce65c0465
BLAKE2b-256 ca9d3b097e0faeb03f0e6a63fbebfd36254c4c71f705261f024619a6cc232e7f

See more details on using hashes here.

File details

Details for the file zbl-0.6.1-cp311-none-win_amd64.whl.

File metadata

  • Download URL: zbl-0.6.1-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 180.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for zbl-0.6.1-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 9ddff416100a1a9ef539cd1252e5ac14fc9f71630d0902b5ab2ff556ecfb2042
MD5 1e688ea5f97c887748313fde4a3dc847
BLAKE2b-256 ca4badc1b26d8ada7cf44369d68f1a123a5ae0f24853e99b0ca6baeee0133021

See more details on using hashes here.

File details

Details for the file zbl-0.6.1-cp310-none-win_amd64.whl.

File metadata

  • Download URL: zbl-0.6.1-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 181.9 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for zbl-0.6.1-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 729b9392dd9ac235009413b86fe32e665e0bd4f0cf97094ffe2bebc8ebd0319a
MD5 c01aebeb64304f45e5291e465bdfa8b1
BLAKE2b-256 7587552fa2ecad2e8164e1b7cad3176e1936d2d17c83610b508bc86ac12d8312

See more details on using hashes here.

File details

Details for the file zbl-0.6.1-cp39-none-win_amd64.whl.

File metadata

  • Download URL: zbl-0.6.1-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 182.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for zbl-0.6.1-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 b4c5d0d60b2ed4e8d1174d681cbf9a561f8c1c82c22ea0020be3f723b63f0bcb
MD5 6c94229b5dbbe93b708bc13134e1237e
BLAKE2b-256 9d6e3601c521baa65bf33997698f1bd2016c8a3b773d5dc010706ba97a9021a3

See more details on using hashes here.

File details

Details for the file zbl-0.6.1-cp38-none-win_amd64.whl.

File metadata

  • Download URL: zbl-0.6.1-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 182.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for zbl-0.6.1-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 b4c9ef46d702eaa44739adc03714d672c13bd3b688416f9d4e21f2e3f5110d2a
MD5 100483d9d78697de8642af16c4f917e3
BLAKE2b-256 208ba0c1427f4b83bcbd7a710cca2840eeea5abe10db139641e4634aa9ea3a19

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page