【翻译】动态图像监测开源代码 motion 学习-----Motion Guide - Installation(motion的安装指南)

前端之家收集整理的这篇文章主要介绍了【翻译】动态图像监测开源代码 motion 学习-----Motion Guide - Installation(motion的安装指南)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


【翻译】动态图像监测开源代码 motion 学习-----Motion Guide - Installation(motion的安装指南)


说在前面:

我没有经历过专业的翻译培训,也没有丰富的翻译经验,之所以会对Motion这个开源项目的手册进行简单的意思解释,一是因为我要用Motion,二是我对它感兴趣,三是刚好再熟悉一下英语。只是作为以后应用的一个参考,肯定存在很多不足之处,因此,仅供参考!

motion源码地址http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome

原文地址点击打开链接

Motion Guide - Installation(motion的安装指南)

This topic consists of the following(子内容) subtopics:MotionOverview,KnownProblemsInstallOverviewPrepareInstallConfigureScriptMakeInstallUpgradingFromOlderVersionErrorLogging.


What is Motion?(motion简介)

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. Or in other words,it can detect motion.
The program is written in C and is made for the Linux operating system.

Motion is a command line based tool. It has absolutely no graphical user interface. Everything is setup either via the command line or via a set of configuration files (simple ASCII files that can be edited by any ASCII editor).

The output from motion can be(输出内容):

  • jpg files
  • ppm format files
  • mpeg video sequences

How do I get Motion and what does it cost?

(使用motion的权利和限制,如果作为爱好研究使用,是完全免费的,

如果做修改并有商业用途,则需要详细阅读GPL和许可。)

If you want to use Motion in a commercial product,if you want to distribute either modified or original versions of Motion - for free or for a fee,you should read the license carefully.

Which version to download and use?

Versions 3.2.X are the current version. There is at the moment no development branch. The versions 3.1.X ended at 3.1.20 and there will be no more 3.1.X releases. If you use use a version older than 3.2.X you are encouraged to update.

What features does Motion have?(motion的特性,由下面内容可知motion很强大)

See more description at theMotion Homepage.
  • Taking snapshots of movement
  • Watch multiple video devices at the same time(同时支持多个视频设备)
  • Watch multiple inputs on one capture card at the same time
  • Live streaming webcam (using multipart/x-mixed-replace)
  • Real time creation of mpeg movies using libraries from ffmpeg
  • Take automated snapshots on regular intervals
  • Take automated snapshots at irregular intervals using cron
  • Executing external program when detecting movement
  • Execute external program at the beginning of an event of several motion detections.
  • Execute external program at the end of an event of several motion detections.
  • Execute external program when a picture is saved.
  • Execute external program when a movie mpeg is created (opened)
  • Execite external program when a movie mpeg ends (closed)
  • Motion tracking
  • Feed events to an MysqL or Postgresql database.
  • Feed video back to a video4linux loopback for real time viewing
  • Web interface usingMotion Related Projectssuch asmotion.cgi,Kenneths Webcam Package,Kevins Webpage,X-Motionand many more.
  • User configurable and user defined on screen display.
  • Control via simple web interface.
  • Automatic noise and threshold control
  • Ability to control the pan/tilt of a Logitech Sphere (or Orbit) camera
  • Highly configurable display of text on images.
  • High configurable definition of path and file names of the stored images and films.

You can find more information and links at the

Supported Hardware(硬件支持)


Input devices: Here we are thinking about the cameras.

Motion supports video input from two kinds of sources.

Standard video4linux devices (e.g. /dev/video0). Motion has no drivers for cameras. Installing the camera itself is outside the scope of this document. But here are some nice links.



Known Problems(其他需要知道的问题)


See also theFrequently Asked QuestionsandBug Reportsfor known open bugs.
Camera picture dimensions must be multiple of 16Dimentions of camera image must have both height and width that are a multiple of 16. Thís is normally not a problem. All standard sizes like 640,480,352,320,288,240,...etc are multiples of 16. But if you intend to monitor a network camera which is saving jpeg images you may have to pay attention to the dimensions of the picture.

ffmpeg_filename has changed name to movie_filenameThe 3.2.5 release contains a motion_guide and man page in which it was forgotten to change ffmpeg_filename to movie_filename. Please note that the option that defines the filenames for mpeg movies is now called movie_filename. This change is made because we may soon implement alternatives to ffmpeg and then ffmpeg_filename will be a bad name. This is fixed in release 3.2.5.1.

error: `time_current_frame' undeclared (first use in this function)A bug in 3.2.5 and 3.2.5.1 where a bugfix related to snapshot feature has created a new bug when you compile Motion without ffmpeg libs installed. This is fixed in 3.2.6.


How do I install Motion?(motion的安装细节)


Motion is mainly distributed as source files that you must compile yourself. There is also an RPM made on Fedora Core 3. And Debian packages are available for selected versions.

The short overview of the steps to install Motion from sources.

  • Preparation: Motion uses a number of shared libraries that must be installed on your computer before you can build Motion. The needed shared libraries depends on the features you wish to use. Features network camera,ffmpeg,MysqL and Postgresql needs specific shared libraries installed. See preparation section for more information.

  • Downloadthe motion source files (distributed as tar'ed and compressed files). Place the file in a place of your own choice.
  • Untar and uncompressthe file to the place you want the program installed. Editor recommends placing the motion source file directory in /usr/local. If you do not have write access to the /usr/local directory (you are under the mercy of an ignorant system administrator with a severe case of paranoia) - you can install the program in a directory in your home directory. You will then need to read the next section about how to configure before you compile the program. Below is shown the exact commands using version 3.2.X installed in /usr/local as an example (replace /path/to with the actual placement of the tar.gz file).
    • cd /usr/local
      tar -xvzf /path/to/motion-3.2.X.tar.gz
      
    • You will now have created a directory called motion-3.2.X. You can rename it to motion (mv motion-3.1.X motion). I recommend creating a symbolic link to the current version. This way you can more easily experiment with different version simply by changing the link.
      ln -s motion-3.2.X motion
    • Now change to the new directory
      cd motion
    • Run configure. You can start with the defaults. If you need to modify the installation parameters you can read the next section.
      ./configure
    • Build the code
      make
    • Install the code,manual page,etc
      make install
    • In /etc/motion/etc you will find a file called motion-dist.conf. If it is the first time you install Motion - rename this file tomotion.confand edit as a minimum the settings:videodevice,input,norm,frequency,width,heightandtarget_dir. That should get you going.

  • Run the program. To enable more features you must modify the config file.
    • motion



    Preparation For Install(依赖哪些库文件


    Before you start you may need to install a number of shared libraries that Motion uses. If they are missing the feature will simply normally not be included. Most of these libraries can be found on the CDs of your distribution. A few will have to be downloaded from the Internet. Note that when you install software using pre-compiled binaries (Redhat type RPMs,Debian debs etc) you normally only get what is needed to run the programs themselves. In order to compile other programs from source that uses these pre-compiled libraries you also need to installed the development packages. These are normally called the same name as the package suffixed by -devel or -dev. These development packages contains the header files (xxx.h) that Motion needs to build with the shared libraries. If you build a library from sources you already have these header files. It is recommended to simply install the pre-compiled binary packages and their development brothers.

    Configure Script(脚本配置)


    Configure is script that you run to setup the build environment for the C-compiler. It generates the "Makefile" which the program "make" uses to compile and install the software.

    To run configure your current directory must be the motion directory. You type

    ./configure

    You can add the parameter./configure --helpto get help on the different switches.

    Make

    When you run make,all the C-source files are automatically compiled and linked. Just look out for error messages.

    Make uses a file called "Makefile" which is generated by the "configure" script you just ran. If you have special needs you can manually edit this file. Next time you run configure a new Makefile will be generated and your changes are lost.

    Attention!

    If you have runmakebefore,you should run amake cleanbefore runningagain. This cleans out all the object files that were generated the prevIoUs time you ran. If you do not runfirst before you rebuild Motion you may not get the additional feature included. For example: If you built Motion without ffmpeg support and then add it later - and rebuild Motion without runningfirst - the ffmpeg feature does not get compiled into the Motion binary.

    First time you build motion runmake install. If you need to build it again (to run with different configure options) run.

    Make Install(安装)


    simply copies all the nice files that were generated during the compilation/linking that make did.

    Makes the directories (if they do not already exist)(path shown are the defaults): /usr/local/bin,usr/local/man/man1,/usr/local/etc,/usr/local/share/doc/motion-3.2.X,and /usr/local/share/doc/examples/motion-3.2.X.

    Copies the following files from the base motion directory (assuming the default PREFIX /usr/local was used when running configure - otherwise adjust to the actuals you chose)
    • Executable binary "motion" to /usr/local/bin
    • Manual page "motion.1" to /usr/local/man/man1
    • Document files "CHANGELOG,COPYING,CREDITS,INSTALL,and README to /usr/local/share/doc/motion-3.2.X
    • Example configuration files "*.conf" to /usr/local/share/doc/examples/motion-3.2.X
    • Configuration file "motion-dist.conf" to /usr/local/etc
    Note that the any existing files are overwritten. The default config file motion-dist.conf is named like this so that you do not get your working motion.conf file overwritten when you upgrade Motion.


    Un-install(卸载)

    From the motion base installation directory you simply runmake uninstall

    And delete the base installation directory in /usr/local and any link pointing to it. If you have forgotten where you installed it or someone else did it for you,simply search for the files and directories starting with motion. If the filenames and the directories match the names described in the "Make Install" section of this document,you can safely delete them.


    Additional Make Options(make的其他选项)

    The make command can be run with several options.make,make installandmake uninstallhas already been described above.

    make clean
    deletes all the binary files (object files) and the motion binary generated by make. It also deletes temporary files and any jpg files that motion has saved in the motion source directory. It is very important to always runmake cleanbefore you runmakeif you change the configuration (like adding features such as ffmpeg) and rebuild motion.

    make distclean
    deletes the files: config.status,config.log,config.cache,Makefile,and motion.spec.

    make updateguide
    fetches a fresh new copy of this guide and place it in your motion source directory. Note that the pictures are not downloaded.

    make dist
    performs make clean,make distclean and make updateguide in one single operation.


    Error Logging错误日志)


    Motion reports errors to the console when it runs in non-daemon mode. And it outputs even more information when run in setup mode.

    Error logging has been implemented so that errors during daemon (background) mode are logged in the syslog.

    The syslog is in most Linux systems the file/var/log/messages(e.g. RedHat/Fedora) or/var/log/syslogand/var/log/user.log(e.g. Debian).

    Ubuntu中错误记录在/var/log/syslog中。
    其实在Ubuntu中motion的安装很方便,只需root权限下执行下面命令:
    apt-get install motion
    然后进行配置即可。详见我的另一篇文章点击打开链接

    猜你在找的设计模式相关文章