树莓派5 picamera2调用摄像头RuntimeError: Control type not implemented

Python3.10

Python3.10

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

 树莓派5系统预装的python环境picamera2模块调用摄像头没问题,但是这个环境限制众多,且容易把系统搞崩了,因此一般需要另装一套生产环境,但安装的picamera2调用摄像头失败。

[11:15:07.390792421] [102199]  INFO Camera camera_manager.cpp:325 libcamera v0.3.2+99-1230f78d
[11:15:07.398118914] [102205]  INFO RPI pisp.cpp:695 libpisp version v1.0.7 28196ed6edcf 29-08-2024 (16:33:32)
[11:15:07.407173992] [102205]  INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@80000/ov5647@36 to CFE device /dev/media0 and ISP device /dev/media2 using PiSP variant BCM2712_C0
[11:15:07.410065212] [102199]  INFO Camera camera.cpp:1197 configuring streams: (0) 1920x1080-RGB888 (1) 2592x1944-SGBRG16
[11:15:07.410165367] [102205]  INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov5647@36 - Selected sensor format: 2592x1944-SGBRG10_1X10 - Selected CFE format: 2592x1944-GB16
Traceback (most recent call last):
  File "/home/fire0517/opencv_projects/pc2.py", line 12, in <module>
    camera.start()
  File "/usr/local/python311/lib/python3.11/site-packages/picamera2/picamera2.py", line 1186, in start
    self.start_()
  File "/usr/local/python311/lib/python3.11/site-packages/picamera2/picamera2.py", line 1154, in start_
    self.camera.start(controls)
RuntimeError: Control type not implemented

 原因是缺少rpi-libcamera,直接pip安装发现meson编译报错,既然预装环境的可用那就直接sudo复制过来用

~ $ python311 -m pip install rpi-libcamera
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://www.piwheels.org/simple
Collecting rpi-libcamera
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/46/bd/18876345dffac79613440e6547c8d7fa62f6ae8359d27447f089ce131f7d/rpi_libcamera-0.1a7.tar.gz (5.1 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      + meson setup /tmp/pip-install-z5m_3wam/rpi-libcamera_9a021f0df65841bd9d97c2ae21723ca5 /tmp/pip-install-z5m_3wam/rpi-libcamera_9a021f0df65841bd9d97c2ae21723ca5/.mesonpy-dnf76qhr -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Drevision=v0.3.2+rpt20241119 -Drepository=https://github.com/raspberrypi/libcamera.git -Dversion=v0.3.2+99-1230f78d --native-file=/tmp/pip-install-z5m_3wam/rpi-libcamera_9a021f0df65841bd9d97c2ae21723ca5/.mesonpy-dnf76qhr/meson-python-native-file.ini
      The Meson build system
      Version: 1.6.1
      Source dir: /tmp/pip-install-z5m_3wam/rpi-libcamera_9a021f0df65841bd9d97c2ae21723ca5
      Build dir: /tmp/pip-install-z5m_3wam/rpi-libcamera_9a021f0df65841bd9d97c2ae21723ca5/.mesonpy-dnf76qhr
      Build type: native build
      Project name: pylibcamera
      Project version: 0.1.0
      C compiler for the host machine: cc (gcc 12.2.0 "cc (Debian 12.2.0-14) 12.2.0")
      C linker for the host machine: cc ld.bfd 2.40
      C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Debian 12.2.0-14) 12.2.0")
      C++ linker for the host machine: c++ ld.bfd 2.40
      Host machine cpu family: aarch64
      Host machine cpu: aarch64
      Message: Cloning from: https://github.com/raspberrypi/libcamera.git, revision v0.3.2+rpt20241119

      ../meson.build:19:0: ERROR: Command `/tmp/pip-install-z5m_3wam/rpi-libcamera_9a021f0df65841bd9d97c2ae21723ca5/clone-libcamera.sh https://github.com/raspberrypi/libcamera.git v0.3.2+rpt20241119 pypatch` failed with status 1.

      A full log can be found at /tmp/pip-install-z5m_3wam/rpi-libcamera_9a021f0df65841bd9d97c2ae21723ca5/.mesonpy-dnf76qhr/meson-logs/meson-log.txt
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

 问题参考:[BUG] After daily upgrade virtual picamera2 does not work · Issue #1171 · raspberrypi/picamera2 · GitHub

您可能感兴趣的与本文相关的镜像

Python3.10

Python3.10

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值