Grab screenshots from a specific window and process them right away (for bots or video streaming)
Project description
Grab screenshots from a specific window and process them right away
pip install window-capture-streaming
# If you get the following error during the installation
# ModuleNotFoundError: No module named 'win32.distutils.command'
# [end of output]
#
# note: This error originates from a subprocess, and is likely not a problem with pip.
# error: subprocess-exited-with-error
#
# Try this:
pip install window-capture-streaming --no-deps
pip install keyboard
pip install numpy
pip install opencv_python
pip install pandas
pip install a_cv2_easy_resize
pip install pywin32
from window_capture_streaming import WindowIterCapture
import re
import cv2
capt = WindowIterCapture(
hwnd=None,
window_text=re.compile(r".*bluestacks.*", flags=re.IGNORECASE),
show_capture_keys="ctrl+alt+z", # starts cv2.imshow() - can be enabled/disabled by pressing ctrl+alt+z
show_fps_keys="ctrl+alt+f", # show the fps rate - can be enabled/disabled by pressing ctrl+alt+f
kill_screencap_keys="ctrl+alt+x", # kills the capture process
)
for screen_shot in capt.get_screenshot(
sleeptime=None,
resize_width=None,
resize_height=None,
resize_percent=None,
interpolation=cv2.INTER_AREA,
):
pass
# print('do some stuff here')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for window_capture_streaming-0.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb76ba014a26cf9efe2a40b1f63fe46f5377e11634dcd7ad39d8f74cffaa828d |
|
MD5 | 5d45feea2d92a6a401d952cf1da62421 |
|
BLAKE2b-256 | e881b0cab23aa01e25088894f55e6ebd6055abfeb98c4b3c799b5dbe213604ee |
Close
Hashes for window_capture_streaming-0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4920cca09ba46f6e0d4f05b38c2e4bae877fc45b711cc24f0676c3b86df4905c |
|
MD5 | 5efa5243068ed3089881ef9c2dce1796 |
|
BLAKE2b-256 | 14aa17190f63a79f50f352e3db5d27cd6af7b29e022bcfe989c67de06f8d7503 |