raspberrypi / picamera2

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

[OTHER] Please improve/update Documentation #1064

Closed savejeff closed 3 months ago

savejeff commented 3 months ago

TLDR: Getting the camera V2 running on a Raspberry Pi 4 is more frustrating than it should be. Please Update old tutorials

Here is what happened to me: I got the Camera a while ago and today installed a blank image of Raspberry Pi OS 64bit. I Followed the official tutorial which is completely outdated. Not a single command in that tutorial still works. other tutorials like this also use old commands like raspi-still and picamera in python.

only be multiple web searches as wall as I had to go through this gits example folder to get something going. Also when using X-forwarding via SSH most of the commands crash. even with the capture_jpeg example, it crashes when using x-forwarding:


Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/picamera2/previews/qt_previews.py", line 36, in createpreview
    qpicamera2 = parent.make_picamera2_widget(cam, width=parent.width, height=parent.height,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picamera2/previews/qt_previews.py", line 141, in make_picamera2_widget
    return QGlPicamera2(picam2, width=self.width, height=self.height, transform=self.transform, preview_window=self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picamera2/previews/q_gl_picamera2.py", line 97, in __init__
    self.egl = EglState()
               ^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picamera2/previews/q_gl_picamera2.py", line 27, in __init__
    self.choose_config()
  File "/usr/lib/python3/dist-packages/picamera2/previews/q_gl_picamera2.py", line 45, in choose_config
    check_egl_extensions(self.display, ["EGL_EXT_image_dma_buf_import"])
  File "/usr/lib/python3/dist-packages/picamera2/previews/gl_helpers.py", line 71, in check_egl_extensions
    raise Exception(ext + " missing")
Exception: EGL_EXT_image_dma_buf_import missing

this is all solvable for me as an experienced embedded developer, but as Raspberry Pis and accompanying products are intended as educational products, this should be new-user-friendlier. while my described experience is pretty much realistic in terms of what you will experience as a software developer but it should be easier to get a first picture going

What I would expect:

This post might be off-topic here but it's the best place I found to post this. greetings

davidplowman commented 3 months ago

Hi, and thank you for raising this. The legacy camera system has been deprecated for a number of years now, however, as you've noted, getting documentation updated can be very difficult.

The first link you mention belongs to Raspberry Pi Foundation. Obviously we have a strong relationship with them so I can raise this with them and ask if them if they might be able to improve the situation. The other link is to a third party website. Unfortunately the web is just full of these, with outdated documentation, and we have no significant ability to get anything updated. You could try posting a message if you can, asking them to withdraw or update the page, but you will probably have no more success than we do.

Some pages that you should follow would include: https://www.raspberrypi.com/documentation/accessories/camera.html - about the camera hardware and connecting it https://www.raspberrypi.com/documentation/computers/camera_software.html - camera software and rpicam-apps https://datasheets.raspberrypi.com/camera/picamera2-manual.pdf - for Python users

The biggest take away is that, once you've connected your camera and installed the Raspberry Pi OS, you don't need to do anything special. The cameras should "just work".

savejeff commented 3 months ago

Thanks for the fast and fair response. I know how things are usually behind the scenes. I wanted to give a perspective from somebody on the outside. Raspi and the also the Camera stuff is such an important thing for the next generation of coders/developers. we should make it attractive for them to enter the field.

also thanks for the links. I've managed to get the images into OpenCV 👌

davidplowman commented 3 months ago

Just to add that the Raspberry Pi Foundation tutorial has now been updated. Thanks for pointing it out!