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
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')
break #if you break out of the loop, stop capturing
capt.kill_screencap()
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.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bffc92a9e40aa5370f61e73e8144ad7fee5cd46d1009925e8bf56e81fcbc25f0 |
|
MD5 | 66e22af8199b63927b04768d6094bd86 |
|
BLAKE2b-256 | 3f7c54ea76bfb8d46f0ae0fa00830d83a42d4a713c33ff23cb2599935e4a3650 |
Close
Hashes for window_capture_streaming-0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b3e8b874110192379844e58e30f25bad913c6dd3177d5d2357c71786c57e2e2 |
|
MD5 | 65844c9079909cca0df127dd8fa03b26 |
|
BLAKE2b-256 | ca1719f01082b8417cd8c163f1ac334ebe87e0797550dd93ec4a2b60167885d7 |