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

Python • Re: Camera _init_ sequence not complete

$
0
0
Hi, I'm not sure there's really enough code there for us to understand what's going on. The fact that your capture_video function starts with "self.camera.stop()" slightly implies to me that you've already acquired the camera object. Subsequently stopping the camera doesn't release it so that someone else can have it, which would make the subsequent "picam2 = Picamera2()" fail as you have described.

If you want to release a camera object you would need to do "picam2.close()", though it probably makes more sense to continue using your existing Picamera2 object if you have one.

Finally, I'd avoid using start_and_record_video. That will block until the recording is finished, which is almost certainly not what you want in a Qt application. You should probably call start_recording, or alternatively use start_encoder as shown in this example.

Worth checking out out section 8.5 of the manual if you haven't already done so.

Statistics: Posted by therealdavidp — Thu Mar 13, 2025 10:25 am



Viewing all articles
Browse latest Browse all 1225

Trending Articles