raspistill指令找不到_raspiconfig找不到命令

raspistill指令找不到_raspiconfig找不到命令找回树莓派的 V4L2 摄像头驱动和 raspistill/vid 命令在 Raspberry Pi OS 2021-10-30 的版本更新中。之前的摄像头命令 raspistill 被移除,替代方案是 libcamera。这导致之前的一些基于 raspistill

找回树莓派的 V4L2 摄像头驱动和 raspistill/vid 命令
  raspistill指令找不到_raspiconfig找不到命令

  在 Raspberry Pi OS 2021-10-30 的版本更新中。之前的摄像头命令 raspistill 被移除,替代方案是 libcamera。

  这导致之前的一些基于 raspistill 命令的教程无法在新系统里奏效。根据官方的说明,64 位版本的 Raspberry Pi OS 只有 libcamera 而没有 raspistill。但 32 位版本的 Raspberry Pi OS 中,V4L2 驱动程序可以通过手动配置来加载。下面我们来介绍配置方法,让你的程序可以继续在新系统上使用 V4L2 驱动,并可以让 raspistill 命令重新工作。

  1、修改 /boot/config.txt

  sudo nano /boot/config.txt

  #注释掉原来的摄像头自动检测语句,并添加”start_x=1″和”gpu_mem=128″

  #camera_auto_detect=1

  gpu_mem=128

  start_x=1

  该操作会让树莓派重新加载老版本的 V4L2 驱动。

  2、修改 /etc/modules

  sudo nano /etc/modules

  #在最后面添加

  bcm2835-v4l2

  保存、重启树莓派之后再运行检测命令。

  vcgencmd get_camera

  #应该会返回

  supported=1 detected=1

  此时摄像头可通过ffplay、fswebcam等正常使用

  fswebcam /dev/video0 -r 640×480 ~/test.jpg

  #or

  ffplay -f v4l2 -framerate 60 -video_size hd720 /dev/video0

  3、编译安装 raspistill/vid 命令

  如果你希望继续使用 raspistill 和 raspivid 命令,按照下面的方法来编译安装。

  cd ~

  sudo apt install cmake

  mkdir bin

  git clone https://github.com/raspberrypi/userland

  cd userland

  https://shumeipai.nxez.com/2022/05/14/buildme

  cp build/bin/* ~/bin/

  并将 /home/pi/bin 加入 PATH

  PATH=$PATH:/home/pi/bin

  export PATH

  修改完记得执行行下面的命令,让上一步的修改生效

  source https://shumeipai.nxez.com/2022/05/14/.profile

  raspistill

  ”raspistill” Camera App (commit bab9bf8790cd)

  Runs camera for specific time, and take JPG capture at end if requested

  usage: raspistill [options]

  Image parameter commands

  -q, –quality : Set jpeg quality

  -r, –raw : Add raw bayer data to jpeg metadata

  -l, –latest : Link latest complete image to filename

  -t, –timeout : Time (in ms) before takes picture and shuts down (if not specified, set to 5s)

  -th, –thumb : Set thumbnail parameters (x:y:quality) or none

  -d, –demo : Run a demo mode (cycle through range of camera options, no capture)

  -e, –encoding : Encoding to use for output file (jpg, bmp, gif, png)

  -x, –exif : EXIF tag to apply to captures (format as ‘key=value’) or none

  -tl, –timelapse : Timelapse mode. Takes a picture every ms. %d == frame number (Try: -o img_%04d.jpg)

  -fp, –fullpreview : Run the preview using the still capture resolution (may reduce preview fps)

  -k, –keypress : Wait between captures for a ENTER, X then ENTER to exit

  -s, –signal : Wait between captures for a SIGUSR1 or SIGUSR2 from another process

  -g, –gl : Draw preview to texture instead of using video render component

  -gc, –glcapture : Capture the GL frame-buffer instead of the camera image

  # vcgencmd 树莓派专有命令用来对硬件做各种检测,如下检查摄像头信息

  vcgencmd get_camera

  # 返回0,说明没有检测到摄像头信息

  supported=0 detected=0

  树莓派默认将摄像头通信关闭,此时需要开启:

  # 运行命令行配置

  sudo raspi-config

  依次选择 “Interfacing Options” -> ” Camera”,确定后重启树莓派。

  此时再次执行以下命令,可以得到摄像头信息了!

  vcgencmd get_camera

  supported=1 detected=1

  树莓派自带 raspistill 可以用来进行摄像头拍照功能,如下命令:

  raspistill -v -o test.jpg

  raspistill -ifx pastel -hf -vf -o test.jpg

  10,209

2024最新激活全家桶教程,稳定运行到2099年,请移步至置顶文章:https://sigusoft.com/99576.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。 文章由激活谷谷主-小谷整理,转载请注明出处:https://sigusoft.com/97044.html

(0)
上一篇 2024年 5月 21日
下一篇 2024年 5月 21日

相关推荐

关注微信