树莓派+motion安装摄像头实现远程监控

bd4f72371919fd32d4f6043a76867e19-0
下面我们介绍如何来给树莓派装个USB摄像头,然后远程访问摄像头拍摄的即时画面。
首先你需要一个树莓派能兼容的USB摄像头,笔者用的是罗技(Logitech)C270 高清网络摄像头,插上即可。软件方面非常简单只需要一个软件:motion。
假设你的树莓派已经装好了 Raspbian 的系统,你只需要:

sudo apt-get install motion

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

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

修改motion的配置文件:

sudo vim /etc/motion/motion.conf
#deamon off 改成 on
deamon on
#设置分辨率
width 800
height 600
#关闭 localhost 的限制
webcam_localhost off

然后运行 motion:

sudo motion

现在我们的摄像头已经变成了一台网络摄像头。在chrome浏览器下访问 http://[your.domain]:8081 即可看到摄像头当前拍摄的画面。

这是一篇发布于 8年 前的文章,其中的信息可能已经有所发展或是发生改变,请了解。


31 评论

    • 我确认了下,应该是有的。如果没有可以增加一行配置。相关的配置项还有

      # The mini-http8server listens to this port for requests (default: 0 = disabled)
      webcam_port 12341

      # Quality of the jpeg (in percent) images produced (default: 50)
      webcam_quality 75

      # Output frames at 1 fps when no motion is detected and increase to the
      # rate given by webcam_maxrate when motion is detected (default: off)
      webcam_motion off

      # Maximum framerate for webcam streams (default: 1)
      webcam_maxrate 8

      # Restrict webcam connections to localhost only (default: on)
      webcam_localhost off

  1. 是我端口打开错了,我开的8080,应该8081,但是我打开8081提示“192.168.10.105 拒绝了我们的连接请求”,我查看了我的树莓派在路由下的ip就是192.168.10.105,PC也在这个路由下,请求指点!

  2. 我的也是,同一个局域网下的笔记本进不去,但是能进入8080控制页面。在树莓派自己带的浏览器可以正常看到。用的是谷歌浏览器。错误是“拒绝了请求。”防火墙已经配置disable,但是还是不行。请问是什么原因?

    • 一开始我也跟你一样。做了两步操作解决。1 在树莓派配置中打开摄像机;2 将这个模块导入内核,命令“sudo modprobe bcm2835-v4l2”

1 Trackback / Pingback

  1. 树莓派+motion安装摄像头实现远程监控 | 扎西网

枫TI进行回复 取消回复

你的邮件地址不会公开


*