前 4 天分别介绍了 ESP32-CAM 和 USB 摄像头接入 HomeAssistant 的方式,手里还有一个树莓派官方摄像头
因此继续分享给大家接入 HA 的方法
日期 | 标题 | 链接 |
---|---|---|
09-16 | 基于 ESP32-CAM 开发板烧录 CameraWebServer 项目 | https://cloud.tencent.com/developer/article/2329720 |
09-17 | 基于 ESP32-CAM 开发板烧录 tasmota32-webcam 固件 | https://cloud.tencent.com/developer/article/2329829 |
09-18 | USB 摄像头基于 motionEye 接入 HomeAssistant | https://cloud.tencent.com/developer/article/2330384 |
09-19 | USB 摄像头基于 WebRTC Camera 接入 HomeAssistant | https://cloud.tencent.com/developer/article/2331108 |
官网:https://www.raspberrypi.org/products/camera-module-v2
于 2016 年首发,用于替代第一代摄像头(2013 年首发),计划发售至至少 2028 年 1 月
更多信息参考文档:https://www.raspberrypi.com/documentation/accessories/camera.html#hardware-specification
自己使用的树莓派的操作系统是 32 位的,因为测试过在 64 位系统中无法使用,因此暂时不使用最新系统
在 raspi-config 中开启摄像头支持
选择 Yes
开启成功,重启后生效
pi@rpi-master:~ $ vcgencmd get_camera
supported=1 detected=1, libcamera interfaces=0
pi@rpi-master:~ $ v4l2-ctl --list-formats
这样就可以使用旧版的 raspistill & raspivid 命令行工具了,比如拍摄照片或录制视频
命令参考:https://www.raspberrypi.com/documentation/computers/camera_software.html#raspicam-commands
pi@rpi-master:~ $ raspistill -o Desktop/image-230920.jpg
pi@rpi-master:~ $ raspistill -o Desktop/image-230920-small.jpg -w 640 -h 480
pi@rpi-master:~ $ raspivid -o Desktop/video-230920.h264
之前介绍 motionEye 的时候就有提到过它,今天直接来安装
参考官方文档:https://motion-project.github.io/
安装
sudo apt install motion
修改配置,640*480 的分辨率还算比较流畅
sudo vim /etc/motion/motion.conf
daemon on
videodevice /dev/video0
width 640
height 480
framerate 60
ffmpeg_out_movies off
ffmpeg_video_codec flv
netcam_keepalive on
stream_maxrate 60
stream_localhost off
stream_auth_method 1
stream_authentication <rm>:<rm>
webcontrol_localhost off
webcontrol_authentication <rm>:<rm>
webcontrol_param 3
运行
sudo motion
访问 8080 端口即可管理
面板中插入网页卡片,填写 8081 端口的 url 即可
type: iframe
url: http://192.168.25.130:8081/
aspect_ratio: 50%
树莓派摄像头有着非常丰富的玩儿法,本次介绍的是基础的使用 Motion 管理的方法,还有更多有趣的使用方法等待去探索
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有