openwrt 挂载摄像头

http://bigwilly.blog.163.com/blog/static/173953547201191772222781/



openwrt 挂载摄像头

 

openwrt 挂载 UVC摄像头
opkg update

opkg install kmod-usb-ohci           #一般BCM用的是ohci USB控制器
#opkg install kmod-usb-uhci     
 #UHCI USB控制器
opkg install kmod-usb-video
opkg install kmod-video-gspca-core
opkg install kmod-video-core
opkg install kmod-video-uvc            #
免驱摄像头
opkg install kmod-video-gspca-zc3xx    #
中微星摄像头 zc301 zc303 zc305
opkg install kmod-i2c-core
opkg install kmod-input-core 
opkg install motion

摄像头用motion做监控非常棒!

画面上只要有变化,就会保存照片到置顶位置。太适合做监控了

我在三个路由实现了该监控,分别是mi424wr,db120,7231-4p.其中7231-4p是使用dd-wrt 其余两个使用openwrt-backfire.
首先在
http://downloads.openwrt.org/backfire/10.03   根据硬件平台下载安装motion及相关的ipk,
然后编辑vi /overlay/etc/motion.conf, 我的编辑文件内容如下
# Rename this distribution example file to motion.conf
#
# This config file was generated by motion "3.2.11.1"


############################################################
# Daemon
############################################################

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

# File to store the process ID, also called pid file. (default: not defined)
process_id_file /var/run/motion/motion.pid

############################################################
# Basic Setup Mode
############################################################

# Start in Setup-Mode, daemon disabled. (default: off)
setup_mode off

###########################################################
# Capture device options
############################################################

# Videodevice to be used for capturing   (default /dev/video0)
# for FreeBSD default is /dev/bktr0
videodevice /dev/video0

                                       
                                                                                 
# Image width (pixels). Valid range: Camera dependent, default: 352             
width 320                                                                         
                                                                                 
# Image height (pixels). Valid range: Camera dependent, default: 288             
height 240                                                   
               
                                                                                 
                                                                        
                                                                     
                                                                                    

# Motion Detection Settings:
############################################################

# Threshold for number of changed pixels in an image that
# triggers motion detection (default: 1500)
threshold 1500 这个是改变探测灵敏度,越小越灵敏
# Automatically tune the threshold down if possible (default: off)
threshold_tune off

# Noise threshold for the motion detection (default: 32)
noise_level 32

# Automatically tune the noise threshold (default: on)
noise_tune on







# Live Webcam Server
############################################################

# The mini-http server listens to this port for requests (default: 0 = disabled)
webcam_port 8081   #远程端口
# Quality of the jpeg images produced (default: 50)
webcam_quality 50

# 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 1

# Restrict webcam connections to localhost only (default: on)
webcam_localhost off #必须改成off才能通过pc访问

# Limits the number of images per connection (default: 0 = unlimited)
# Number can be defined by multiplying actual webcam rate by desired number of seconds
# Actual webcam rate is the smallest of the numbers framerate and webcam_maxrate
webcam_limit 0

target_dir /tmp/cam1       #保存目录

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

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

# Restrict control connections to localhost only (default: on)
control_localhost on

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

# Authentication for the http based control. Syntax username:password
# Default: not defined (Disabled)
; control_authentication username:password

##############################################################
# Thread config files - One for each camera.
# Except if only one camera - You only need this config file.
# If you have more than one camera you MUST define one thread
# config file for each camera in addition to this config file.
##############################################################

# Remember: If you have more than one camera you must have one
# thread file for each camera. E.g. 2 cameras requires 3 files:
# This motion.conf file AND thread1.conf and thread2.conf.
# Only put the options that are unique to each camera in the
# thread config files. 
thread /etc/thread1.conf
thread /etc/thread2.conf
# thread /etc/thread3.conf
# thread /etc/thread4.conf
   #如果有多个摄像头要把使用这部分,否则全部注释掉

因为字符限制,上面只是把需要修改的地方写上了
修改好后,/etc目录下 输入 motion -c motion.conf

这时候只要摄像头画面有变化,就出现采集图片到设置目录了.

windows下也可以使用palantir (在这里下载
http://www.fastpath.it/products/palantir/pub/pclient.exepc客户端 连接 192.168.1.1:8081就可以看到图片了,这个完全是一张张图片播放的 所以不连贯.

开机自启动

/etc/init.d/motion

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2010 OpenWrt.org
# Copyright (C) 2006 Carlos Sobrinho


START=80
STOP=50
start()
{
   motion&
}

stop()
{
killall motion
}

/etc/init.d/motion start     启动

/etc/init.d/motion enabel 是自启动

dmesg | grep uvcvideo
spcacat 
libpthread
libmjpg

opkg install usbutils 
lsusb
dmesg | grep usb

cat /dev/video0 > /tmp/1.jpg


Palantir 
motionMjpg-streamer

openwrt 挂载ZCXX摄像头

1、先修改opkg源为openwrt.cn 安装openwrt.cn中文网提供的kmod-usb-videokmod-video-gspca-core
opkg update
opkg install 
http://www.openwrt.org.cn/downloads/backfire/10.03/brcm63xx/packages/kmod-usb-video_2.6.32.10-1_brcm63xx.ipk
opkg install kmod-video-core
opkg install 
http://www.openwrt.org.cn/downloads/backfire/10.03/brcm63xx/packages/kmod-video-gspca-core_2.6.32.10-1_brcm63xx.ipk
opkg install 
http://downloads.x-wrt.org/xwrt/backfire/10.03/brcm63xx/packages/kmod-video-gspca-zc3xx_2.6.32.10-1_brcm63xx.ipk


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
OpenWrt系统中,挂载设备可以通过以下步骤进行操作。首先,将`insert_sd.sh`和`rc.local`文件放置在`/etc`文件夹中。编译后,这些文件会被放在`/etc`文件夹内。\[1\]接下来,可以使用`lsblk`命令来判断未挂载设备的文件系统格式,并使用`mount`命令来挂载设备并带上`filetype`参数。如果挂载时不带上`filetype`参数,系统会尝试不同的文件系统直到成功挂载,这可能会导致一些输出信息。为了解决在OpenWrt下中文文件名或内容乱码的问题,可以在挂载时加上`iocharset=utf8`参数。\[2\]这样可以确保中文文件名和内容能够正确显示。另外,还可以通过修改配置文件和源代码来进行更多的软件改动。\[3\] #### 引用[.reference_title] - *1* [openwrt 设置自动挂载SD卡](https://blog.csdn.net/x13163303344/article/details/72857344)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [openwrt下U盘自动挂载](https://blog.csdn.net/liangalei123/article/details/129295655)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值