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

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.
how would you do this for the picamera2.start() command?
this does not work...

Code:

job = picam2.start()try:   job.get_result(timeout=1.0) except TimeoutError:    print("oh dear")

Statistics: Posted by nirb — Mon Jul 01, 2024 12:35 pm



Viewing all articles
Browse latest Browse all 4104

Trending Articles