Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4151

Camera board • Re: grabbing warning given by the picamera2() commands

$
0
0
Hi, I wonder if this kind of idiom might help. Instead of "array = picam2.capture_array()" (which might wait forever) you could try:

Code:

job = picam2.capture_array(wait=False)# Either now, or at any later time, usetry:    array = job.get_result(timeout=1.0)  # can use 0.0 to poll without waitingexcept TimeoutError:    print("oh dear")
Note that if a "job" times out, it's still running in the camera thread, so you can poll it again later. There's no way currently to cancel jobs that are in progress.

Statistics: Posted by therealdavidp — Fri Jun 28, 2024 2:55 pm



Viewing all articles
Browse latest Browse all 4151

Trending Articles