raspberrypi / picamera2

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

[OTHER] #682

Open Raspihelp opened 1 year ago

Raspihelp commented 1 year ago

Hi Brand new RPi3 with fresh recommended install. Camera works with hello and test commands in terminal.

when trying to run this code:

from picamera2 import Picamera2

picam2 = Picamera2() config = picam2.create_video_configuration() picam2.configure(config) picam2.start()

I get this back and nothing happens

[0:05:19.105034346] [1741] INFO Camera camera_manager.cpp:299 libcamera v0.0.4+22-923f5d70 [0:05:19.219381491] [1743] INFO RPI raspberrypi.cpp:1476 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media3 and ISP device /dev/media1 [0:05:19.244800597] [1741] INFO Camera camera.cpp:1028 configuring streams: (0) 1280x720-XBGR8888 [0:05:19.245670478] [1743] INFO RPI raspberrypi.cpp:851 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1920x1080-SGBRG10_1X10 - Selected unicam format: 1920x1080-pGAA

Any ideas how to get it working?

tvoverbeek commented 1 year ago

Read the documentation. https://datasheets.raspberrypi.com/camera/picamera2-manual.pdf You need a preview running since its event loop drives the camera. See section 2 for the basics. To capture videos see section 7 in the manual.