登录
  • 欢迎来访
  • 你好

树莓派 视频监控

各种搞 无奈 1538次浏览 0个评论

前沿

先要看安装的系统是完整版 还是精简版

精简版的话需要更新firmware

1.首先更新firmware:
rpi-update是老外开发的一个更新树莓派firmware的工具,很方便也很好用,推荐给大家!
  红色部分是需要输入的:
  $ sudo apt-get update
  $ sudo apt-get install ca-certificates
  $ sudo apt-get install git-core
  $ sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update
  $ sudo chmod +x /usr/bin/rpi-update
  $ sudo rpi-update
  Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
  Performing self-update
  Autodetecting memory split
  Using ARM/GPU memory split of 192MB/64MB
  We're running for the first time
  Setting up firmware (this will take a few minutes)
  Using SoftFP libraries
  /opt/vc/sbin/vcfiled: error while loading shared libraries:libvchiq_arm.so: cannot open shared object file: No such file or directory
  If no errors appeared, your firmware was successfully setup
  A reboot is needed to activate the new firmware
  $ sudo ldconfig
  $ sudo rpi-update
  Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
  Performing self-update
  Autodetecting memory split
  Using ARM/GPU memory split of 192MB/64MB
  Updating firmware (this will take a few minutes)
  Your firmware is already up to date
  $ sudo reboot
备注:

貌似这种方法不能用了

09-18版本以后的官方镜像都集成了rpi-update工具,直接执行“sudo rpi-update”就行了,不需要再安装了
参考博客

完整版的就好弄了

1. 更新系统和软件 sudo apt-get update sudo apt-get upgrade
2. 更新固件(firmware) sudo rpi-update

检测摄像头

3. 插上usb摄像头,输入ls /dev, 查看dev中是否存在一个video0这个设备,如果有了说明系统识别了,如果没有,重复上一步确保firmware最新,还不行就是驱动问题,换摄像头吧

安装motion

4 安装强大的网络监控软件motion,输入
sudo apt-get install motion (如果安装不了的,可以先sudo apt-get update 一下)

5 然后打开 motion daemon 守护进程,让他可以一直在后台运行:

sudo nano /etc/default/motion
#no修改成yes:
start_motion_daemon=yes

6 配置motion,编辑motion.conf文件
sudo nano /etc/motion/motion.conf (或者运行sudo xedit /etc/motion/motion.conf)

7.找到”control_localhost on “和”webcam_localhost on“这两行,改为以下两行变on 为off后,保存退出 (可用Ctrl+w 搜寻 )
control_localhost off
webcam_localhost off

#deamon off 改成 on
deamon on
#设置分辨率 width 800height 600
#关闭 localhost 的限制
webcam_localhost off

启动配置

(1)输入下面命令启动服务:

sudo service motion start
1
(2)输入以下命令开启motion:

sudo motion

查看效果

在pc上用谷歌浏览器打开,192.168.1.110是我的树莓派ip,换成你们自己的
配置网页:http://192.168.1.110:8080

监控网页:http://192.168.1.110:8081

需要注意的问题

1.浏览器的问题
经过测试,Google浏览器和火狐浏览器可以访问到图像,IE、Microsoft Edge和360都不显示图像,而是提示下载,一直下载,其他的没有测试。

2.局域网限制
之前看到别人的教程写的是外网也可以访问,实际上如果你没有配置你的树莓派成为服务器的话,你的树莓派的ip地址都是私有地址,外网无法访问,只能在局域网内部使用。

3.摄像头的问题
树莓派供电不足也会影响视频质量,一般来说笔记本USB口电流一般为500mA,所以如果需要视频清晰的话建议使用移动电源进行供电,或者使用有源USB hub。

参考文章树莓派usb摄像头网络监控
树莓派+motion实现局域网简单监控
树莓派上使用USB摄像头

卸载

sudo aptitude remove motion
使用该命令 可卸载配套文件


鸿鹄博客 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明树莓派 视频监控
喜欢 (0)
[aa@qq.com]
分享 (0)
无奈
关于作者:
一个爱探索 爱分享的boy
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址