raspberrypi / picamera2

New libcamera based python library
BSD 2-Clause "Simplified" License
894 stars 189 forks source link

[BUG]Program blocking due to camera disconnection #1065

Open HELLO-hyq opened 4 months ago

HELLO-hyq commented 4 months ago

When the line connecting to the camera is disconnected and picam2.stop() is performed, it blocks at this line of code, is there a more robust solution?

davidplowman commented 4 months ago

Just to clarify, can you confirm that you're running the latest Bookworm OS and that all your software is up to date. Then your test script looks something like this:

from picamera2 import Picamera2
picam2 = Picamera2()
picam2.start()
# Now unplug the camera
picam2.stop()

Thanks.