Motion is a program that monitors the video signal from one or more cameras and is able to detect if a significant part of the picture has changed.

The program is written in C and is made for the Linux operating system, (using the video4linux interface). Motion is a command line based tool whose output can be either jpeg, ppm fies or mpeg video sequences. Motion is strictly command line driven and can run as a daemon with a rather small footprint and do.

Motion is the perfect tool for keeping an eye on your property, keeping only those images that are interesting.

installation on ubuntu

sudo apt-get install motion

使用Motion利用USB摄像头录制视频

1.在用户目录下(~)创建.motion文件夹,将/etc/motion下的motion.conf复制到~/.motion下,并获得其修改权限。Motion读取配置文件的优先级是~/.motion/motion.conf;/etc/motion/motion.conf。监视多个摄像头则读取thread1.conf;thread2.conf,以此类推。

2.修改~/.motion/motion.conf文件,近涉及视频录制部分

# Image width (pixels). Valid range: Camera dependent, default: 352 %画面宽度
width 1280

# Image height (pixels). Valid range: Camera dependent, default: 288 %画面高度
height 720

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

# Output 'normal' pictures when motion is detected (default: on) %关闭图片输出
# Valid values: on, off, first, best, center
# When set to 'first', only the first picture of an event is saved.
# Picture with most motion of an event is saved when set to 'best'.
# Picture with motion nearest center of picture is saved when set to 'center'.
# Can be used as preview shot for the corresponding movie.
output_normal off

# Codec to used by ffmpeg for the video compression. %视频编码
# Timelapse mpegs are always made in mpeg1 format independent from this option.
# Supported formats are: mpeg1 (ffmpeg-0.4.8 only), mpeg4 (default), and msmpeg4.
# mpeg1 - gives you files with extension .mpg
# mpeg4 or msmpeg4 - gives you files with extension .avi
# msmpeg4 is recommended for use with Windows Media Player because
# it requires no installation of codec on the Windows client.
# swf - gives you a flash film with extension .swf
# flv - gives you a flash video with extension .flv
# ffv1 - FF video codec 1 for Lossless Encoding ( experimental )
# mov - QuickTime ( testing )
ffmpeg_video_codec mpeg4

# Target base directory for pictures and films %输出文件夹
# Recommended to use absolute path. (Default: current working directory)
target_dir /tmp/motion

3.motion命令启动视频录制

4.Ctrl+c退出视频录制

website

http://sourceforge.net/projects/motion/http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHomehttp://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide

ref

http://blog.csdn.net/shulianghe/article/details/8230352

ERROR: V4L2_CID_PRIVATE_BASE undeclared

gcc -g -O2 -D_REENTRANT -DMOTION_V4L2 -DMOTION_V4L2_OLD -DTYPE_32BIT="int" -DHAVE_BSWAP   -march=i686 -Wall -DVERSION=\"3.2.11\" -Dsysconfdir=\"/usr/local/etc\"    -c -o track.o track.c
track.c: In function ‘uvc_center’:
track.c::: error: storage size of ‘control_s’ isn’t known
track.c::: error: ‘V4L2_CID_PRIVATE_BASE’ undeclared (first use in this function)
track.c::: note: each undeclared identifier is reported only once for each function it appears in
track.c::: error: ‘VIDIOC_S_CTRL’ undeclared (first use in this function)
track.c::: error: storage size of ‘queryctrl’ isn’t known
track.c::: error: ‘VIDIOC_QUERYCTRL’ undeclared (first use in this function)
track.c::: warning: unused variable ‘queryctrl’ [-Wunused-variable]
track.c::: warning: unused variable ‘control_s’ [-Wunused-variable]
track.c::: error: storage size of ‘control_s’ isn’t known
track.c::: warning: unused variable ‘control_s’ [-Wunused-variable]
track.c: In function ‘uvc_move’:
track.c::: error: storage size of ‘control_s’ isn’t known
track.c::: error: ‘V4L2_CID_PRIVATE_BASE’ undeclared (first use in this function)
track.c::: error: ‘VIDIOC_S_CTRL’ undeclared (first use in this function)
track.c::: warning: unused variable ‘control_s’ [-Wunused-variable]
track.c::: error: storage size of ‘control_s’ isn’t known
track.c::: warning: unused variable ‘control_s’ [-Wunused-variable]

inserted "*#include <linux/videodev2.h>*" into track.h on line 13, just after the alg.h include

ref: http://sourceforge.net/mailarchive/forum.php?thread_name=50133364.7050501%40depowell.com&forum_name=motion-user

Motion on Ubuntu的更多相关文章

  1. ubuntu下编译ffmpeg+SDL+ffplay提取motion vector

    编译ffmpeg: 第一步: 从官网http://ffmpeg.org/下载最新版本. 解压tar -xjvf ffmpeg-3.3.1.tar.bz2 进入目录cd ffmpeg-3.3.1 第二步 ...

  2. Raspberry Pi + 3个USB摄像头 + Motion(简易监控设备配置记录1——介绍以及安装) 分类: Raspberry Pi 服务器搭建 2015-04-12 19:21 226人阅读 评论(0) 收藏

    参考: Debian官网链接 Motion官网链接 首先,参见Debian官网链接对Motion的介绍,网页中包含了所有相关依赖包,请首先确保这些依赖包的安装. Motion介绍 摘出对Motion的 ...

  3. Opencv on Ubuntu (from Ubuntu)

     OpenCV Introduction Contents Introduction Installation Step 1 Step 2 Running OpenCV Python in C I ...

  4. 在ubuntu 上创建 ssl 证书

    soap webservice 调试工具: soap UI, 可以下载下来玩一玩. Introduction TLS, or transport layer security, and its pre ...

  5. motion的移植和使用

    说明: motion主页:http://www.lavrsen.dk/foswiki/bin/view/Motion motion下载地址:http://sourceforge.net/project ...

  6. DIY远程移动图像监测(tiny6410+USB摄像头+motion+yeelink+curl)

    看到有博客上采用motion搭建移动图像监测系统,感觉很强大,但大多缺少远程监测能力,大多局限于局域网.OK,笔者手头刚好有一个30W像素的USB摄像头,那么借用yeelink服务,也来DIY一把,哈 ...

  7. Ubuntu与ROS的Docker桌面系统与ROS在线练习课程(在线Linux虚拟机)

    ROS在线练习课程正在逐步完善中,目前以ROS官网中文资料制作,可参考: https://www.shiyanlou.com/courses/854  邀请码 U23ERF8H 安装Ubuntu+RO ...

  8. 【OK210试用体验】进阶篇(1)视频图像采集之MJPG-streamer编译(Ubuntu系统下)

    转自: http://bbs.elecfans.com/jishu_510084_1_1.html 本篇主要内容分为: 嵌入式视频图像开源库     mjpg-streamer简介     mjpg- ...

  9. ubuntu系统---ubuntu16.04 + virtualenv + py2.7 + tf1.5.0 + keras2.2.4 + opencv2.4.9 +Numpy1.14

    ubuntu16.04 + virtualenv + py2.7 + tf1.5.0 + keras2.2.4 + opencv2.4.9 +Numpy1.14 @https://www.liaoxu ...

随机推荐

  1. MySQL 테이블 타입(Heap, MyIsam, InnoDB...) 변경하기

    alter table 을 이용해서 기존의 생성된 테이블의 타입(Heap, MyIsam, InnoDB...)을 변경하는 명령어 입니다. 잠시 까먹은 분은 계실지 몰라도 원래 모르는 ...

  2. Spring MVC中如何指定某个类或方法自适配地响应某个HTTP请求?

    方法已经找到,即调用AbstractHandlerMethodAdapter.handle() public final ModelAndView handle(HttpServletRequest  ...

  3. $(document).ready() 、 $('#id').load() 、window.onload 的区别

    今天做项目的时候遇到一个问题,结果死在了$(document).ready(). $('#id').load() .window.onload的区别上.然后,就整理一下,这三者的区别. 参考文章:ht ...

  4. 对 ASP.NET 页面进行跟踪(Control Tree)

    在页面头部加入属性 : Trace="True" 参考MSDN: https://msdn.microsoft.com/zh-cn/library/94c55d08(v=vs.10 ...

  5. [翻译]AOP编程

    翻译文章链接http://www.codeproject.com/Articles/1080517/Aspect-Oriented-Programming-using-Interceptors-wit ...

  6. debian 学习记录-5

    后裔排名 1 Debian - 1292 Fedora - 633 Knoppix - 50 (Knoppix本身是Debian后裔) Debian4 SuSE - 28 Debian,由Ian Mu ...

  7. 算法之合并排序(mergeSort)

    合并排序算法在结构上是递归的,采用分治策略:就是将原有的问题划分为 n 个规模较小但结构与原问题相似的子问题,递归地解决这些子问题,然后合并其结果,就得到原问题的解. 合并排序的模式一般如下: 1.分 ...

  8. VB winform自动更新 笔记

    看网上各种自动更新方法,最后自己找了个比较简单的,在此做个笔记. 服务器上的共享盘里存放生成的可执行文件和XML格式的配置: <?xml version="1.0" enco ...

  9. sprintf函数php的详细使用方法

    PHP sprintf() 函数 先说下为什么要写这个函数的前言,这个是我在微信二次开发的一个token验证文档也就是示例文档看到的一个函数,当时非常不理解,于是查了百度,但是很多结果都很笼统,结果也 ...

  10. 即时Web通信总结

    即时Web通信在一些对数据实时性要求特别严格的应用中十分重要,如监控系统.报价系统.股票交易系统和即时在线聊天应用等,由于http协议设计当初是为了服务器端响应客户端的请求而设计的,只能在客户端主动发 ...