📄 motion_guide.html
字号:
<tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> -C, --config-cach </td><td bgcolor="#ffffff" valign="top"> alias for `--cache-file=config.cache' </td><td bgcolor="#ffffff" valign="top"> No function </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> -n, --no-create </td><td bgcolor="#eaeaea" valign="top"> do not create output files </td><td bgcolor="#eaeaea" valign="top"> Used for testing if other switches produce error - without writing anything to the disk </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --srcdir=DIR </td><td bgcolor="#ffffff" valign="top"> find the sources in DIR. [configure dir or `..'] </td><td bgcolor="#ffffff" valign="top"> DIR is a directory path. Editor recommends having the current directory being the motion installation directory and not using this switch. Then it defaults to the same directory as where the configure script is which is the current directory. </td></tr><tr><th width="160" bgcolor="#dadada" align="left" valign="top" class="twikiFirstCol"> <strong><font color="#000000">Installation directories:</font></strong> </th><th bgcolor="#dadada" align="left" valign="top"> <strong><font color="#000000"> </font></strong> </th><th bgcolor="#dadada" align="left" valign="top"> <strong><font color="#000000"> </font></strong> </th></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --prefix=PREFIX </td><td bgcolor="#ffffff" valign="top"> install architecture-independent files in PREFIX<br />[/usr/local] </td><td bgcolor="#ffffff" valign="top"> The default /usr/local means that the executable binary "motion" is installed in /usr/local/bin, the manual page in /usr/local/man/man1, the document files in /usr/local/docs/motion-version, configuration file in /usr/local/etc, and some examples config files in /usr/local/examples/motion-versionEditor recommends keeping this default setting.<br />If you are experimenting with many parallel versions it may be interesting to set the PREFIX to e.g. /usr/local/motion and then add /usr/local/motion/bin to your search path (or simply cd /usr/local/motion/bin before execution).<br />This way you can change version just by changing the symbolic link in /usr/local/motion as suggested earlier in this guide.<br />If you are installing the software on a machine where you have no access to the /usr/local but have write access to a home directory, then you should change this to point to a directory within your home tree.<br />Example: --prefix=$HOME </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --exec-prefix=EPREFIX </td><td bgcolor="#eaeaea" valign="top"> install architecture-dependent files in EPREFIX<br />[PREFIX] </td><td bgcolor="#eaeaea" valign="top"> If you set this it only defines an alternative installation directory for the executable binary.<br />Note: The executable binary will be placed in a directory "bin" below the directory specified by this option<br />Editor recommends leaving this as default (i.e. not setting it). </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --bindir=DIR </td><td bgcolor="#ffffff" valign="top"> user executables [EPREFIX/bin] </td><td bgcolor="#ffffff" valign="top"> With this option you can control exactly in which directory the executable binary is installed. The previous option automatically adds the bin directory. Here you are in fill control. </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --sbindir=DIR </td><td bgcolor="#eaeaea" valign="top"> System admin executables [EPREFIX/sbin] </td><td bgcolor="#eaeaea" valign="top"> Not used by motion. Ignore it. </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --libexecdir=DIR </td><td bgcolor="#ffffff" valign="top"> program executables [EPREFIX/libexec] </td><td bgcolor="#ffffff" valign="top"> Not used by motion. Ignore it. </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --datadir=DIR </td><td bgcolor="#eaeaea" valign="top"> read-only architecture-independent data [PREFIX/share] </td><td bgcolor="#eaeaea" valign="top"> Not used by motion. Ignore it. </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --sysconfdir=DIR </td><td bgcolor="#ffffff" valign="top"> read-only single-machine data [PREFIX/etc] </td><td bgcolor="#ffffff" valign="top"> This is where motion both installs the default configuration file and also where it later searches for it.<br />Motion searches for the configuration file "motion.conf" in the following order:<br /><UL><br />1. Current directory from where motion was invoked<br />2. $HOME/.motion<br />3. The sysconfig directory set by this switch. If not defined the default is /usr/local/etc/<br /></UL><br />Editor recommends leaving this at default. Be careful if you run "make install" again. This will overwrite the motion.conf file that you have edited and experimented with for hours. Make sure to keep a copy in a safe place. Alternatively, copy the working file to the motion base install directory. Then make install will simply copy the same file back again. </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --sharedstatedir=DIR </td><td bgcolor="#eaeaea" valign="top"> modifiable architecture-independent data [PREFIX/com] </td><td bgcolor="#eaeaea" valign="top"> Not used by motion. Ignore it. </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --localstatedir=DIR </td><td bgcolor="#ffffff" valign="top"> modifiable single-machine data [PREFIX/var] </td><td bgcolor="#ffffff" valign="top"> Not used by motion. Ignore it. </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --libdir=DIR </td><td bgcolor="#eaeaea" valign="top"> object code libraries [EPREFIX/lib] </td><td bgcolor="#eaeaea" valign="top"> Not used by motion. Ignore it. </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --includedir=DIR </td><td bgcolor="#ffffff" valign="top"> C header files [PREFIX/include] </td><td bgcolor="#ffffff" valign="top"> Not used by motion. Ignore it. </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --oldincludedir=DIR </td><td bgcolor="#eaeaea" valign="top"> C header files for non-gcc [/usr/include] </td><td bgcolor="#eaeaea" valign="top"> Not used by motion. Ignore it. </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --infodir=DIR </td><td bgcolor="#ffffff" valign="top"> info documentation [PREFIX/info] </td><td bgcolor="#ffffff" valign="top"> Not used by motion. Ignore it. </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --mandir=DIR </td><td bgcolor="#eaeaea" valign="top"> man documentation [PREFIX/man] </td><td bgcolor="#eaeaea" valign="top"> Editor recommends the default. </td></tr><tr><th width="160" bgcolor="#dadada" align="left" valign="top" class="twikiFirstCol"> <strong><font color="#000000">Optional Packages:</font></strong> </th><th bgcolor="#dadada" align="left" valign="top"> <strong><font color="#000000"> </font></strong> </th><th bgcolor="#dadada" align="left" valign="top"> <strong><font color="#000000"> </font></strong> </th></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --with-ffmpeg=DIR </td><td bgcolor="#ffffff" valign="top"> Specify the path for the directory prefix in which the library and headers are installed.<br />If not specified configure will search in /usr/ and /usr/local/ </td><td bgcolor="#ffffff" valign="top"> DIR is the directory PREFIX in which the ffmpeg shared libraries and their headers are installed.<br />If you install ffmpeg from sources and use the default directories or if ffmpeg is installed as a binary package (RPM or deb) you do not need to specify the directory prefix. Configure will find the libraries automatically. If you installed ffmpeg from sources and specified a different --prefix when building ffmpeg you must use the same value for the DIR ( --with-ffmpeg=DIR).<br />For more information on FFmpeg see the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg project home page</a>.<br />FFmpeg is a package that enables streamed video mpeg signal from your web camera to a browser.<br />Editor recommends installing ffmpeg from source and in the directory /usr/local/ffmpeg and build ffmpeg with ./configure --enable-shared.<br />This places libraries in /usr/local/lib and headers in /usr/local/include. </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --without-ffmpeg </td><td bgcolor="#eaeaea" valign="top"> Do not compile with ffmpeg </td><td bgcolor="#eaeaea" valign="top"> Use this if you do not want to compile with ffmpeg. If ffmpeg is not installed you do not need to specify that Motion must build without ffmpeg. </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --with-mysql=DIR </td><td bgcolor="#ffffff" valign="top"> normally, configure will scan all possible default installation paths for mysql. When its fail, use this command to tell configure where mysql installation root directory is. </td><td bgcolor="#ffffff" valign="top"> DIR is the installation directory of mysql. E.g. /usr/local/mysql<br />Default is that make searches in the normal installation directories of most distributions. </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --without-mysql </td><td bgcolor="#eaeaea" valign="top"> Do not compile with MySQL support </td><td bgcolor="#eaeaea" valign="top"> Use this if you do not want to include MySQL support in the package.<br />This can also be useful if you get compilation errors related to MySQL and you actually do not need the feature anyway. </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --with-pgsql=DIR </td><td bgcolor="#ffffff" valign="top"> Include PostgreSQL support. DIR is the PostgreSQL base install directory, defaults to /usr/local/pgsql.<br />Set DIR to "shared" to build as a dynamic library, or "shared,DIR" to build as a dynamic library and still specify DIR. </td><td bgcolor="#ffffff" valign="top"> Default is that make searches in the normal installation directories of most distributions.<br />See section later about PostgreSQL about potential problem during compilation. There is an easy workaround for it. </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --without-pgsql </td><td bgcolor="#eaeaea" valign="top"> Do not compile with PostgreSQL support </td><td bgcolor="#eaeaea" valign="top"> Use this if you do not want to include PostgreSQL support in the package.<br />This can also be useful if you get compilation errors related to PostgreSQL and you actually do not need the feature anyway. </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --without-v4l </td><td bgcolor="#ffffff" valign="top"> Exclude using v4l (video4linux) subsystem. Makes Motion so it only supports network cameras. </td><td bgcolor="#ffffff" valign="top"> Can be used if you do not need V4L support and maybe lack some of the libraries for it. </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --with-linuxthreads </td><td bgcolor="#eaeaea" valign="top"> Use linuxthreads in BSD instead of native phtreads </td><td bgcolor="#eaeaea" valign="top"> Only relevant for BSD. In Linux we always use this per default. </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --without-bktr </td><td bgcolor="#ffffff" align="right" valign="top"> Exclude to use bktr subsystem , that usually useful for devices as network cameras </td><td bgcolor="#ffffff" valign="top"> ONLY used in *BSD </td></tr><tr><td width="160" bgcolor="#eaeaea" valign="top" class="twikiFirstCol"> --with-jpeg-mmx=DIR </td><td bgcolor="#eaeaea" valign="top"> Specify the prefix for the install path for jpeg-mmx for optimized jpeg handling (optional). If this is not specified motion will try to find the library /usr/lib/libjpeg-mmx.a /usr/local/lib/libjpeg-mmx.a. </td><td bgcolor="#eaeaea" valign="top"> Considered experimental </td></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --without-optimizecpu </td><td bgcolor="#ffffff" valign="top"> Exclude autodetecting platform and cpu type. This will disable the compilation of gcc optimizing code by platform and cpu. </td><td bgcolor="#ffffff" valign="top"> Use this if the optimization causes problems. Typically if you build on some non X386 compatible CPU. </td></tr><tr><th width="160" bgcolor="#dadada" align="left" valign="top" class="twikiFirstCol"> <strong><font color="#000000">Developers options</font></strong> </th><th bgcolor="#dadada" align="left" valign="top"> <strong><font color="#000000"> </font></strong> </th><th bgcolor="#dadada" align="left" valign="top"> <strong><font color="#000000"> </font></strong> </th></tr><tr><td width="160" bgcolor="#ffffff" valign="top" class="twikiFirstCol"> --with-developer-flags </td><td bgcolor="#ffffff" valign="top"> Add additional warning flags for the compiler. </td><td bgcolor="#ffffff" valign="top"> This option is for developers only. It produces a flood of warnings that helps the developer to write more robust code. These warnings are normally harmless but can sometimes be a latent defect.<br />For more information about these flags, see <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/CompileWithDeveloperFlags" class="twikiLink">CompileWithDeveloperFlags</a> </td></tr></table><input type="hidden" name="etrows" value="39" /><input class="editTableEditImageButton" type="image" src="http://www.lavrsen.dk/twiki/pub/TWiki/EditTablePlugin/edittable.gif" alt="Edit this table" /></form></div><!-- /editTable --><p /><h2><a name="Make"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MakeInstall" class="twikiLink">Make</a> </h2>When you run make, all the C-source files are automatically compiled and linked. Just look out for error messages.<p />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.<p /><img src="http://www.lavrsen.dk/twiki/pub/TWiki/TWikiDocGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Attention!<p />If you have run <code>make</code> before, you should run a <code>make clean</code> before running <code>make</code> again. This cleans out all the object files that were generated the previous time you ran <code>make</code>. If you do not run <code>make clean</code> first 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 running <code>make clean</code> first - the ffmpeg feature does not get compiled into the Motion binary.<p />First time you build motion run <code>./configure</code>, <code>make</code>, <code>make install</code>. If you need to build it again (to run with different configure options) run <code>./configure</code>, <code>make clean</code>, <code>make</code>, <code>make install</code>.<p /><h3><a name="Make_Install"></a> Make Install </h3><code>make install</code> simply copies all the nice files that were generated during the compilation/linking that make did.<p />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.<p />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) <ul><li> Executable binary "motion" to /usr/local/bin</li> <li> Manual page "motion.1" to /usr/local/man/man1</li> <li> Document files "CHANGELOG, COPYING, CREDITS, INSTALL, and README to /usr/local/share/doc/motion-3.2.X</li> <li> Example configuration files "*.conf" to /usr/local/share/doc/examples/motion-3.2.X</li> <li> Configuration file "motion-dist.conf" to /usr/local/etc</li></ul> 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.<p /><h3><a name="Un_install"></a> Un-install </h3>From the motion base installation directory you simply run <code>make uninstall</code><p />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.<p /><h3><a name="Additional_Make_Options"></a> Additional Make Options </h3>The make command can be run with several options. <code>make</code>, <code>make install</code> and <code>make uninstall</code> has already been described above.<p /> <dl><dt> <strong>make clean</strong> </dt><dd> 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 run <code>make clean</code> before you run <code>make</code> if you change the configuration (like adding features such as ffmpeg) and rebuild motion.</dd></dl> <p /> <dl><dt> <strong>make distclean</strong> </dt><dd> deletes the files: config.status, config.log, config.cache, Makefile, and motion.spec.</dd></dl> <p /> <dl><dt> <strong>make updateguide</strong> </dt><dd> fetches a fresh new copy of this guide and place it in your motion source directory. Note that the pictures are not downloaded.</dd></dl> <p /> <dl><dt> <strong>make dist</strong> </dt><dd> performs make clean, make distclean and make updateguide in one single operation.</dd></dl> <p /><p /><h2><a name="Upgrading_From_Older_Version"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/UpgradingFromOlderVersion" class="twikiLink">Upgrading From Older Version</a> </h2>If you are upgrading from motion 3.0.X or from an older version of 3.1.X you should note that many options have been removed from version 3.1.13 and forward and many new have arrived. You still have most of the old features. The options have been changed for two reasons. New more flexible features and to simplify getting started with Motion. With 3.2.1 the changes are significant.You should also note these major differences. <ul><li> The use of thread files has completely changed. Read the section "The Config Files" carefully.</li> <li> The mask file format has changed. Read the section about "Mask File"</li> <li> Pre_capture feature introduced in 3.1.12</li> <li> Advanced filename feature enables very flexible filename definitions (3.1.13)</li> <li> onffmpegclose options enables running external scripts when mpeg file is closed (3.1.13)</li> <li> despeckle feature improves motion detection and noise immunity (3.1.13)</li> <li> Minimum_motion_frames feature prevents short noise events from being saved (3.1.14)</li> <li> If you use the database features you need to note that from version 3.1.15 and forward the fields have been redefined. Removed are second, minute, hour, day, month and year. Instead these six have been replaced by a real timestamp field called time_stamp. The relatively new field 'type' has been renamed to 'file_type' to avoid reserved SQL words. A new field 'text_left' has been added which stores the text given by the config option text_left. And last a field called 'camera' has been added which stores the thread number.</li> <li> From 3.1.15 the ffmpeg feature now also supports mpeg4 and msmpeg4. The build process of Motion now use ffmpeg libraries as shared libraries. The --with-libavcodec has been replaced by a --with-ffmpeg which only needed to specify if you are installing ffmpeg from sources in a non-standard location. If you have installed ffmpeg from sources already you will need to rebuild by running (from within the ffmpeg source file root) ./configure --enable-shared followed by make and make install. If you had installed ffmpeg from a binary RPM or deb you probably don't have to do anything.</li> <li> Rotate feature was introduced in 3.1.15</li> <li> Berkeley mpeg feature has been removed in 3.1.18 (use ffmpeg - it is much better)</li> <li> Incomplete prediction feature was removed in 3.1.18. (lack of interest in finishing it)</li> <li> Smart Mask feature introduced in 3.1.18</li> <li> output_normal can now also have the value "first" which means only save first jpg from each event (3.1.18)</li> <li> ffmpeg-0.4.9 is now supported. Motion detection mpegs can no longer be saved as mpeg1 (ffmpeg does not support non-standard framerates in 0.4.9) (3.1.18)</li> <li> Motion now supports most (not all) mjpeg streaming cameras (3.1.18).</li> <li> output_normal can now have values "first" or "best". It is used when you need to present a link to an mpeg movie shown as a single jpeg image. "First" saves the first picture frame in the new event. "Best" saves the picture frame with most motion content (most changed pixels) when the event is over. "on" still saves all motion detection picture frames plus pre and post captured images. With "best" you can set jpeg_filename = "preview" and it gets the same filename as the mpeg file but with extension .jpg. Option "locate" can also take the value "preview" which makes it only draw a rectangel on the jpeg but not on the mpeg movie. (3.2.1)</li> <li> The xmlrpc remote control interface is replaced by a much nicer http remote control interface. (3.2.1)</li> <li> All the options that calls external programs have been made much more generic. New onxxxx options have been added. Execute, sms and mail have been replaced by the generic on_event_start. (3.2.1)</li> <li> New setup mode makes setting all the detection options much easier.</li> <li> netcam now also supports proxies (3.2.2) and ftp (3.2.4)</li> <li> text on the pictures can be set to double size (3.2.2)</li> <li> Tracking with Logitech Sphere/Orbit improved (3.2.4)</li> <li> SQL database feature is now fully configurable so you can control which fields you have in the database.</li> <li> Many new conversion specifiers have been added which can be used both in filenames, commands, text, and SQL database features (3.2.2-3.2.4)</li> <li> Stepper motor tracking feature extended to also include a Y axis (3.2.5)</li> <li> ffmpeg_filename h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -