cd /usr/local tar -xvzf /path/to/motion-3.2.X.tar.gz
ln -s motion-3.2.X motion
cd motion
./configure
make
make install
motion
| Library | RPM Packages | Debian Packages |
|---|---|---|
| libm, libresolv, libdl, libpthread, libc, ld-linux, libcrypt, and libnsl | glibc and glibc-devel | libc6 , libc6-dev ,libglib1.2 |
| libjpeg | libjpeg and libjpeg-devel | libjpeg62 and libjpeg62-dev ( optional libjpeg-mmx-dev ) |
| libz | zlib and zlib-devel | zlib1g and zlib1g-dev |
| Library | RPM Packages | Debian Packages |
|---|---|---|
| libavcodec, libavformat | ffmpeg and ffmpeg-devel or install from source | libavcodec-dev libavcodec0d libavformat-dev libavformat0d (*) |
deb http://www.debian-multimedia.org stable main # ( etch ) deb http://www.debian-multimedia.org testing main # ( lenny ) deb http://www.debian-multimedia.org unstable main # ( sid )Add the suitable line to your /etc/apt/sources.list and run this:
apt-get update ; apt-get -y install libavcodec-dev libavcodec0d libavformat-dev libavformat0dFor logging in MySQL you need this library:
| Library | RPM Packages | Debian Packages |
|---|---|---|
| libmysqlclient | mysql and mysql-devel | libmysqlclient15-off and libmysqlclient15-dev |
| Library | RPM Packages | Debian Packages |
|---|---|---|
| libpq | postgresql-libs and postgresql-devel | libpq-dev and libpq4 |
./configure
You can add the parameter ./configure --help to get help on the different switches.
This is walk through of the options.
make before, you should run a make clean before running make again. This cleans out all the object files that were generated the previous time you ran make. If you do not run make clean 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 make clean first - the ffmpeg feature does not get compiled into the Motion binary.
First time you build motion run ./configure, make, make install. If you need to build it again (to run with different configure options) run ./configure, make clean, make, make install.
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) make 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.
make, make install and make uninstall has already been described above.
make clean before you run make if you change the configuration (like adding features such as ffmpeg) and rebuild motion.
-c pathname Motion will expect the config file to be as specified. When you specify the config file on the command line with -c you can call it anything.
If you do not specify -c or the filename you give Motion does not exist, Motion will search for the configuration file called 'motion.conf' in the following order:
motion [ -hns ] [ -c config file path ] [ -d level ] [ -p process_id_file ]
| Option | Range/Values Default |
Description | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| area_detect | Values: 1 - 999999999 Default: Not defined |
Detect motion center in predefined areas. A script (on_area_detected) is started immediately when motion center is detected in one of the given areas, but only once during an event even if there is motion in a different configured area. | |||||||||||||||||||||||||||||||||
| auto_brightness | Values: on, off Default: off |
Let motion regulate the brightness of a video device. Only recommended for cameras without auto brightness | |||||||||||||||||||||||||||||||||
| brightness | Values: 0 - 255 Default: 0 (disabled) |
The brightness level for the video device. | |||||||||||||||||||||||||||||||||
| contrast | Values: 0 - 255 Default: 0 (disabled) |
The contrast level for the video device. | |||||||||||||||||||||||||||||||||
| control_authentication | Values: Max 4096 characters Default: Not defined |
To protect HTTP Control by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication. This option must be placed in motion.conf and not in a thread config file. | |||||||||||||||||||||||||||||||||
| control_html_output | Values: on, off Default: on |
Enable HTML in the a you run 'make install' this file gets copied to the /usr/local/etc directory.
The configuration file needs to be renamed from motion-dist.conf to motion.conf. The original file is called motion-dist.conf so that your perfectly working motion.conf file does not accidentally get overwritten when you re-install or upgrade to a newer version of Motion.
If you have more than one camera you should not try and invoke Motion more times. Motion is made to work with more than one camera in a very elegant way and the way to do it is to create a number of thread config files. Motion will then create an extra tread of itself for each camera. If you only have one camera you only need the motion.conf file. The minute you have two or more cameras you must have one thread config file per camera besides the motion.conf file.
So if you have for example two cameras you need motion.conf and two thread config files. Total of 3 config files.
An option that is common to all cameras can be placed in motion.conf. (You can also put all parameters in the thread files but that makes a lot of editing when you change a common thing).
An option that is unique to a camera must be defined in each thread file.
It is often seen that people copy the entire motion.conf into the thread config files and change a few options. This works but it not recommended because it is more difficult to maintain and overview. Keep all the common options in motion.conf and the few unique only in the thread config files
The first camera is defined in the first thread file called from motion.conf. The 2nd camera is defined in the 2nd thread file called from motion.conf etc.
Any option defined in motion.conf will be used for all cameras except for the cameras in which the same option is defined in a thread config file.
Motion reads its configuration parameters in the following sequence. If the same parameter exists more than one place the last one read wins.
Command Line Optionsmotion [ -hns ] [ -c config file path ] [ -d level ] [ -p process_id_file ] Config File OptionsThese are the options that can be used in the config file. All number values are integer numbers (no decimals allowed). Boolean options can be on or off. Some configuration options are only used if Motion is built on a system that has the matching software libraries installed (MySQL, PostgreSQL and FFMPEG). MySQL
Options in Alphabetical Order.The table below lists all the Motion options in alphabetical order. Click on the option name to see a longer description of each.
|