使用motion进行摄像头监视

使用motion进行摄像头监视(树莓派)

安装

  • 系统更新sudo apt-get update
  • 安装Vimsudo apt-get install vim
  • 终端输入sudo apt-get install motion

配置motion

  • sudo vim /etc/default/motion

修改内容


# set to 'yes' to enable the motion daemon
start_motion_daemon=no

## 修改为start_motion_daemon=yes

  • sudo vim /etc/motion/motion.conf

tips:

可以通过vim的字符串匹配功能,快速定位到该项。

  • 命令状态下
  • /字符串 回车
  • 使用 n 进行下一个


# Start in daemon (background) mode and release terminal (default: off)
daemon off

#修改为:daemon on


############################################################
# Live Stream Server
############################################################

# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 8081

#修改为 8081 #这是端口


# Restrict stream connections to localhost only (default: on)
stream_localhost on

# 修改为 stream_localhost off



############################################################
# HTTP Based Control
############################################################

# TCP/IP port for the http server to listen on (default: 0 = disabled)
webcontrol_port 8080 

# Restrict control connections to localhost only (default: on)
webcontrol_localhost on
##这里修改为 webcontrol_localhost off

# Output for http server, select off to choose raw text plain (default: on)
webcontrol_html_output on


# Image width (pixels). Valid range: Camera dependent, default: 320
width 320
## 这里的320可以修改为摄像头的分辨率 长


# Image height (pixels). Valid range: Camera dependent, default: 240
height 240
## 这里的240可以修改为摄像头的分辨率 宽


# Maximum number of frames to be captured per second.
# Valid range: 2-100. Default: 100 (almost no limit).
framerate 2

然后使用命令sudo motion启动该软件

之后就可以在局域网内,通过ip+端口的方式访问你的监控了。如网站输入192.168.0.111:8081回车进行查看

想要退出的话sudo service motion stop


如果想查看自己摄像头的状况,树莓派系统下面安装luvcview

使用命令sudo apt install luvcview

安装完成之后,使用命令查看

luvcview -d /dev/video* -L

posted @   野生的Lemon柠檬  阅读(635)  评论(2编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】

Lemon's blogs

点击右上角即可分享
微信分享提示