2440 ARM开发板移植Motion网络监控系统

移植环境(红色粗字体字为修改后内容,蓝色粗体字为特别注意内容)
1,开发板:韦东山JZ2440
2,linux 版本:linux-3.4.2
3,系统版本:Ubuntu9.10
4,交叉编译环境:arm-linux-gcc-4.4.3
5,参考文献:
https://blog.csdn.net/kangear/article/details/8763790

Motion这个工具非常适合用来做一般的嵌入式移动监控,为什么呢?主要有以下几点:

1、依赖很少,编译过程一般不会出现什么问题。

2、兼容性好,基本原理就是单张jpg图片叠加显示,这在任何浏览器上都通用。不像其他视频流媒体,对客户端要求较高。
3、对摄像头要求不够,只需要一般的UVC摄像头,Kernel中编译了v4L2之后就能够正常工作。

Stpe1,将UVC摄像头插入USB,确保/dev/下面多一个video设备

lsusb
Bus 001 Device 003: ID 058f:0362

红字部分表示识别出了uvc摄像头。

Step2,到官网下载Motion3.2.11.1,注意版本不要弄错,http://sourceforge.net/projects/motion/files/motion%20-%203.2/

Step3,解压缩,编译过程如下:

./configure  --prefix=${PWD}/_install  --host=arm-linux --without-ffmpeg

make

make install

Step4,下载到板子,新建配置文件motion.conf,内容如下:

# Minimal motion example config file provided by the
# Debian motion package - for basic webcam operation.
#
# You most certainly want to investigate
# /usr/share/doc/motion/examples/motion-dist.conf.gz
# for further configuration options. Also, refer to the
# motion man page and /usr/share/doc/motion/motion_guide.html
# for detailed information on configuration options.

daemon off

quiet on

locate on

# You may very well need to change this (check with 'dmesg'
# after plugging in your webcam).

videodevice /dev/video0

# Image size in pixels (valid range is camera dependent).

width 320

height 240

framerate 25

quality 85

auto_brightness off

# General threshold level and noise threshold
# level (for distinguishing between noise and motion).

threshold_tune off

threshold 4500

noise_level 64

# Initial brightness, contrast, hue (NTSC), and saturation.
# 0 = disabled (valid range 0-255).

brightness 0

contrast 0

saturation 0

hue 0

# Encode movies in real-time (install ffmpeg before enabling).

ffmpeg_cap_new on

# Codec to be used by ffmpeg for the video compression.
# Supported formats: mpeg4, msmpeg4.

ffmpeg_video_codec msmpeg4

# Target base directory for pictures and films (you may need
# to change this (or change its permissions) depending on
# which system user runs motion).

target_dir /root/motion/snapshots

# Define a port number (e.g. 8000) to enable the mini-http server.

# 0 = disabled.

webcam_port 8081

# Set to 'off' to allow anybody (not just localhost) to view the
# webcam via the mini-http server (http://hostname:port).
webcam_localhost off
snapshot_interval 1
snapshot_filename snapshot
webcam_quality 50
webcam_maxrate 8
#on_event_start /root/motion/on_motion_detected
#on_event_end /root/motion/on_motion_end
gap 10

Step5,运行,./motion -c motion.conf,然后浏览器输入http://192.168.137.9:8081/就能够看到视频监控。


注意,配置文件中,如果指定的videodevice设备不正确,可能会显示彩条

2440 ARM开发板移植Motion网络监控系统_第1张图片

你可能感兴趣的:(2440 ARM开发板移植Motion网络监控系统)