Quantcast
Viewing all articles
Browse latest Browse all 5376

Python • Issues with code from Raspberry Camera Guide 2nd edition

Hello,

I am attempting to run the following code on an RPiZ 2W loaded with a new image of RPI OS Bookworm Lite

the code is as follows:-

Code:

import timefrom picamera2 import Picamera2, Previewcam = Picamera2()preview_config = cam.create_preview_configuration()cam.configure(preview_config)cam.start_preview(Preview.QTGL)cam.start()time.sleep(5)cam.stop()cam.stop_preview()
When I run this I get the following error as captured in the screenshot below:-
Image may be NSFW.
Clik here to view.
Python code and error.png
The code is presented in the subject book on page 90 with an accompanying explanation

What should happen is another screen preview image is opened for 5 secs allowing you to briefly view the camera image being recorded

Can anyone help and point me in the correct direction to resolve, please?

Thanks
JohnW

Statistics: Posted by ejwjohn — Sat Dec 21, 2024 2:11 pm



Viewing all articles
Browse latest Browse all 5376

Trending Articles