Files
motion/motion_guide.html
KennethLavrsen 7156fccd57 Preparing 3.2.12
Updating URLs and wiki tool name to Foswiki
2010-06-01 06:19:35 +00:00

5021 lines
362 KiB
HTML
Raw Permalink Blame History

<h1><a name="Motion_Guide_One_Large_Document"></a> Motion Guide - One Large Document. </h1>
This version of the Guide is made for inclusion in the Motion download package for off line reading.
<p />
If you read this document from the distribution package of Motion or from some not up to date mirror you should know that the URL for the always up to date version is <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide" target="_top">http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide</a>. If you are already on the Foswiki based Motion site clicking the link just mentioned will lead you to the index page for the Motion Guide documents.
<hr />
This topic consists of the following subtopics:
<a href="/foswiki/bin/view/Motion/MotionOverview">MotionOverview</a>, <a href="/foswiki/bin/view/Motion/KnownProblems">KnownProblems</a>, <a href="/foswiki/bin/view/Motion/InstallOverview">InstallOverview</a>, <a href="/foswiki/bin/view/Motion/PrepareInstall">PrepareInstall</a>, <a href="/foswiki/bin/view/Motion/ConfigureScript">ConfigureScript</a>, <a href="/foswiki/bin/view/Motion/MakeInstall">MakeInstall</a>, <a href="/foswiki/bin/view/Motion/UpgradingFromOlderVersion">UpgradingFromOlderVersion</a>, <a href="/foswiki/bin/view/Motion/RunningMotionConfigFiles">RunningMotionConfigFiles</a>, <a href="/foswiki/bin/view/Motion/CommandLineOptions">CommandLineOptions</a>, <a href="/foswiki/bin/view/Motion/ConfigFileOptions">ConfigFileOptions</a>, <a href="/foswiki/bin/view/Motion/SignalsKill">SignalsKill</a>, <a href="/foswiki/bin/view/Motion/ErrorLogging">ErrorLogging</a>, <a href="/foswiki/bin/view/Motion/CaptureDeviceOptions">CaptureDeviceOptions</a>, <a href="/foswiki/bin/view/Motion/MotionDetectionSettings">MotionDetectionSettings</a>, <a href="/foswiki/bin/view/Motion/ImageFileOutput">ImageFileOutput</a>, <a href="/foswiki/bin/view/Motion/TuningMotion">TuningMotion</a>, <a href="/foswiki/bin/view/Motion/MpegFilmsFFmpeg">MpegFilmsFFmpeg</a>, <a href="/foswiki/bin/view/Motion/SnapshotsWebCam">SnapshotsWebCam</a>, <a href="/foswiki/bin/view/Motion/TextFeatures">TextFeatures</a>, <a href="/foswiki/bin/view/Motion/AdvancedFilenames">AdvancedFilenames</a>, <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">ConversionSpecifiers</a>, <a href="/foswiki/bin/view/Motion/WebcamServer">WebcamServer</a>, <a href="/foswiki/bin/view/Motion/RemoteControlHttp">RemoteControlHttp</a>, <a href="/foswiki/bin/view/Motion/ExternalCommands">ExternalCommands</a>, <a href="/foswiki/bin/view/Motion/TrackingControl">TrackingControl</a>, <a href="/foswiki/bin/view/Motion/UsingDatabases">UsingDatabases</a>, <a href="/foswiki/bin/view/Motion/LoopbackDevice">LoopbackDevice</a>.
<hr />
<p />
<a name="foswikiTOC"></a><div class="foswikiToc"> <ul>
<li> <a href="#Motion_Guide_Installation"> Motion Guide - Installation</a> <ul>
<li> <a href="#Motion_Overview"> Motion Overview</a> <ul>
<li> <a href="#What_is_Motion"> What is Motion?</a>
</li> <li> <a href="#How_do_I_get_Motion_and_what_doe"> How do I get Motion and what does it cost?</a>
</li> <li> <a href="#Maintenance_and_Support"> Maintenance and Support</a>
</li> <li> <a href="#Which_version_to_download_and_us"> Which version to download and use?</a>
</li> <li> <a href="#What_features_does_Motion_have"> What features does Motion have?</a>
</li> <li> <a href="#FreeBSD"> FreeBSD</a>
</li> <li> <a href="#MacOSX"> MacOSX</a>
</li> <li> <a href="#Documentation"> Documentation</a>
</li> <li> <a href="#Supported_Hardware"> Supported Hardware</a>
</li></ul>
</li> <li> <a href="#Known_Problems"> Known Problems</a>
</li> <li> <a href="#How_do_I_install_Motion"> How do I install Motion?</a>
</li> <li> <a href="#Preparation_For_Install"> Preparation For Install</a>
</li> <li> <a href="#Configure_Script"> Configure Script</a>
</li> <li> <a href="#Make"> Make</a> <ul>
<li> <a href="#Make_Install"> Make Install</a>
</li> <li> <a href="#Un_install"> Un-install</a>
</li> <li> <a href="#Additional_Make_Options"> Additional Make Options</a>
</li></ul>
</li> <li> <a href="#Upgrading_From_Older_Version"> Upgrading From Older Version</a>
</li> <li> <a href="#Running_Motion"> Running Motion</a> <ul>
<li> <a href="#Important_Definitions"> Important Definitions</a>
</li> <li> <a href="#The_Config_Files"> The Config Files</a>
</li></ul>
</li> <li> <a href="#Command_Line_Options"> Command Line Options</a>
</li> <li> <a href="#Config_File_Options"> Config File Options</a> <ul>
<li> <a href="#Options_in_Alphabetical_Order"> Options in Alphabetical Order.</a>
</li> <li> <a href="#Obsolete_Options"> Obsolete Options</a>
</li></ul>
</li> <li> <a href="#Signals_sent_with_e_g_kill_comma"> Signals (sent with e.g. kill command)</a>
</li> <li> <a href="#Error_Logging"> Error Logging</a>
</li></ul>
</li> <li> <a href="#Motion_Guide_Basic_Features"> Motion Guide - Basic Features</a> <ul>
<li> <a href="#Capture_Device_Options_The_Basic"> Capture Device Options - The Basic Setup</a>
</li> <li> <a href="#video4linux_V4L_devices"> video4linux (V4L) devices</a> <ul>
<li> <a href="#auto_brightness"> auto_brightness</a>
</li> <li> <a href="#brightness"> brightness</a>
</li> <li> <a href="#contrast"> contrast</a>
</li> <li> <a href="#framerate"> framerate</a>
</li> <li> <a href="#frequency"> frequency</a>
</li> <li> <a href="#height"> height </a>
</li> <li> <a href="#hue"> hue</a>
</li> <li> <a href="#input"> input </a>
</li> <li> <a href="#minimum_frame_time"> minimum_frame_time</a>
</li> <li> <a href="#norm"> norm</a>
</li> <li> <a href="#rotate"> rotate</a>
</li> <li> <a href="#saturation"> saturation</a>
</li> <li> <a href="#tunerdevice"> tunerdevice</a>
</li> <li> <a href="#v4l2_palette"> v4l2_palette</a>
</li> <li> <a href="#videodevice"> videodevice</a>
</li> <li> <a href="#width"> width</a>
</li></ul>
</li> <li> <a href="#Network_Cameras"> Network Cameras</a> <ul>
<li> <a href="#netcam_http"> netcam_http</a>
</li> <li> <a href="#netcam_proxy"> netcam_proxy</a>
</li> <li> <a href="#netcam_tolerant_check"> netcam_tolerant_check</a>
</li> <li> <a href="#netcam_url"> netcam_url</a>
</li> <li> <a href="#netcam_userpass"> netcam_userpass</a>
</li></ul>
</li> <li> <a href="#Round_Robin_feature"> Round Robin feature</a> <ul>
<li> <a href="#roundrobin_frames"> roundrobin_frames</a>
</li> <li> <a href="#roundrobin_skip"> roundrobin_skip</a>
</li> <li> <a href="#switchfilter"> switchfilter</a>
</li></ul>
</li> <li> <a href="#Motion_Detection_Settings"> Motion Detection Settings</a> <ul>
<li> <a href="#area_detect"> area_detect</a>
</li> <li> <a href="#despeckle"> despeckle</a>
</li> <li> <a href="#gap"> gap</a>
</li> <li> <a href="#lightswitch"> lightswitch </a>
</li> <li> <a href="#mask_file"> mask_file</a>
</li> <li> <a href="#max_mpeg_time"> max_mpeg_time</a>
</li> <li> <a href="#minimum_motion_frames"> minimum_motion_frames</a>
</li> <li> <a href="#noise_level"> noise_level</a>
</li> <li> <a href="#noise_tune"> noise_tune</a>
</li> <li> <a href="#output_all"> output_all</a>
</li> <li> <a href="#post_capture"> post_capture</a>
</li> <li> <a href="#pre_capture"> pre_capture</a>
</li> <li> <a href="#smart_mask_speed"> smart_mask_speed</a>
</li> <li> <a href="#threshold"> threshold</a>
</li> <li> <a href="#threshold_tune"> threshold_tune</a>
</li></ul>
</li> <li> <a href="#Image_File_Output"> Image File Output</a> <ul>
<li> <a href="#output_motion"> output_motion</a>
</li> <li> <a href="#output_normal"> output_normal</a>
</li> <li> <a href="#ppm"> ppm</a>
</li> <li> <a href="#quality"> quality</a>
</li></ul>
</li> <li> <a href="#Tuning_Motion"> Tuning Motion</a>
</li> <li> <a href="#Generating_MPEG_films_with_ffmpe"> Generating MPEG films with ffmpeg</a> <ul>
<li> <a href="#ffmpeg_bps"> ffmpeg_bps</a>
</li> <li> <a href="#ffmpeg_cap_motion"> ffmpeg_cap_motion</a>
</li> <li> <a href="#ffmpeg_cap_new"> ffmpeg_cap_new</a>
</li> <li> <a href="#ffmpeg_deinterlace"> ffmpeg_deinterlace</a>
</li> <li> <a href="#ffmpeg_timelapse"> ffmpeg_timelapse</a>
</li> <li> <a href="#ffmpeg_timelapse_mode"> ffmpeg_timelapse_mode</a>
</li> <li> <a href="#ffmpeg_variable_bitrate"> ffmpeg_variable_bitrate</a>
</li> <li> <a href="#ffmpeg_video_codec"> ffmpeg_video_codec</a>
</li></ul>
</li> <li> <a href="#Snapshots_The_Traditional_Period"> Snapshots - The Traditional Periodic Web Camera</a> <ul>
<li> <a href="#snapshot_interval"> snapshot_interval</a>
</li></ul>
</li> <li> <a href="#Text_Features"> Text Features</a> <ul>
<li> <a href="#locate"> locate</a>
</li> <li> <a href="#text_changes"> text_changes</a>
</li> <li> <a href="#text_double"> text_double</a>
</li> <li> <a href="#text_event"> text_event</a>
</li> <li> <a href="#text_left"> text_left</a>
</li> <li> <a href="#text_right"> text_right</a>
</li></ul>
</li> <li> <a href="#Advanced_Filenames"> Advanced Filenames</a> <ul>
<li> <a href="#ffmpeg_filename_now_called_movie"> ffmpeg_filename (now called movie_filename)</a>
</li> <li> <a href="#jpeg_filename"> jpeg_filename</a>
</li> <li> <a href="#movie_filename"> movie_filename</a>
</li> <li> <a href="#snapshot_filename"> snapshot_filename</a>
</li> <li> <a href="#target_dir"> target_dir</a>
</li> <li> <a href="#timelapse_filename"> timelapse_filename</a>
</li></ul>
</li> <li> <a href="#Conversion_Specifiers_for_Advanc"> Conversion Specifiers for Advanced Filename and Text Features</a>
</li> <li> <a href="#Webcam_Server"> Webcam Server</a> <ul>
<li> <a href="#webcam_limit"> webcam_limit</a>
</li> <li> <a href="#webcam_localhost"> webcam_localhost</a>
</li> <li> <a href="#webcam_maxrate"> webcam_maxrate</a>
</li> <li> <a href="#webcam_motion"> webcam_motion</a>
</li> <li> <a href="#webcam_port"> webcam_port</a>
</li> <li> <a href="#webcam_quality"> webcam_quality</a>
</li></ul>
</li> <li> <a href="#Remote_Control_with_http"> Remote Control with http</a> <ul>
<li> <a href="#control_authentication"> control_authentication</a>
</li> <li> <a href="#control_html_output"> control_html_output</a>
</li> <li> <a href="#control_localhost"> control_localhost</a>
</li> <li> <a href="#control_port"> control_port</a>
</li></ul>
</li> <li> <a href="#External_Commands"> External Commands</a> <ul>
<li> <a href="#on_area_detected"> on_area_detected</a>
</li> <li> <a href="#on_camera_lost"> on_camera_lost</a>
</li> <li> <a href="#on_event_end"> on_event_end</a>
</li> <li> <a href="#on_event_start"> on_event_start</a>
</li> <li> <a href="#on_motion_detected"> on_motion_detected</a>
</li> <li> <a href="#on_movie_end"> on_movie_end</a>
</li> <li> <a href="#on_movie_start"> on_movie_start</a>
</li> <li> <a href="#on_picture_save"> on_picture_save</a>
</li> <li> <a href="#quiet"> quiet</a>
</li> <li> <a href="#What_happened_to_mail_and_sms"> What happened to mail and sms?</a> <ul>
<li> <a href="#Sending_email_at_start_of_event"> Sending email at start of event</a>
</li> <li> <a href="#Sending_SMS_at_start_of_event"> Sending SMS at start of event</a>
</li></ul>
</li></ul>
</li></ul>
</li> <li> <a href="#Motion_Guide_Special_Features"> Motion Guide - Special Features</a> <ul>
<li> <a href="#Tracking_Control"> Tracking Control</a> <ul>
<li> <a href="#Tracking_Feature_with_Logitech_Q"> Tracking Feature with Logitech Quickcam Sphere/Orbit</a>
</li> <li> <a href="#track_auto"> track_auto</a>
</li> <li> <a href="#track_iomojo_id"> track_iomojo_id</a>
</li> <li> <a href="#track_maxx"> track_maxx</a>
</li> <li> <a href="#track_maxy"> track_maxy</a>
</li> <li> <a href="#track_motorx"> track_motorx</a>
</li> <li> <a href="#track_motory"> track_motory</a>
</li> <li> <a href="#track_move_wait"> track_move_wait</a>
</li> <li> <a href="#track_port"> track_port</a>
</li> <li> <a href="#track_speed"> track_speed</a>
</li> <li> <a href="#track_step_angle_x"> track_step_angle_x</a>
</li> <li> <a href="#track_step_angle_y"> track_step_angle_y</a>
</li> <li> <a href="#track_stepsize"> track_stepsize</a>
</li> <li> <a href="#track_type"> track_type</a>
</li></ul>
</li> <li> <a href="#Using_Databases"> Using Databases</a> <ul>
<li> <a href="#sql_log_image"> sql_log_image</a>
</li> <li> <a href="#sql_log_mpeg"> sql_log_mpeg</a>
</li> <li> <a href="#sql_log_snapshot"> sql_log_snapshot</a>
</li> <li> <a href="#sql_log_timelapse"> sql_log_timelapse</a>
</li> <li> <a href="#sql_query"> sql_query</a>
</li></ul>
</li> <li> <a href="#MySQL"> MySQL</a> <ul>
<li> <a href="#mysql_db"> mysql_db</a>
</li> <li> <a href="#mysql_host"> mysql_host</a>
</li> <li> <a href="#mysql_password"> mysql_password</a>
</li> <li> <a href="#mysql_user"> mysql_user</a>
</li></ul>
</li> <li> <a href="#PostgreSQL"> PostgreSQL</a> <ul>
<li> <a href="#pgsql_db"> pgsql_db</a>
</li> <li> <a href="#pgsql_host"> pgsql_host</a>
</li> <li> <a href="#pgsql_password"> pgsql_password</a>
</li> <li> <a href="#pgsql_port"> pgsql_port</a>
</li> <li> <a href="#pgsql_user"> pgsql_user</a>
</li></ul>
</li> <li> <a href="#Video4Linux_Loopback_Device"> Video4Linux Loopback Device</a> <ul>
<li> <a href="#motion_video_pipe"> motion_video_pipe</a>
</li> <li> <a href="#video_pipe"> video_pipe</a>
</li></ul>
</li></ul>
</li></ul>
</div>
<p />
<h1><a name="Motion_Guide_Installation"></a> Motion Guide - Installation </h1>
<p />
<h2><a name="Motion_Overview"></a> <a href="/foswiki/bin/view/Motion/MotionOverview">Motion Overview</a> </h2>
<p />
<h3><a name="What_is_Motion"></a> What is Motion? </h3>
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.
<p />
The program is written in C and is made for the Linux operating system.
<p />
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).
<p />
The output from motion can be:
<p /> <ul>
<li> jpg files
</li> <li> ppm format files
</li> <li> mpeg video sequences
</li></ul>
<p />
<h3><a name="How_do_I_get_Motion_and_what_doe"></a> How do I get Motion and what does it cost? </h3>
Motion is an open source type of project. It does not cost anything. Motion is published under the <a href="http://www.gnu.org/licenses/gpl.html" rel="nofollow" target="_top">GNU GENERAL PUBLIC LICENSE</a> (GPL) version 2 or later. It may be a bit difficult to understand all the details of the license text (especially if your first language is not English). It means that you can get the program, install it and use it freely. You do not have to pay anything and you do not have to register anywhere or ask the author or publisher for permission. The GPL gives you both rights and some very reasonable duties when it comes to copying, distribution and modification of the program. So in very general terms you do not have to worry about licensing as a normal hobby user. 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. For more information about free software and the GPL, I encourage you to study the very interesting documents about the subject available the of the Free Software Foundation pages about the <a href="http://www.gnu.org/philosophy/philosophy.html" rel="nofollow" target="_top">Philosophy of the GNU Project</a>.
<p />
<h3><a name="Maintenance_and_Support"></a> Maintenance and Support </h3>
Both Motion and the Motion Guide are written by people that do all this as a hobby and without asking for any payments or donations. We have a life other than developing Motion and its documentation. This means that bugfixes and updates to this guide are done as our time and families allow it. You are however encouraged to participate and contribute in a very active <a href="/foswiki/bin/view/Motion/MailingList">mailing list</a>. It is a list with a very "positive attitude" and with many contributors that propose features, post patches, discuss problems and patiently answer newbie questions with a very positive spirit. Expect 1-10 emails per day.
<p />
To get motion direct your browser to the <a href="/foswiki/bin/view/Motion/WebHome" class="foswikiCurrentWebHomeLink">Motion Homepage</a>.
<p />
On the <a href="/foswiki/bin/view/Motion/DownloadFiles">Download Files</a> page you will find a links to the latest stable version both as sources and binaries for some of the most popular Linux distributions. You will also find links to development versions. Snapshot releases are special test releases that are normally very stable. Every day a <a href="/foswiki/bin/view/Motion/MotionDailySourceSnap">Motion Daily Source Snap</a> is created from the <a href="/foswiki/bin/view/Motion/MotionSubversion">Motion Subversion</a>
<p />
Motion was originally written by Jeroen Vreeken who still actively participates in the development of Motion and later Folkert van Heusden continued as a lead programmer with Kenneth Lavrsen responsible for Motion Guide, website and releases on Sourceforge.
<p />
From version 3.1.12 Motion is now project managed entirely by Kenneth Lavrsen, and the project now shift towards being developed by many contributers.
<p />
For support we encourage you to join the mailing list instead of writing to Jeroen, Folkert or Kenneth directly. We are all very active on the mailing list and by using the mailing list much more users will have benefit of the answers. Newbies and stupid questions are welcome on the list. Contributions in the form of patches are also very welcome on the mailing list.
<p />
<h3><a name="Which_version_to_download_and_us"></a> Which version to download and use? </h3>
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.
<p />
Since 3.1.13 quite many options have been renamed to make setting up Motion easier. From 3.1.17-18 some unfinished features have been removed. The Berkeley mpeg feature is now removed because the ffmpeg feature is now mature and much better working. At version 3.1.18 a new network camera feature was introduced replacing the old cURL based netcam code and introducing support of mjpeg streaming cameras. However this new code was quite difficult to get stable. During the development of 3.2.2 the network camera code was totally rewritten again learning from our experience and now finally it seems to be stable.
<p />
Motion is included in Debian, while Ubuntu and RPM users can find binary packages on the Motion Sourceforge file download page.
<p />
<h3><a name="What_features_does_Motion_have"></a> What features does Motion have? </h3>
See more description at the <a href="/foswiki/bin/view/Motion/WebHome" class="foswikiCurrentWebHomeLink">Motion Homepage</a>. <ul>
<li> Taking snapshots of movement
</li> <li> Watch multiple video devices at the same time
</li> <li> Watch multiple inputs on one capture card at the same time
</li> <li> Live streaming webcam (using multipart/x-mixed-replace)
</li> <li> Real time creation of mpeg movies using libraries from ffmpeg
</li> <li> Take automated snapshots on regular intervals
</li> <li> Take automated snapshots at irregular intervals using cron
</li> <li> Executing external program when detecting movement
</li> <li> Execute external program at the beginning of an event of several motion detections.
</li> <li> Execute external program at the end of an event of several motion detections.
</li> <li> Execute external program when a picture is saved.
</li> <li> Execute external program when a movie mpeg is created (opened)
</li> <li> Execite external program when a movie mpeg ends (closed)
</li> <li> Motion tracking
</li> <li> Feed events to an MySQL or PostgreSQL database.
</li> <li> Feed video back to a video4linux loopback for real time viewing
</li> <li> Web interface using <a href="/foswiki/bin/view/Motion/RelatedProjects">Motion Related Projects</a> such as <a href="/foswiki/bin/view/Motion/MotionCGI">motion.cgi</a>, <a href="/foswiki/bin/view/Motion/KennethsWebcamPackage">Kenneths Webcam Package</a>, <a href="/foswiki/bin/view/Motion/KevinsWebpage">Kevins Webpage</a>, <a href="/foswiki/bin/view/Motion/XMotionTool">X-Motion</a> and many more.
</li> <li> User configurable and user defined on screen display.
</li> <li> Control via simple web interface.
</li> <li> Automatic noise and threshold control
</li> <li> Ability to control the pan/tilt of a Logitech Sphere (or Orbit) camera
</li> <li> Highly configurable display of text on images.
</li> <li> High configurable definition of path and file names of the stored images and films.
</li></ul>
<p />
You can find more information and links at the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome" target="_top">Motion Homepage</a>.
<p />
<h3><a name="FreeBSD"></a> FreeBSD </h3>
<p />
Motion is originally developed for Linux and it is still mainly developed and supported for this platform. From version 3.1.15 an experimental port has been made by Angel Carpintero. Not all features of Motion are supported at this time and it still needs a lot of test time on different hardware. Angel is very interested in feedback. Join the Motion Mailing List and give your feedback there. Patches for bugfixes and for enabling the missing features are very welcome. The rest of this guide is still mainly targeted for Linux users. Follow this topic to <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/FreeBSD" target="_top">Install FreeBSD</a>.
<p />
<h3><a name="MacOSX"></a> MacOSX </h3>
<p />
From Motion version 3.2.4 it is now also possible to build and install Motion under <a href="/foswiki/bin/view/Motion/MacOSX">MacOSX</a>. Feature set it the same as for FreeBSD. See the <a href="/foswiki/bin/view/Motion/MacOSX">MacOSX</a> topic for specific help how to install Motion and its dependencies on <a href="/foswiki/bin/view/Motion/MacOSX">MacOSX</a>. Again this port has been contributed by Angel Carpintero.
<p />
<h3><a name="Documentation"></a> Documentation </h3>
You have the following sources of information:
<p /> <ul>
<li> This <a href="/foswiki/bin/view/Motion/MotionGuide">Motion Guide</a>.
</li> <li> The <a href="/foswiki/bin/view/Motion/FrequentlyAskedQuestions">Frequently Asked Questions</a>
</li> <li> The author of the program has written a description of the <a href="/foswiki/bin/view/Motion/MotionTechnology">technology behind motion</a>.
</li> <li> The man page. After installation simply write man motion
</li> <li> The default motion.conf file (motion-dist.conf) that comes with the package.
</li></ul>
<p />
<h3><a name="Supported_Hardware"></a> Supported Hardware </h3>
Input devices: Here we are thinking about the cameras.
<p />
Motion supports video input from two kinds of sources.
<p />
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. <ul>
<li> <a href="http://www.saillard.org/pwc/" rel="nofollow" target="_top">Driver for USB Philips cameras (and more)</a> This driver is a fork of the old pcw(x) driver which got kicked out of the kernel. (see: <a href="http://www.smcc.demon.nl/webcam/" rel="nofollow" target="_top">http://www.smcc.demon.nl/webcam/</a>). See also the new <a href="/foswiki/bin/view/PWC/WebHome">PWC Documentation Site</a> which is hosted in this wiki.
</li> <li> <a href="http://bytesex.org/bttv/index.html" rel="nofollow" target="_top">BTTV Driver</a> (capture cards). Part of many distributions now.
</li> <li> <a href="http://alpha.dyndns.org/ov511/" rel="nofollow" target="_top">OV511</a> based USB cameras are supported as standard by newer Kernels.
</li> <li> <a href="http://spca50x.sourceforge.net/spca50x.php" rel="nofollow" target="_top">kernel driver for USB cameras based on Sunplus spca50</a>
</li> <li> <a href="http://rivatv.sourceforge.net/" rel="nofollow" target="_top">rivatv.sourceforge.net</a> Driver for tv/composite/svideo input with most Nvidia based video cards. Network cameras (which are actually cameras with a built in web server that can be connected directory to your network).
</li> <li> <a href="http://www.axis.com/" rel="nofollow" target="_top">Axis Communications</a>
</li></ul>
<p />
<p />
<h2><a name="Known_Problems"></a> <a href="/foswiki/bin/view/Motion/KnownProblems">Known Problems</a> </h2>
See also the <a href="/foswiki/bin/view/Motion/FrequentlyAskedQuestions">Frequently Asked Questions</a> and <a href="/foswiki/bin/view/Motion/BugReports">Bug Reports</a> for known open bugs.
<p />
<strong>Kernel 2.6 and pwc.</strong> Note that for kernel 2.6 there is a new release of the Philips WebCam (pwc) drivers 10.0.X. It is recommended to install this. At the time of this being written the 2.6.12+ kernels have a version of pwc built-in but it is a cripled version which can only support very small picture size. You can however download the latest source code of the pwc driver (at this time 10.0.11) and build it without having to rebuild your kernel. But you will need to have either the kernel sources or a special kernel-header package installed to compile it. See <a href="/foswiki/bin/view/PWC/InstallationOfPWC">Installation of PWC</a> page which is also hosted in this wiki.
<p />
If you use use a <strong>Logitech Quickcam Orbit or Sphere</strong> using the driver pwc/pwcx and kernel 2.6.X you should replace the file in the Motion sources called pwc-ioctl.h with the one that comes with the your pwc version. Motion is shipped with 3 versions of pwc-ioctl.h-VERSION. Rename the one that fits your major pwc version number best to pwc-ioctl.h (after renaming the current to something else). There has been some small adjustments in the API that requires that you have the right header file.
<p />
<strong>Camera picture dimensions must be multiple of 16</strong>
Dimentions of camera image must have both height and width that are a multiple of 16. Th<54>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.
<p />
<strong>ffmpeg_filename has changed name to movie_filename</strong>
The 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.
<p />
<strong>error: `time_current_frame' undeclared (first use in this function)</strong>
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.
<p />
<p />
<p />
<h2><a name="How_do_I_install_Motion"></a> <a href="/foswiki/bin/view/Motion/InstallOverview">How do I install Motion</a>? </h2>
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.
<p />
The short overview of the steps to install Motion from sources. <ul>
<li> <strong>Preparation</strong>: 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.
</li></ul>
<p /> <ul>
<li> <strong>Download</strong> the motion source files (distributed as tar'ed and compressed files). Place the file in a place of your own choice.
</li></ul>
<p /> <ul>
<li> <strong>Untar and uncompress</strong> the 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).
</li></ul>
<UL>
<pre>
cd /usr/local
tar -xvzf /path/to/motion-3.2.X.tar.gz
</pre>
</UL> <ul>
<li> 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.
</li></ul>
<UL>
<pre>
ln -s motion-3.2.X motion
</pre>
</UL> <ul>
<li> Now change to the new directory
</li></ul>
<UL>
<pre>
cd motion
</pre>
</UL> <ul>
<li> Run configure. You can start with the defaults. If you need to modify the installation parameters you can read the next section.
</li></ul>
<UL>
<pre>
./configure
</pre>
</UL> <ul>
<li> Build the code
</li></ul>
<UL>
<pre>
make
</pre>
</UL> <ul>
<li> Install the code, manual page, etc
</li></ul>
<UL>
<pre>
make install
</pre>
</UL> <ul>
<li> 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 to <strong>motion.conf</strong> and edit as a minimum the settings: <strong>videodevice</strong>, <strong>input</strong>, <strong>norm</strong>, <strong>frequency</strong>, <strong>width</strong>, <strong>height</strong> and <strong>target_dir</strong>. That should get you going.
</li></ul>
<p /> <ul>
<li> Run the program. To enable more features you must modify the config file.
</li></ul>
<UL>
<pre>
motion
</pre>
</UL>
<p />
<p />
<h2><a name="Preparation_For_Install"></a> <a href="/foswiki/bin/view/Motion/PrepareInstall">Preparation For Install</a> </h2>
<p />
Note: If you're using SuSE 9.2, you might want to <strong>ADDITIONALLY</strong> have a look at <a href="/foswiki/bin/view/Motion/SuSE92Prep">Compiling on SuSE 9.2</a>. As mentioned on that page as well, <em>you will still need to read the instructions here as well</em>.
<p />
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.
<p />
This is a list of shared libraries used by Motion and the RPM packages that provides them.
<p />
Motion will always need these libraries to be built and work
<table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=1;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Library</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=1;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">RPM Packages</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=1;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Debian Packages</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> libm, libresolv, libdl, libpthread, libc, ld-linux, libcrypt, and libnsl </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> glibc and glibc-devel </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> libc6 , libc6-dev ,libglib1.2 </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> libjpeg </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> libjpeg and libjpeg-devel </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> libjpeg62 and libjpeg62-dev ( optional libjpeg-mmx-dev ) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> libz </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> zlib and zlib-devel </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> zlib1g and zlib1g-dev </td>
</tr>
</tbody></table>
<p />
For generating mpeg films with <strong>ffmpeg</strong> you need this library:<br>
(See also the section <a href="/foswiki/bin/view/Motion/MpegFilmsFFmpeg">Generating MPEG films with ffmpeg</a> for how to install ffmpeg and libavformat/libavcodec)<br>
<em>Motion must be installed with revision 0.4.8 or 0.4.9pre1 of ffmpeg. Motion will also work with later CVS snapshots of ffmpeg but the API of the ffmpeg libraries changes all the time and without warning. If you have problems compiling Motion or with running an RPM of Motion you may try with an older CVS snapshot of ffmpeg. The Motion developers will like to know when ffmpeg changes and breaks Motion so we can fix it. Please file a bug report then with the exact date of the ffmpeg CVS version you have trouble with.</em>
<p />
<table cellspacing="0" id="table2" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=2;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Library</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=2;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">RPM Packages</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=2;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Debian Packages</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> libavcodec, libavformat </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> ffmpeg and ffmpeg-devel or install from source </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> libavcodec-dev libavcodec0d libavformat-dev libavformat0d (*) </td>
</tr>
</tbody></table>
<p />
<strong>Debian</strong> has not provided deb packages for ffmpeg due patent issues. However this is about to change so checkout for availability of newer versions of debian ffmpeg debs. You can build yourself from source or from <a href="http://debian-multimedia.org/" rel="nofollow" target="_top">Christian Marillat website</a> or apt repository.
<pre>
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 )
</pre>
Add the suitable line to your /etc/apt/sources.list and run this:
<pre>
apt-get update ; apt-get -y install libavcodec-dev libavcodec0d libavformat-dev libavformat0d
</pre>
<p />
For logging in <strong>MySQL</strong> you need this library:
<table cellspacing="0" id="table3" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=3;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Library</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=3;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">RPM Packages</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=3;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Debian Packages</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> libmysqlclient </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> mysql and mysql-devel </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> libmysqlclient15-off and libmysqlclient15-dev </td>
</tr>
</tbody></table>
<p />
For logging in <strong>PostgreSQL</strong> you need this library:
<table cellspacing="0" id="table4" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=4;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Library</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=4;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">RPM Packages</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=4;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Debian Packages</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> libpq </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> postgresql-libs and postgresql-devel </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> libpq-dev and libpq4 </td>
</tr>
</tbody></table>
<p />
<p />
<h2><a name="Configure_Script"></a> <a href="/foswiki/bin/view/Motion/ConfigureScript">Configure Script</a> </h2>
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.
<p />
To run configure your current directory must be the motion directory. You type
<p />
<code>./configure</code>
<p />
You can add the parameter <code>./configure --help</code> to get help on the different switches.
<p />
This is walk through of the options.
<p />
<div class="editTable">
<form name="edittable1_Motion_MotionGuideOneLargeDocument" action="http://www.lavrsen.dk/foswiki/bin/viewauth/Motion/ConfigureScript#edittable1" method="post" onsubmit="foswikiStrikeOne(this)"><input type='hidden' name='validation_key' value='?2cfe88e727bcdefb0206a5c4989a9146' />
<input type="hidden" name="ettablenr" value="1" />
<input type="hidden" name="etedit" value="on" />
<table cellspacing="0" id="table5" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="160" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <font color="#ffffff">Option</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <font color="#ffffff">Description <br /> Defaults for the options <br /> are specified in brackets [ ]</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <font color="#ffffff">Editors comment</font> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -h, --help </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> display this help and exit </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --help=short </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> display options specific to this package </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> This command shows the options special to motion. Recommended </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --help=recursive </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> display the short help of all the included packages </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -V, --version </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> display version information and exit </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Gives no useful information </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -q, --quiet, --silent </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> do not print `checking...' messages </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not very useful. Output to screen is only a few lines anyway. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --cache-file=FILE </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> cache test results in FILE. [disabled] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> No function </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -C, --config-cach </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> alias for `--cache-file=config.cache' </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> No function </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -n, --no-create </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> do not create output files </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Used for testing if other switches produce error - without writing anything to the disk </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --srcdir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> find the sources in DIR. [configure dir or `..'] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> 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 class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<th width="160" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <font color="#ffffff">Installation directories:</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <font color="#ffffff">&nbsp;</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <font color="#ffffff">&nbsp;</font> </th>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --prefix=PREFIX </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> install architecture-independent files in PREFIX <br /> [/usr/local] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> 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 class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --exec-prefix=EPREFIX </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> install architecture-dependent files in EPREFIX <br /> [PREFIX] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> 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 class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --bindir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> user executables [EPREFIX/bin] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> 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 class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --sbindir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> System admin executables [EPREFIX/sbin] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --libexecdir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> program executables [EPREFIX/libexec] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --datadir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> read-only architecture-independent data [PREFIX/share] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --sysconfdir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> read-only single-machine data [PREFIX/etc] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> 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 class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --sharedstatedir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> modifiable architecture-independent data [PREFIX/com] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --localstatedir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> modifiable single-machine data [PREFIX/var] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --libdir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> object code libraries [EPREFIX/lib] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --includedir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> C header files [PREFIX/include] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --oldincludedir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> C header files for non-gcc [/usr/include] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --infodir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> info documentation [PREFIX/info] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --mandir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> man documentation [PREFIX/man] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Editor recommends the default. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="160" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <font color="#ffffff">Optional Packages:</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <font color="#ffffff">&nbsp;</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <font color="#ffffff">&nbsp;</font> </th>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-linuxthreads </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Use linuxthreads in BSD instead of native phtreads </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Only relevant for BSD. In Linux we always use this per default. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-pwcbsd </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Use pwcbsd based webcams ( only BSD ) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> This option allow to build motion to support <a href="/foswiki/bin/view/Motion/V4L">V4L</a>/V4L2 in BSD. <br /> <a href="/foswiki/bin/view/Motion/HowtoMotionPwcFreeBSD">HowtoMotionPwcFreeBSD</a> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-bktr </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Exclude to use bktr subsystem , that usually useful for devices as network cameras </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> ONLY used in *BSD </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-v4l </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Exclude using v4l (video4linux) subsystem. Makes Motion so it only supports network cameras. </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Can be used if you do not need <a href="/foswiki/bin/view/Motion/V4L">V4L</a> support and maybe lack some of the libraries for it. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-jpeg-mmx=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> 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="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Considered experimental </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-ffmpeg=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> 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="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> 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 class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-ffmpeg </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Do not compile with ffmpeg </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> 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 class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-mysql-lib=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Lib directory of MySQL </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Normally, configure will scan all possible default installation paths for MySQL libs. When its fail, use this command to tell configure where MySQL libs installation root directory is. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-mysql-include=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Include directory with headers for MySQL </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Normally, configure will scan all possible default installation paths for MySQL include. When its fail, use this command to tell configure where MySQL include installation directory is. This is the directory with the MySQL header files. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-mysql </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Do not compile with MySQL support </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> 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 class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-pgsql </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Do not compile with PostgreSQL support </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> 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 class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-pgsql-include=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Normally, configure will scan all possible default installation paths for pgsql include. When it fails, use this command to tell configure where pgsql include installation root directory is. </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-pgsql-lib=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Normally, configure will scan all possible default installation paths for pgsql libs. When it fails, use <br /> this command to tell configure where pgsql libs installation root directory is. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-optimizecpu </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Exclude autodetecting platform and cpu type. This will disable the compilation of gcc optimizing code by platform and cpu. </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use this if the optimization causes problems. Typically if you build on some non X386 compatible CPU. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="160" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <font color="#ffffff">Developers options</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <font color="#ffffff">&nbsp;</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <font color="#ffffff">&nbsp;</font> </th>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> --with-developer-flags </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> Add additional warning flags for the compiler. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> 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="/foswiki/bin/view/Motion/CompileWithDeveloperFlags">CompileWithDeveloperFlags</a> </td>
</tr>
</tbody></table>
<input type="hidden" name="ettablechanges" value="" />
<input type="hidden" name="etheaderrows" value="0" />
<input type="hidden" name="etfooterrows" value="0" />
<input class="editTableEditImageButton" type="image" src="http://www.lavrsen.dk/foswiki/pub/System/EditTablePlugin/edittable.gif" alt="Edit this table" /> </form>
</div><!-- /editTable -->
<p />
<p />
<h2><a name="Make"></a> <a href="/foswiki/bin/view/Motion/MakeInstall">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="/foswiki/pub/System/DocumentGraphics/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="/foswiki/bin/view/Motion/UpgradingFromOlderVersion">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 has been renamed to movie_filename to prepare for alternative implementation to mpeg files made with ffmpeg (3.2.5)
</li> <li> New feature: ffmpeg_deinterlace which can de-interlace using the ffmpeg libs (3.2.5)
</li> <li> New feature: minimum_frame_time which enables Motion to run at frame rates below 2. minimum_gap feature was removed since this was useless and the new minimum_frame_time feature replaces it with much better function. (3.2.7)
</li> <li> New feature: process_id_file which writes a PID file when started and removes it when stopped (3.2.7)
</li> <li> <a href="/foswiki/bin/view/Motion/V4L2">V4L2</a> support with many new supported palettes : <a href="/foswiki/bin/view/Motion/V4L2">V4L2</a>_PIX_FMT_SBGGR8, <a href="/foswiki/bin/view/Motion/V4L2">V4L2</a>_PIX_FMT_SN9C10X, <a href="/foswiki/bin/view/Motion/V4L2">V4L2</a>_PIX_FMT_JPEG, <a href="/foswiki/bin/view/Motion/V4L2">V4L2</a>_PIX_FMT_UYVY (3.2.8)
</li> <li> ffmpeg_video_codec allow swf (3.2.8)
</li> <li> <a href="/foswiki/bin/view/Motion/V4L2">V4L2</a> fix support for : <a href="/foswiki/bin/view/Motion/V4L2">V4L2</a>_PIX_FMT_MJPEG (3.2.9)
</li> <li> ffmpeg_video_codec allow flv and ffv1(3.2.9)
</li> <li> v4l2_palette: allow to choose preferable palette to be use by motion to capture from those supported by your videodevice.
</li> <li> netcam_http: setup keep_alive , 1.1 or 1.0 http method to be used by netcam.
</li> <li> on_camera_lost: Command to be executed when a camera can't be opened or if it is lost.
</li> <li> <a href="/foswiki/bin/view/Motion/AreaDetect">AreaDetect</a>, on_area_detected: Command to be executed by area_detect trigger.
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamTolerantCheck">ConfigOptionNetcamTolerantCheck</a> , netcam_tolerant_check less strict jpeg checks for network cameras with a poor/buggy firmware ( 3.2.11 ).
</li></ul>
<p />
The table below shows the new options in the left column, and obsolete options in the right column. If the there are options on both sides in a row it means that the options in the left column replaced the options in the right column.
<p />
<p />
<div class="editTable">
<form name="edittable1_Motion_MotionGuideOneLargeDocument" action="http://www.lavrsen.dk/foswiki/bin/viewauth/Motion/UpgradingFromOlderVersion#edittable1" method="post" onsubmit="foswikiStrikeOne(this)"><input type='hidden' name='validation_key' value='?2cfe88e727bcdefb0206a5c4989a9146' />
<input type="hidden" name="ettablenr" value="1" />
<input type="hidden" name="etedit" value="on" />
<table cellspacing="0" id="table6" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="50%" bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=6;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">New Options</font></a> </th>
<th width="50%" bgcolor="#687684" valign="top" class="foswikiTableCol1 foswikiLastCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=6;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Obsolete Options</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> text_left (3.1.13) <br /> text_right (3.1.13) <br /> text_changes (3.1.13) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> drawtext_user (3.1.13) <br /> drawtext_shots (3.1.13) <br /> drawtext_changes (3.1.13) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> jpeg_filename (3.1.13) <br /> ffmpeg_filename (3.1.13) <br /> snapshot_filename (3.1.13) <br /> timelapse_filename (3.1.13) <br /> predict_filename (3.1.13) <br /> (predict_filename removed in 3.1.18) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> oldlayout (3.1.13) <br /> snapshots_overwrite (3.1.13) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> snapshot_interval (3.1.13) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> snapshots (3.1.13) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> &nbsp; </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> realmotion (3.1.13) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> despeckle (3.1.13) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> pre_capture (3.1.12) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_timelapse (v. 3.1.14) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> ffmpeg_timelaps (renamed v 3.1.14) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_timelapse_mode (3.1.14) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> sql_log_image (3.1.14) <br /> sql_log_snapshot (3.1.14) <br /> sql_log_mpeg (3.1.14) <br /> sql_log_timelapse (3.1.14) <br /> sql_log_prediction (3.1.14) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> minimum_motion_frames (3.1.14) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> rotate (3.1.15) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_variable_bitrate (3.1.15) <br /> ffmpeg_video_codec (3.1.15) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> &nbsp; </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> berkeley_single_directory (3.1.18) <br /> mpeg_encode (3.1.18) <br /> mpeg_encode_bin (3.1.18) <br /> adjust_rate off (3.1.18) <br /> jpg_cleanup (3.1.18) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> &nbsp; </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> predict_filename (3.1.18) <br /> predict_enable (3.1.18) <br /> predict_threshold (3.1.18) <br /> predict_description (3.1.18) <br /> sql_log_prediction (3.1.18) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> brightness (3.1.18) <br /> contrast (3.1.18) <br /> saturation (3.1.18) <br /> hue (3.1.18) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> smart_mask_speed (3.1.18) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> output_normal <br /> valid values are now "on", "off", "first" (3.1.18) and "best" (3.2.1) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> setup_mode (3.2.1) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> always_changes (3.2.1) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> locate <br /> valid values are now "on", "off", "preview" (3.2.1) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> jpeg_filename <br /> Besides normal path names the value "preview" has speciel meaning together with output_normal = "best" (3.2.1) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> control_html_output (3.2.1) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> on_event_start (3.2.1) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> execute (3.2.1) <br /> sms (3.2.1) <br /> mail (3.2.1) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> on_event_end (3.2.1) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> on_motion_detected (3.2.1) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> on_picture_save (3.2.1) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> onsave (3.2.1) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> on_movie_start (3.2.1) <br /> on_movie_end (3.2.1) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> onmpeg (3.2.1) <br /> onffmpegclose (introduced 3.1.13)(renamed to on_movie_end 3.2.1) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> netcam_proxy (3.2.2) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> text_double (3.2.2) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> webcam_motion <br /> Feature has been heavily improved so it is actually usefull now (3.2.2). </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> netcam_url <br /> Now also supports fetching single frame jpeg pictures via ftp using ftp:// syntax (3.2.4) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> track_step_angle_x (3.2.4) <br /> track_step_angle_y (3.2.4) <br /> Add better configuration of auto tracking with a Logitech Sphere/Orbit camera. </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> track_move_wait (3.2.4) <br /> track_auto (3.2.4) <br /> Adds better configuration of auto tracking feature </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> sql_query (3.2.4) <br /> Adds full flexibility of defining fields when using the SQL database features. </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> track_maxy (3.2.5) <br /> track_motory (3.2.5) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> movie_filename (3.2.5) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> ffmpeg_filename (3.2.5) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_deinterlace (3.2.5) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> minimum_frame_time (3.2.7) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> minimum_gap (3.2.7) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> process_id_file (3.2.7) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_video_codec allow swf (3.2.8) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_video_codec allow flv and ffv1 (3.2.9) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> v4l2_palette (3.2.10) <br /> netcam_http (3.2.10) <br /> on_camera_lost (3.2.10) <br /> area_detect, on_area_detected(3.2.10) <br /> ffmpeg_video_codec mov(3.2.10) <br /> output_normal center(3.2.10) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> &nbsp; </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> night_compensate (3.2.10) <br /> low_cpu (3.2.10) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> netcam_tolerant_check (3.2.11) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol foswikiLast"> &nbsp; </td>
</tr>
</tbody></table>
<input type="hidden" name="ettablechanges" value="" />
<input type="hidden" name="etheaderrows" value="0" />
<input type="hidden" name="etfooterrows" value="0" />
<input class="editTableEditImageButton" type="image" src="http://www.lavrsen.dk/foswiki/pub/System/EditTablePlugin/edittable.gif" alt="Edit this table" /> </form>
</div><!-- /editTable -->
<p />
<p />
<h2><a name="Running_Motion"></a> <a href="/foswiki/bin/view/Motion/RunningMotionConfigFiles">Running Motion</a> </h2>
<p />
<h3><a name="Important_Definitions"></a> Important Definitions </h3>
Motion is invoked from the command line. It has no GUI. Everything is controlled from config files. From version 3.2 the command line is only used to define location of config file and a few special runtime modes (setup and non-daemon).
<p />
A few important definitions. <ul>
<li> A snapshot is a picture taken at regular intervals independently of any movement in the picture.
</li> <li> A "motion" image/mpeg shows the pixels that have actually changed during the last frames. These pictures are not very useful for normal presentation to the public but they are quite useful for testing and tuning and making mask files as you can see exactly where motion sees something moving. Motion is shown in greytones. If labelling is enabled the largest area is marked as blue. Smart mask is shown in read.
</li> <li> A "normal" image is the real image taken by the camera with text overlayed.
</li></ul>
<p />
<a name="ConfigFiles"></a>
<h3><a name="The_Config_Files"></a> The Config Files </h3>
<p />
If Motion was invoked with command line option <code>-c pathname</code> 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.
<p />
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:
<p /> <ol>
<li> Current directory from where motion was invoked
</li> <li> Then in a directory called '.motion' in the current users home directory (shell environment variable $HOME). E.g. /home/goofy/.motion/motion.conf
</li> <li> The directory defined by the --sysconfdir=DIR when running .configure during installation of Motion<br />(If this option was not defined the default is /usr/local/etc/)
</li></ol>
If you have write access to /usr/local/etc then the editor recommends having only one motion.conf file in the default /usr/local/etc/ directory.
<p />
Motion has a configuration file in the distribution package called motion-dist.conf. When you run 'make install' this file gets copied to the /usr/local/etc directory.
<p />
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.
<p />
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 <strong>one thread config file per camera</strong> besides the motion.conf file.
<p />
So if you have for example two cameras you need motion.conf <strong>and two</strong> thread config files. Total of <strong>3</strong> config files.
<p />
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).
<p />
An option that is unique to a camera must be defined in each thread file.
<p />
<em>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</em>
<p />
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.
<p />
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.
<p />
Motion reads its configuration parameters in the following sequence. If the same parameter exists more than one place <strong>the last one read wins</strong>. <ol>
<li> Motion reads the configuration file motion.conf from the beginning of the file going down line by line.
</li> <li> If the option "thread" is defined in motion.conf, the thread configuration file(s) is/(are) read.
</li> <li> Motion continues reading the rest of the motion.conf file. Any options from here will overrule the same option previously defines in a thread config file.
</li> <li> Motion reads the command line option again overruling any previously defined options.
</li></ol>
So always call the thread config files in the end of the motion.conf file. If you define options in motion.conf AFTER the thread file calls, the same options in the thread files will never be used. So always put the thread file call at the end of motion.conf.
<p />
Nearly all config options can be unique for a specific camera and placed in a thread config file. There are a few options that must be in motion.conf and cannot be in a thread config file: <a href="/foswiki/bin/view/Motion/ConfigOptionControlAuthentication">control_authentication</a>, <a href="/foswiki/bin/view/Motion/ConfigOptionControlHtmlOutput">control_html_output</a>, <a href="/foswiki/bin/view/Motion/ConfigOptionControlLocalhost">control_localhost</a>, <a href="/foswiki/bin/view/Motion/ConfigOptionControlPort">control_port</a>, <a href="/foswiki/bin/view/Motion/ConfigOptionDaemon">daemon</a>, and <a href="/foswiki/bin/view/Motion/ConfigOptionThread">thread</a>.
<p />
If motion is built without specific features such as ffmpeg, mysql etc it will ignore the options that belongs to these features. You do not have to remove them or comment them out.
<p />
If you run the http control command <a href="http://host:port/0/config/writeyes" rel="nofollow" target="_top">http://host:port/0/config/writeyes</a>, motion will overwrite motion.conf and all the thread.conf files by autogenerated config files neatly formatted and only with the features included that Motion was built with. If you later re-build Motion with more features or upgrade to a new version, you can use your old config files, run the motion.conf.write command, and you will have new config files with the new options included all set to their default values. This makes upgrading very easy to do.
<p />
<p />
<h2><a name="Command_Line_Options"></a> <a href="/foswiki/bin/view/Motion/CommandLineOptions">Command Line Options</a> </h2>
<p />
<img src="/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> In Motion 3.2.1 and forward most command line options have been removed and replaced them by an option to specify location to motion.conf and a few options related to setting up motion. There are now only few command line options left and they are basically all new.
<p />
SYNOPSIS
<pre>
motion &#91; -hns ] &#91; -c config file path ] &#91; -d level ] &#91; -p process&#95;id&#95;file ]
</pre>
<p />
<div class="editTable">
<form name="edittable1_Motion_MotionGuideOneLargeDocument" action="http://www.lavrsen.dk/foswiki/bin/viewauth/Motion/CommandLineOptions#edittable1" method="post" onsubmit="foswikiStrikeOne(this)"><input type='hidden' name='validation_key' value='?2cfe88e727bcdefb0206a5c4989a9146' />
<input type="hidden" name="ettablenr" value="1" />
<input type="hidden" name="etedit" value="on" />
<table cellspacing="0" id="table7" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="150" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=7;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Option</font></a> </th>
<th width="250" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=7;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Description</font></a> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=7;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Editors comment</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="150" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -n </td>
<td width="250" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Run in non-daemon mode. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Instead of running Motion in the background Motion runs in the terminal window writing messages when things happen. If you have problems getting Motion to start or work, run Motion in this mode to get more messages that can help you solve the problem. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="150" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -s </td>
<td width="250" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Run in setup mode. </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Also forces non-daemon mode </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="150" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -c config file path </td>
<td width="250" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Full path and filename of config file. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> E.g. /home/kurt/motion.conf. Default is /usr/local/etc unless specified differently when building Motion. Many RPMs and debian packages will most likely use /etc or /etc/motion as default </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="150" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -h </td>
<td width="250" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Show help screen. </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="150" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -d level </td>
<td width="250" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Debugging mode </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> This mode is used for developers to enable debug messages. Normal users will not need to use this mode unless a developer request to get additional information in the attempt to resolve a bug. Mainly the netcam code has debugging features. The level defines how much debugging info you get. A high number displays all debugging. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="150" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> -p process_id_file </td>
<td width="250" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLast"> Full path of process ID file </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> Full path and filename of process id file (PID file). This is optional. If none is given as command line option or in motion.conf (process_id_file) Motion will not create a PID file. </td>
</tr>
</tbody></table>
<input type="hidden" name="ettablechanges" value="" />
<input type="hidden" name="etheaderrows" value="0" />
<input type="hidden" name="etfooterrows" value="0" />
<input class="editTableEditImageButton" type="image" src="http://www.lavrsen.dk/foswiki/pub/System/EditTablePlugin/edittable.gif" alt="Edit this table" /> </form>
</div><!-- /editTable -->
<p />
<p />
<p />
<h2><a name="Config_File_Options"></a> <a href="/foswiki/bin/view/Motion/ConfigFileOptions">Config File Options</a> </h2>
These are the options that can be used in the config file.
<p />
All number values are integer numbers (no decimals allowed). Boolean options can be on or off.
<p />
Some configuration options are only used if Motion is built on a system that has the matching software libraries installed (MySQL, PostgreSQL and FFMPEG).
<p />
MySQL <ul>
<li> mysql_db, mysql_host, mysql_user, mysql_password
</li></ul>
<p />
PostgreSQL <ul>
<li> pgsql_db, pgsql_host, pgsql_user, pgsql_password, pgsql_port
</li></ul>
<p />
FFMPEG (libavcodec) <ul>
<li> ffmpeg_cap_new, ffmpeg_cap_motion, ffmpeg_filename, ffmpeg_timelapse, ffmpeg_timelapse_mode, ffmpeg_bps, ffmpeg_variable_bitrate, ffmpeg_video_codec
</li></ul>
<p />
<h3><a name="Options_in_Alphabetical_Order"></a> Options in Alphabetical Order. </h3>
<p />
The table below lists all the Motion options in alphabetical order. Click on the option name to see a longer description of each.
<table cellspacing="0" id="table8" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="170" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=8;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Option</font></a> </th>
<th width="240" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=8;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Range/Values<br />Default</font></a> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=8;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Description</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionAreaDetect">area_detect</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 1 - 999999999<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> 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. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionAutoBrightness">auto_brightness</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Let motion regulate the brightness of a video device. Only recommended for cameras without auto brightness </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionBrightness">brightness</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 0 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The brightness level for the video device. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionContrast">contrast</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The contrast level for the video device. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionControlAuthentication">control_authentication</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4096 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> 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. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionControlHtmlOutput">control_html_output</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Enable HTML in the answer sent back to a browser connecting to the control_port. This option must be placed in motion.conf and not in a thread config file. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionControlLocalhost">control_localhost</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Limits the http (html) control to the localhost. This option must be placed in motion.conf and not in a thread config file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionControlPort">control_port</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Sets the port number for the http (html using browser) based remote control. This option must be placed in motion.conf and not in a thread config file. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionDaemon">daemon</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Start in daemon (background) mode and release terminal. This option must be placed in motion.conf and not in a thread config file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionDespeckle">despeckle</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: EedDl<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Despeckle motion image using combinations of (E/e)rode or (D/d)ilate. And ending with optional (l)abeling. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegBps">ffmpeg_bps</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 9999999<br />Default: 400000 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Bitrate of mpegs produced by ffmpeg. Bitrate is bits per second. Default: 400000 (400kbps). Higher value mans better quality and larger files. Option requires that ffmpeg libraries are installed. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegCapMotion">ffmpeg_cap_motion</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use ffmpeg libraries to encode motion type mpeg movies where you only see the pixels that changes. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegCapNew">ffmpeg_cap_new</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use ffmpeg libraries to encode mpeg movies in realtime. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegDeinterlace">ffmpeg_deinterlace</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use ffmpeg to deinterlace video. Necessary if you use an analog camera and see horizontal combing on moving objects in video or pictures. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegFilename">ffmpeg_filename (now called movie_filename)</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This option was renamed to movie_filename in 3.2.5 to enable better integration of alternative movie libraries to the current ffmpeg solution. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegTimelapse">ffmpeg_timelapse</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Create a timelapse movie saving a picture frame at the interval in seconds set by this parameter. Set it to 0 if not used. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegTimelapseMode">ffmpeg_timelapse_mode</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: hourly, daily, weekly-sunday, weekly-monday, monthly, manual<br />Default: daily </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The file rollover mode of the timelapse video. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegVariableBitrate">ffmpeg_variable_bitrate</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0, 2 - 31<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Enables and defines variable bitrate for the ffmpeg encoder. ffmpeg_bps is ignored if variable bitrate is enabled. Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps, or the range 2 - 31 where 2 means best quality and 31 is worst. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegVideoCodec">ffmpeg_video_codec</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: mpeg1 (ffmpeg-0.4.8 only), mpeg4, msmpeg4, swf, flv, ffv1, mov<br />Default: mpeg4 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Codec to be used by ffmpeg for the video compression. Timelapse mpegs are always made in mpeg1 format independent from this option. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionFramerate">framerate</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 2 - 100<br />Default: 100 (no limit) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Maximum number of frames to be captured from the camera per second. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionFrequency">frequency</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 999999<br />Default: 0 (Not set) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The frequency to set the tuner to (kHz). Valid range: per tuner spec, default: 0 (Don't set it) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionGap">gap</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 60 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Gap is the seconds of no motion detection that triggers the end of an event. An event is defined as a series of motion images taken within a short timeframe. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionHeight">height </a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Device Dependent<br />Default: 288 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The height of each frame in pixels. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionHue">hue</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The hue level for the video device. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionInput">input </a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 7, 8 = disabled<br />Default: 8 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Input channel to use expressed as an integer number starting from 0. Should normally be set to 1 for video/TV cards, and 8 for USB cameras. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionJpegFilename">jpeg_filename</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S-%q </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> File path for motion triggered images (jpeg or ppm) relative to target_dir. Value 'preview' makes a jpeg filename with the same name body as the associated saved mpeg movie file. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionLightswitch">lightswitch </a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 100<br />Default: 0 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Ignore sudden massive light intensity changes given as a percentage of the picture area that changed intensity. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionLocate">locate</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off, preview<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Locate and draw a box around the moving object. Value 'preview' makes Motion only draw a box on a saved preview jpeg image and not on the saved mpeg movie. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionMaskFile">mask_file</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> PGM file to use as a sensitivity mask. This picture MUST have the same width and height as the frames being captured and be in binary format. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionMaxMpegTime">max_mpeg_time</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 (infinite) - 2147483647<br />Default: 3600 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The maximum length of an mpeg movie in seconds. Set this to zero for unlimited length. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionMinimumFrameTime">minimum_frame_time</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 0 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Minimum time in seconds between the capturing picture frames from the camera. Default: 0 = disabled - the capture rate is given by the camera framerate. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionMinimumMotionFrames">minimum_motion_frames</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 1 - 1000s<br />Default: 1 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Picture frames must contain motion at least the specified number of frames in a row before they are detected as true motion. At the default of 1, all motion is detected. Valid range is 1 to thousands, but it is recommended to keep it within 1-5. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionMotionVideoPipe">motion_video_pipe</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The video4linux video loopback input device for motion images. If a particular pipe is to be used then use the device filename of this pipe, if a dash '-' is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe. Default: not set </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionMovieFilename">movie_filename</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This was previously called ffmpeg_filename. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionMysqlDb">mysql_db</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Name of the MySQL database. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionMysqlHost">mysql_host</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: localhost </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> IP address or domain name for the MySQL server. Use "localhost" if motion and MySQL runs on the same server. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionMysqlPassword">mysql_password</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The MySQL password. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionMysqlUser">mysql_user</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The MySQL user name. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamHttp">netcam_http</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 1.0, keep_alive, 1.1<br />Default: 1.0 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The setting for keep-alive of network socket, should improve performance on compatible net cameras. ( new in 3.2.10 ) <br /> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamProxy">netcam_proxy</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> URL to use for a netcam proxy server, if required. The syntax is <a href="http://myproxy:portnumber" rel="nofollow" target="_top">http://myproxy:portnumber</a> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamTolerantCheck">netcam_tolerant_check</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off <br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Set less strict jpeg checks for network cameras with a poor/buggy firmware. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamUrl">netcam_url</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specify an url to a downloadable jpeg file or raw mjpeg stream to use as input device. Such as an AXIS 2100 network camera. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamUserpass">netcam_userpass</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> For network cameras protected 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. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionNoiseLevel">noise_level</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 1 - 255<br />Default: 32 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The noise level is used as a threshold for distinguishing between noise and motion. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionNoiseTune">noise_tune</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Activates the automatic tuning of noise level. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionNorm">norm</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour)<br />Default: 0 (PAL) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Select the norm of the video device. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionOnAreaDetected">on_area_detected</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when motion in a predefined area is detected. Check option area_detect. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionOnCameraLost">on_camera_lost</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when a camera can't be opened or if it is lost. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. (new in 3.2.10) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionOnEventEnd">on_event_end</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when an event ends after a period of no motion. The period of no motion is defined by option gap. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionOnEventStart">on_event_start</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when an event starts. An event starts at first motion detected after a period of no motion defined by gap. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">ConversionSpecifiers</a> and spaces as part of the command. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionOnMotionDetected">on_motion_detected</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when a motion frame is detected. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionOnMovieEnd">on_movie_end</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when an ffmpeg movie is closed at the end of an event. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionOnMovieStart">on_movie_start</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when an mpeg movie is created. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionOnPictureSave">on_picture_save</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when an image is saved. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionOutputAll">output_all</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Picture are saved continuously as if motion was detected all the time. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionOutputMotion">output_motion</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Output pictures with only the moving object. This feature generates the special motion type movies where you only see the pixels that changes as a graytone image. If labelling is enabled you see the largest area in blue. Smartmask is shown in red. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionOutputNormal">output_normal</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off, first, best, center (since 3.2.10)<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Normal image is an image that is stored when motion is detected. It is the same image that was taken by the camera. I.e. not a motion image like defined by output_motion. Default is that normal images are stored. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionPgsqlDb">pgsql_db</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Name of the PostgreSQL database. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionPgsqlHost">pgsql_host</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: localhost </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> IP address or domain name for the PostgreSQL server. Use "localhost" if motion and PostgreSQL runs on the same server. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionPgsqlPassword">pgsql_password</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The PostgreSQL password. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionPgsqlPort">pgsql_port</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 5432 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The PostgreSQL server port number. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionPgsqlUser">pgsql_user</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The PostgreSQL user name. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionPostCapture">post_capture</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647 <br />Default: 0 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specifies the number of frames to be captured after motion has been detected. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionPpm">ppm</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Output ppm images instead of jpeg. This uses less CPU time, but causes a LOT of hard disk I/O, and it is generally slower than jpeg. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionPreCapture">pre_capture</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 100s<br />Default: 0 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specifies the number of previous frames to be outputted at motion detection. Recommended range: 0 to 5, default=0. Do not use large values! Large values will cause Motion to skip video frames and cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionProcessIdFile">process_id_file</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> File to store the process ID, also called pid file. Recommended value when used: /var/run/motion.pid </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionQuality">quality</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 1 - 100<br />Default: 75 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The quality for the jpeg images in percent. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionQuiet">quiet</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Be quiet, don't output beeps when detecting motion. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionRotate">rotate</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0, 90, 180, 270<br />Default: 0 (not rotated) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Rotate image the given number of degrees. The rotation affects all saved images as well as mpeg movies. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionRoundrobinFrames">roundrobin_frames</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 1 - 2147483647<br />Default: 1 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specifies the number of frames to capture before switching inputs, this way also slow switching (e.g. every second) is possible. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionRoundrobinSkip">roundrobin_skip</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 1 - 2147483647<br />Default: 1 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specifies the number of frames to skip after a switch. (1 if you are feeling lucky, 2 if you want to be safe). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionSaturation">saturation</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The colour saturation level for the video device. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionSetupMode">setup_mode</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Run Motion in setup mode. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionSmartMaskSpeed">smart_mask_speed</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 10<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Slugginess of the smart mask. Default is 0 = DISABLED. 1 is slow, 10 is fast. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionSnapshotFilename">snapshot_filename</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S-snapshot </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> File path for snapshots (jpeg or ppm) relative to target_dir. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionSnapshotInterval">snapshot_interval</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Make automated snapshots every 'snapshot_interval' seconds. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionSqlLogImage">sql_log_image</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Log to the database when creating motion triggered image file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionSqlLogMpeg">sql_log_mpeg</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Log to the database when creating motion triggered mpeg file. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionSqlLogSnapshot">sql_log_snapshot</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Log to the database when creating a snapshot image file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionSqlLogTimelapse">sql_log_timelapse</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Log to the database when creating timelapse mpeg file </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C') </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> SQL query string that is sent to the database. The values for each field are given by using <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">convertion specifiers</a> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionSwitchfilter">switchfilter</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Turns the switch filter on or off. The filter can distinguish between most switching noise and real motion. With this you can even set roundrobin_skip to 1 without generating much false detection. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTargetDir">target_dir</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined = current working directory </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Target directory for picture and movie files. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTextChanges">text_changes</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Turns the text showing changed pixels on/off. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTextDouble">text_double</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Draw characters at twice normal size on images. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTextEvent">text_event</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %Y%m%d%H%M%S </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> This option defines the value of the speciel event conversion specifier %C. You can use any conversion specifier in this option except %C. Date and time values are from the timestamp of the first image in the current event. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTextLeft">text_left</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> User defined text overlayed on each in the lower left corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # &lt; &gt; , . : - + _ \n and vertical bar and <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> (codes starting by a %). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTextRight">text_right</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %Y-%m-%d\n%T </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> User defined text overlayed on each in the lower right corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # &lt; &gt; , . : - + _ \n and vertical bar and <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> (codes starting by a %). Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionThread">thread</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specifies full path and filename for a thread config file. Each camera needs a thread config file containing the options that are unique to the camera. If you only have one camera you do not need thread config files. If you have two or more cameras you need one thread config file for each camera in addition to motion.conf. This option must be placed in motion.conf and not in a thread config file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionThreshold">threshold</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 1 - 2147483647<br />Default: 1500 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Threshold for declaring motion. The threshold is the number of changed pixels counted after noise filtering, masking, despeckle, and labelling. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionThresholdTune">threshold_tune</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Activates the automatic tuning of threshold level. ( It's broken ) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTimelapseFilename">timelapse_filename</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %v-%Y%m%d-timelapse </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> File path for timelapse mpegs relative to target_dir (ffmpeg only). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackAuto">track_auto</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Enable auto tracking </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackIomojoId">track_iomojo_id</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use this option if you have an iomojo smilecam connected to the serial port instead of a general stepper motor controller. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackMaxx">track_maxx</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The maximum position for servo x. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackMaxy">track_maxy</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The maximum position for servo y. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackMotorx">track_motorx</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The motor number that is used for controlling the x-axis. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackMotory">track_motory</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The motor number that is used for controlling the y-axis. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackMoveWait">track_move_wait</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 10 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Delay during which tracking is disabled after auto tracking has moved the camera. Delay is defined as number of picture frames. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackPort">track_port</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> This is the device name of the serial port to which the stepper motor interface is connected. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackSpeed">track_speed</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 255 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Speed to set the motor to. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackStepAngleX">track_step_angle_x</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0-90<br />Default: 10 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Angle in degrees the camera moves per step on the X-axis with auto tracking. Currently only used with pwc type cameras. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackStepAngleY">track_step_angle_y</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0-40<br />Default: 10 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Angle in degrees the camera moves per step on the Y-axis with auto tracking. Currently only used with pwc type cameras. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackStepsize">track_stepsize</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 40 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Number of steps to make. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackType">track_type</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 (none), 1 (stepper), 2 (iomojo), 3 (pwc), 4 (generic), 5 (uvcvideo)<br />Default: 0 (None) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Type of tracker. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionTunerdevice">tunerdevice</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: /dev/tuner0 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The tuner device used for controlling the tuner in a tuner card. This option is only used when Motion is compiled for <a href="/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a>. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionV4L2Palette">v4l2_palette</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 8<br />Default: 8 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Allow to choose preferable palette to be use by motion<br /> to capture from those supported by your videodevice. ( new in 3.2.10 ) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionVideoPipe">video_pipe</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The video4linux video loopback input device for normal images. If a particular pipe is to be used then use the device filename of this pipe. If a dash '-' is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionVideodevice">videodevice</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: /dev/video0 (<a href="/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a>: /dev/bktr0) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The video device to be used for capturing. Default for Linux is /dev/video0. for <a href="/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a> the default is /dev/bktr0. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamLimit">webcam_limit</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 0 (unlimited) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Limit the number of frames to number frames. After 'webcam_limit' number of frames the connection will be closed by motion. The value 0 means unlimited. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamLocalhost">webcam_localhost</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Limits the access to the webcam to the localhost. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamMaxrate">webcam_maxrate</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 1 - 100<br />Default: 1 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Limit the framerate of the webcam in frames per second. Default is 1. Set the value to 100 for practically unlimited. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamMotion">webcam_motion</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> If set to 'on' Motion sends slows down the webcam stream to 1 picture per second when no motion is detected. When motion is detected the stream runs as defined by webcam_maxrate. When 'off' the webcam stream always runs as defined by webcam_maxrate. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamPort">webcam_port</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> TCP port on which motion will listen for incoming connects with its webcam server. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamQuality">webcam_quality</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 1 - 100<br />Default: 50 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Quality setting in percent for the mjpeg picture frames transferred over the webcam connection. Keep it low to restrict needed bandwidth. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> <a href="/foswiki/bin/view/Motion/ConfigOptionWidth">width</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLast"> Values: Device Dependent<br />Default: 352 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> The width in pixels of each frame. Valid range is camera dependent. </td>
</tr>
</tbody></table>
<p />
<h3><a name="Obsolete_Options"></a> Obsolete Options </h3>
<p />
<table cellspacing="0" id="table9" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="170" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=9;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Option</font></a> </th>
<th width="240" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=9;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Range/Values<br />Default</font></a> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=9;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Description</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionLowCpu">low_cpu</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 100<br />Default: 0 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> When this option is not zero motion will be in a low cpu mode while not detecting motion. In low cpu mode Motion reduces the framerate to the value given for this option. Value zero means disabled. ( DEPRECATED ) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="/foswiki/bin/view/Motion/ConfigOptionMinimumGap">minimum_gap</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 0 (no minimum) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The minimum time between two shots in seconds. ( DEPRECATED ) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> <a href="/foswiki/bin/view/Motion/ConfigOptionNightCompensate">night_compensate</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> When this option is set the noise threshold will be lowered if the picture is dark. This will improve the sensitivity in dark places. However it might also increase the number of false alarms since most cameras also increase light sensitivity with their AGC (Automatic Gain Control) and this will increase noise. ( DEPRECATED ) </td>
</tr>
</tbody></table>
<p />
<p />
<p />
<p />
<h2><a name="Signals_sent_with_e_g_kill_comma"></a> <a href="/foswiki/bin/view/Motion/SignalsKill">Signals (sent with e.g. kill command)</a> </h2>
A signal can be sent from the command line by typing e.g. <code>kill -s SIGHUP pid</code>, where the last parameter is the process ID which you get by typing <code>ps -ef &brvbar; grep motion</code>. The PID is the first on the list which is the parent process for the threads.
Motion responds to the following signals:
<p />
<table cellspacing="0" id="table10" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=10;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Signal</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=10;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Description</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=10;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Editors comment</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> SIGHUP </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> The config file will be reread. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> This is a very useful signal when you experiment with settings in the config file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> SIGTERM </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> If needed motion will create an mpeg file of the last event and exit </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> &nbsp; </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> SIGUSR1 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> Motion will create an mpeg file of the current event. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> &nbsp; </td>
</tr>
</tbody></table>
<p />
<p />
<h2><a name="Error_Logging"></a> <a href="/foswiki/bin/view/Motion/ErrorLogging">Error Logging</a> </h2>
Motion reports errors to the console when it runs in non-daemon mode. And it outputs even more information when run in setup mode.
<p />
Error logging has been implemented so that errors during daemon (background) mode are logged in the syslog.
<p />
The syslog is in most Linux systems the file <code>/var/log/messages</code> (e.g. RedHat/Fedora) or <code>/var/log/syslog</code> and <code>/var/log/user.log</code> (e.g. Debian).
<p />
<p />
<h1><a name="Motion_Guide_Basic_Features"></a> Motion Guide - Basic Features </h1>
<p />
<h2><a name="Capture_Device_Options_The_Basic"></a> <a href="/foswiki/bin/view/Motion/CaptureDeviceOptions">Capture Device Options - The Basic Setup</a> </h2>
Before you can start using motion you need to know some basics about your camera.
Either you have a camera connected directly to your computer. In this case it is a video4linux type of camera. Or you connect to a network camera using a normal web URL.
<p />
<h2><a name="video4linux_V4L_devices"></a> video4linux (<a href="/foswiki/bin/view/Motion/V4L">V4L</a>) devices </h2>
You need to install your camera with the right driver. It is out of scope of this document to tell you how to do this and it depends on which type of camera.
<p />
Once installed the camera(s) will have the device names /dev/video0, /dev/video1, /dev/video2...
<p />
FreeBSD has a different naming of devices. When you build Motion for FreeBSD the default device name is /dev/bktr0. Under FreeBSD a TV card has a special device for controlling the tuner (e.g. /dev/tuner0). The option tunerdevice is only valid when Motion is built and running under FreeBSD. For Linux do not include this option in the config file (remove or comment out).
<p />
<strong>USB cameras</strong> take a lot of bandwidth. A USB camera connected to a USB 1.1 port or hub consumes all the bandwidth. Even with a small framesize and low framerate you should not expect to have more than one camera per USB 1.1 controller. If you need more than 1 USB camera add extra USB PCI cards to your computer. There exists cards that have 4 inputs each with their own controller and with full bandwidth. Many 4-input cards only have 1 controller. USB cameras do not have the feature of selecting input channels. <em>To disable the input selection the option <a href="/foswiki/bin/view/Motion/ConfigOptionInput">input</a> must be set to the value 8 for USB cameras.</em>
<p />
<strong>Composite video cards</strong> are normally made with a chip called BT878 (older cards have a BT848). They all use the Linux driver called 'bttv'.
<p />
There are cards with more then one video input but still only one BT878 chip. They have a video multiplexer which input is selected with the config option <a href="/foswiki/bin/view/Motion/ConfigOptionInput">input</a>. Input channel numbers start at 0 (which is why the value 8 and not 0 disables input selection). There are video capture cards available with 4 or 8 inputs but only one chip. They present themselves as one single video device and you select input using the 'input' option. If you define e.g. 4 thread config files with the same videodevice name but different input numbers Motion automatically goes into round robin mode. See the <a href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument#RoundRobin" class="foswikiCurrentTopicLink">round robin</a> section for more information. Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3. Other have TV=0, composite video 1= 1, composite video = 2, S-VHS = 3. For video capture cards input 1 is normally the composite video input.
<p />
Some capture cards are specially made for surveillance with for example 4 inputs. Others have a TV tuner, a composite input (phono socket) and perhaps also a S-VHS input. For all these cards the inputs are numbered. The numbering varies from card to card so the easiest is to experiment for 5 minutes with a program that can show the videostream. Use a program such as Camstream or xawtv to experiment with the values.
<p />
If you use the TV tuner input you also need to set the frequency of the TV channel using the option <a href="/foswiki/bin/view/Motion/ConfigOptionFrequency">frequency</a>. Otherwise set 'frequency' to 0.
<p />
Finally you need to set the TV norm. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default is 0 (PAL). If your camera is a PAL black and white you may get a better result with norm=3 (PAL no colour).
<p />
If the <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamUrl">netcam_url</a> option is defined all the video4linux options are ignored so make sure the netcam_url option is commented out if you do not need it.
<p />
<strong>These are the parameters used for video4linux devices</strong>
<p />
<p />
<p />
<h3><a name="auto_brightness"></a> auto_brightness </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionAutoBrightness">Option Topic</a>
</li></ul>
<p />
Let motion regulate the brightness of a video device. Only recommended for cameras without auto brightness
<p />
Motion will try to adjust the brightness of the video device if the images captured are too dark or too light. This option will be most useful for video devices like web cams, which sometimes don't have such an option in hardware.
<p />
The auto_brightness feature will adjust the brightness of the device up or down until the value defined by the option <a href="/foswiki/bin/view/Motion/ConfigOptionBrightness">brightness</a> is reached (1 = dark, 255 = bright). If <a href="/foswiki/bin/view/Motion/ConfigOptionBrightness">brightness</a> is zero auto_brightness will try to adjust to the average brightness level 128.
<p />
You need to know if the camera supports auto brightness. Most cameras have auto everything. If your video device already does this for you this option might cause oscillations. If you do not know assume that it has and do not use the Motion auto brightness feature. At least not to start with.
<p />
<p />
<p />
<p />
<p />
<h3><a name="brightness"></a> brightness </h3> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionBrightness">Option Topic</a>
</li></ul>
<p />
The brightness level for the video device.
<p />
Value 0 means that Motion does not set the brightness value but leaves it unchanged.
<p />
If this setting is used in conjunction with the <a href="/foswiki/bin/view/Motion/ConfigOptionAutoBrightness">auto_brightness</a> feature then this setting is the average brightness level in the range 1 (dark) to 255 (bright) that the auto_brightness feature will try to achieve by adjusting the device brightness up and down.
<p />
<p />
<p />
<p />
<h3><a name="contrast"></a> contrast </h3> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionContrast">Option Topic</a>
</li></ul>
<p />
The contrast level for the video device.
<p />
Disabled (Value 0) means that Motion does not set the contrast value.
<p />
<p />
<p />
<p />
<h3><a name="framerate"></a> framerate </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 2 - 100
</li> <li> Default: 100 (no limit)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionFramerate">Option Topic</a>
</li></ul>
<p />
Maximum number of frames to be captured from the camera per second.
<p />
The faster you fetch pictures from the camera the more CPU load you get and the more pictures get included when Motion is detected.
<p />
Motion will stop storing pictures if the framerate is set to less than 2.
<p />
Set this parameter to the maximum number of images per second that you want to store either as images or as mpeg films.
<p />
To set intervals longer than one second use the 'minimum_gap' option instead.
<p />
<p />
<p />
<p />
<h3><a name="frequency"></a> frequency </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: 0 - 999999
</li> <li> Default: 0 (Not set)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionFrequency">Option Topic</a>
</li></ul>
<p />
The frequency to set the tuner to (kHz). Valid range: per tuner spec, default: 0 (Don't set it)
<p />
This option is only relevant if you have a TV tuner card where you can select the tuner frequency. Your tuner card must support this feature.
<p />
<p />
<p />
<p />
<h3><a name="height"></a> height </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: Device Dependent
</li> <li> Default: 288
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionHeight">Option Topic</a>
</li></ul>
<p />
The height of each frame in pixels.
<p />
The height of the image in pixels. Motion does not scale so should be set to the actual size of the v4l device. In case of a net camera motion sets the height to the height of the first image read.
<p />
Motion actually set the size of the image coming from the video4linux device.
<p />
Your camera or capture/TV card will not support any picture size. You must know which frame size (width and height) the camera supports. If you do not know start with width 320 and height 240 which most cameras and capture cards supports.
<p />
For some device drivers like pwc (driver for Philips USB cameras) setting the size to a non-standard value makes the driver create an image of the nearest smaller size and create a gray band around the image to fit the size given by motion. Note that it is the driver and not motion that generates the gray band. Motion will try to detect motion in the entire image including the gray band.
<p />
Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Th<54>s is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16.
<p />
<p />
<p />
<p />
<h3><a name="hue"></a> hue </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionHue">Option Topic</a>
</li></ul>
<p />
The hue level for the video device.
<p />
Normally only relevant for NTSC cameras.
<p />
<p />
<p />
<p />
<h3><a name="input"></a> input </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 7, 8 = disabled
</li> <li> Default: 8 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionInput">Option Topic</a>
</li></ul>
<p />
Input channel to use expressed as an integer number starting from 0. Should normally be set to 1 for video/TV cards, and 8 for USB cameras.
<p />
This parameter is really used only with video capture cards that has more than one input.
<p />
However if you set the input number to e.g. 1 for a USB camera (ov511 or pwc driver) motion writes an error message back. If you set it to 8 it does not give you any warning.
<p />
If you have a video capture card you can define the channel to tune to using this option. If you are using a USB device, network camera or a capture card without tuner you should set the value to the default 8.
<p />
Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3. Other have TV=0, composite video 1= 1, composite video = 2, S-VHS = 3. It is recommended to set the parameter to 8 for USB cameras as your first try. For video capture cards input 1 is normally the composite video input.
<p />
<p />
<p />
<p />
<h3><a name="minimum_frame_time"></a> minimum_frame_time </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 0
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionMinimumFrameTime">Option Topic</a>
</li></ul>
<p />
Minimum time in seconds between the capturing picture frames from the camera. Default: 0 = disabled - the capture rate is given by the camera framerate.
<p />
This option is used when you want to capture images at a rate lower than 2 per second.
<p />
When this is enabled the framerate option is used only to set the pace the Motion service the webcam port etc. Running Motion at framerate 2 is normally fine.
<p />
<img src="/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> This feature is introduced in Motion 3.2.7
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="norm"></a> norm </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour)
</li> <li> Default: 0 (PAL)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionNorm">Option Topic</a>
</li></ul>
<p />
Select the norm of the video device. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
<p />
This value is only used for capture cards using the <a href="http://bytesex.org/bttv/index.html" rel="nofollow" target="_top">BTTV driver</a>.
<p />
<p />
<p />
<p />
<h3><a name="rotate"></a> rotate </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: 0, 90, 180, 270
</li> <li> Default: 0 (not rotated)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionRotate">Option Topic</a>
</li></ul>
<p />
Rotate image the given number of degrees. The rotation affects all saved images as well as mpeg movies.
<p />
The rotation feature is used when the camera is hanging upside down (180 degrees) or if you choose a picture format in portrait instead of the normal landscape (90 or 270 degrees).
<p />
Note that the CPU load increases when using this feature with a value other than 0. Also note that Motion automatically swaps width and height if you rotate 90 or 270 degrees, so you don't have to touch these options.
<p />
<p />
<p />
<p />
<h3><a name="saturation"></a> saturation </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionSaturation">Option Topic</a>
</li></ul>
<p />
The colour saturation level for the video device.
<p />
<p />
<p />
<p />
<p />
<p />
<h3><a name="tunerdevice"></a> tunerdevice </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: /dev/tuner0
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTunerdevice">Option Topic</a>
</li></ul>
<p />
The tuner device used for controlling the tuner in a tuner card. This option is only used when Motion is compiled for <a href="/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a>.
<p />
Make sure to remove or comment out this option when running Motion under Linux.
<p />
<p />
<p />
<p />
<h3><a name="v4l2_palette"></a> v4l2_palette </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 8
</li> <li> Default: 8
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionV4L2Palette">Option Topic</a>
</li></ul>
<p />
Allow to choose preferable palette to be use by motion
to capture from those supported by your videodevice. ( new in 3.2.10 )
<p />
<!--
Add Additional Description Below
-->
<p />
i.ex if your videodevice supports <a href="/foswiki/bin/view/Motion/V4L2">V4L2</a> _PIX_FMT_SBGGR8 and <a href="/foswiki/bin/view/Motion/V4L2">V4L2</a> _PIX_FMT_MJPEG by default motion will use <a href="/foswiki/bin/view/Motion/V4L2">V4L2</a> _PIX_FMT_MJPEG so set v4l2_palette 1 to force motion use <a href="/foswiki/bin/view/Motion/V4L2">V4L2</a> _PIX_FMT_SBGGR8 instead.
<p />
Values :
<pre>V4L2&#95;PIX&#95;FMT&#95;SN9C10X : 0 &#39;S910&#39;
V4L2&#95;PIX&#95;FMT&#95;SBGGR8 : 1 &#39;BA81&#39;
V4L2&#95;PIX&#95;FMT&#95;MJPEG : 2 &#39;MJPEG&#39;
V4L2&#95;PIX&#95;FMT&#95;JPEG : 3 &#39;JPEG&#39;
V4L2&#95;PIX&#95;FMT&#95;RGB24 : 4 &#39;RGB3&#39;
V4L2&#95;PIX&#95;FMT&#95;UYVY : 5 &#39;UYVY&#39;
V4L2&#95;PIX&#95;FMT&#95;YUYV : 6 &#39;YUYV&#39;
V4L2&#95;PIX&#95;FMT&#95;YUV422P : 7 &#39;422P&#39;
V4L2&#95;PIX&#95;FMT&#95;YUV420 : 8 &#39;YU12&#39;
</pre>
<p />
<p />
<p />
<p />
<h3><a name="videodevice"></a> videodevice </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: /dev/video0 (<a href="/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a>: /dev/bktr0)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionVideodevice">Option Topic</a>
</li></ul>
<p />
The video device to be used for capturing. Default for Linux is /dev/video0. for <a href="/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a> the default is /dev/bktr0.
<p />
This is the video4linux device name. Ignore this for net cameras.
<p />
<p />
<p />
<p />
<h3><a name="width"></a> width </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: Device Dependent
</li> <li> Default: 352
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionWidth">Option Topic</a>
</li></ul>
<p />
The width in pixels of each frame. Valid range is camera dependent.
<p />
Motion does not scale so should be set to the actual size of the v4l device.
<p />
In case of a net camera motion sets the height to the height of the first image read.
<p />
Motion actually set the size of the image coming from the video4linux device.
<p />
Your camera or capture/TV card will not support any picture size. You must know which frame size (width and height) the camera supports. If you do not know start with width 320 and height 240 which most cameras and capture cards supports.
<p />
For some device drivers like pwc (driver for Philips USB cameras) setting the size to a non-standard value makes the driver create an image of the nearest smaller size and create a gray band around the image to fit the size given by motion. Note that it is the driver and not motion that generates the gray band. Motion will try to detect motion in the entire image including the gray band.
<p />
Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Th<54>s is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16.
<p />
<p />
<p />
<h2><a name="Network_Cameras"></a> Network Cameras </h2>
Motion can connect to a network camera through a normal TCP socket. All you need to give it is the URL. The URL given must return either one single jpeg picture or an mjpeg stream. For the time being Motion cannot connect to a video stream such a mpeg, mpeg4, divx. The URL must return one single jpeg image or an mjpeg stream! You can connect through a proxy server.
<p />
Also watch out that you do not use a URL that create an HTML page with an embedded jpg. What must be returned is the jpg picture itself or the raw mjpeg stream.
<p />
When the netcam_url is defined all the video4linux options above are ignored!!
<p />
If the connection to a network camera is lost - Motion will reuse the last good image for approx 30 seconds. AFter 30 seconds the image is replaced by a grey image with a text telling that the signal is lost and when the connection was lost. <em>This text and its date format is not configurable and there are no plans to make it configurable in order to keep the number config options under control.</em>
<p />
Note that Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Th<54>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.
<p />
<em>The network camera feature has been completely re-written in Motion 3.2.2. We believe the netcam feature is much more stable now that it was in previous versions. Motion tries to reconnect to the camera if the connection is lost. There is no official standard for mjpeg and we know that there are probably still some cameras that are not yet supported. If you run into a problem please file a <a href="/foswiki/bin/view/Motion/BugReports">Bug Report</a> with as much information about the format as possible. A binary raw dump of the first 2-3 frames with headers and boundary strings is very useful. You can see how to make it on the special topic <a href="/foswiki/bin/view/Motion/NetcamMjpegStreamDumps">NetcamMjpegStreamDumps</a>. When you have the file you can upload it to the same topic.</em>
<p />
<p />
<p />
<h3><a name="netcam_http"></a> netcam_http </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: 1.0, keep_alive, 1.1
</li> <li> Default: 1.0
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamHttp">Option Topic</a>
</li></ul>
<p />
The setting for keep-alive of network socket, should improve performance on compatible net cameras. ( new in 3.2.10 )
<p />
<p /> <ul>
<li> 1.0: the historical implementation using HTTP/1.0, closing the socket after each http request.
</li> <li> keep_alive: Use HTTP/1.0 requests with keep alive header to reuse the same connection.
</li> <li> 1.1: Use HTTP/1.1 requests that support keep alive as default.
</li></ul>
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="netcam_proxy"></a> netcam_proxy </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamProxy">Option Topic</a>
</li></ul>
<p />
URL to use for a netcam proxy server, if required. The syntax is <a href="http://myproxy:portnumber" rel="nofollow" target="_top">http://myproxy:portnumber</a>
<p />
Use this if you need to connect to a network camera through a proxy server.
<p />
Example of syntax: "http://myproxy.mydomain.com:1024
<p />
If the proxy port number is 80 you can ommit the port number. Then the syntax is use "http://myproxy.mydomain.com" .
<p />
Leave this option undefined if you do not use a proxy server.
<p />
<p />
<p />
<p />
<h3><a name="netcam_tolerant_check"></a> netcam_tolerant_check </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamTolerantCheck">Option Topic</a>
</li></ul>
<p />
Set less strict jpeg checks for network cameras with a poor/buggy firmware.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="netcam_url"></a> netcam_url </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamUrl">Option Topic</a>
</li></ul>
Specify an url to a downloadable jpeg file or raw mjpeg stream to use as input device. Such as an AXIS 2100 network camera.
<p />
Example of URL: http://www.gate.com/pe1rxq/jeroen.jpg.
<p />
Motion can connect to a network camera through a normal TCP socket. All you need to give it is the URL. The URL given must return either one single jpeg picture or an mjpeg stream. For the time being Motion cannot connect to a video stream such a mpeg, mpeg4, divx. The URL must return one single jpeg image or an mjpeg stream!
<p />
Also watch out that you do not use a URL that create an HTML page with an embedded jpg. What must be returned is the jpg picture itself or the raw mjpeg stream.
<p />
When the netcam_url is defined all the video4linux options are ignored!!
<p />
Motion can also fetch jpeg pictures via ftp. You then use the ftp:// syntax instead.
<p />
<p />
<p />
<p />
<h3><a name="netcam_userpass"></a> netcam_userpass </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionNetcamUserpass">Option Topic</a>
</li></ul>
<p />
For network cameras protected 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.
<p />
To use no authentication simply remove this option from the config file comment it out with "#" or ";" in front.
<p />
<p />
<p />
<p />
<a name="RoundRobin"></a>
<h2><a name="Round_Robin_feature"></a> Round Robin feature </h2>
This feature is automatically activated where multiple threads are sharing the same video device (for example /dev/video0). Each thread can then set different input channels to change camera with the <a href="/foswiki/bin/view/Motion/ConfigOptionInput">input</a> option or by tuning the tuner with <a href="/foswiki/bin/view/Motion/ConfigOptionFrequency">frequency</a> option.
<p />
<img src="/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Round Robin is not relevant for Network cameras or standard USB web cameras. The Round Robin feature is used with video capture cards which have multiple inputs per video chip.
<p />
<img src="/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Note that round robin is not the ideal way to run multiple cameras. When the capture card changes input it takes a little while before the decoder chip has syncronized to the new camera. You can improve this if you have expensive cameras with a syncronize input. Only one camera can be decoded at a time so if you have 4 cameras connected 3 of the camera threads will need to wait for their turn. The fact that cameras have to take turns and the fact that you have to skip a few frames after each turn dramatically lowers the possible framerate. You can get a high framerate by viewing each camera for a long time. But then you may miss the action on one of the inactive cameras. If you can affort it avoid Round Robin and buy the more expensive type of capture cards that has one decoder chip per input. If you only need 2 or 3 cameras you can also simply put 2 or 3 cheap TV cards in the computer. Linux has no problem working with multiple TV cards.
<p /> <ul>
<li> If multiple threads use the same video device, they each can capture <a href="/foswiki/bin/view/Motion/ConfigOptionRoundrobinFrames">roundrobin_frames</a> number of frames before having to share the device with the other threads.
</li> <li> When another thread wants to watch another input or frequency or size the first <a href="/foswiki/bin/view/Motion/ConfigOptionRoundrobinSkip">roundrobin_skip</a> number of frames are skipped to allow the device to settle.
</li> <li> The last option <a href="/foswiki/bin/view/Motion/ConfigOptionSwitchfilter">switch_filter</a> is supposed to prevent the change of camera from being detected as Motion. Its function is not perfect and sometimes prevents detection of real motion. You should start with having the option disabled and then try with the option enabled to see if you can skip less frames without loosing the detection of the type of motion you normally want to detect.
</li></ul>
<p />
<strong>These are the special Round Robin options</strong>
<p />
<p />
<p />
<h3><a name="roundrobin_frames"></a> roundrobin_frames </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 2147483647
</li> <li> Default: 1
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionRoundrobinFrames">Option Topic</a>
</li></ul>
<p />
Specifies the number of frames to capture before switching inputs, this way also slow switching (e.g. every second) is possible.
<p />
The Round Robin feature is automatically activated where multiple threads are sharing the same video device. Each thread can then set different input channels or frequencies to change camera.
<p />
If multiple threads use the same video device, they each can capture roundrobin_frames number of frames before having to share the device with the other threads.
<p />
<p />
<p />
<p />
<h3><a name="roundrobin_skip"></a> roundrobin_skip </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 2147483647
</li> <li> Default: 1
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionRoundrobinSkip">Option Topic</a>
</li></ul>
<p />
Specifies the number of frames to skip after a switch. (1 if you are feeling lucky, 2 if you want to be safe).
<p />
The Round Robin feature is automatically activated where multiple threads are sharing the same video device. Each thread can then set different input channels or frequencies to change camera.
<p />
When another thread wants to watch another input or frequency or size the first roundrobin_skip number of frames are skipped to allow the device to settle.
<p />
<p />
<p />
<p />
<h3><a name="switchfilter"></a> switchfilter </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionSwitchfilter">Option Topic</a>
</li></ul>
<p />
Turns the switch filter on or off. The filter can distinguish between most switching noise and real motion. With this you can even set roundrobin_skip to 1 without generating much false detection.
<p />
This is a round robin related feature used when you have a capture card with multiple inputs (controlled by the 'input' option) on the same videodevice.
<p />
<img src="/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> This feature was seriously broken until Motion 3.2.4
<p />
<p />
<p />
<p />
<p />
<h2><a name="Motion_Detection_Settings"></a> <a href="/foswiki/bin/view/Motion/MotionDetectionSettings">Motion Detection Settings</a> </h2>
These are the options that controls the detection of motion. Further details follows after.
<p />
<p />
<p />
<h3><a name="area_detect"></a> area_detect </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: 1 - 999999999
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionAreaDetect">Option Topic</a>
</li></ul>
<p />
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.
<p />
<!--
Add Additional Description Below
-->
<p />
Areas are numbered like that:
<p />
<pre> 1 2 3
4 5 6
7 8 9
</pre>
<p />
One or more areas can be specified with this option.
<p />
Example: You want to monitor if the center of motion occurrs in the lower third of the image - that is area 7, 8 and 9. Simply set 'area_detect' to '789' and 'on_area_detect' will be executed as soon as the center of motion was detected in area 7, 8 or 9. If you want to monitor area 2, 3, 5 and 6, set '2356'.
<p />
<p />
<p />
<p />
<h3><a name="despeckle"></a> despeckle </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: EedDl
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionDespeckle">Option Topic</a>
</li></ul>
<p />
Despeckle motion image using combinations of (E/e)rode or (D/d)ilate. And ending with optional (l)abeling.
<p />
A way of tuning (by removing or enhancing) noise in the motion image. Options for the despeckle feature are any of 'e', 'E', 'd' or 'D'. This can be combined by a trailing 'l' (letter l) which enables the labeling feature. Default: Not Defined (Don't despeckle and label).
<p />
Wind blowing grass and trees around or poor light conditions can cause a lot of dots (or noise) to appear in the motion image (See the section on Tuning Motion). This feature removes (or enhances!) this noise and so improves the reliability of motion.
<p />
The 'e' option removes diamonds, 'E' removes squares and alternating eE will remove circles. Each e/E you add will shrink the noise by a pixel all the way around. So 'despeckle Ee' will remove circles of radius 2. However, this will also shrink the detection by 2 and will affect the threshold. So to remove noise and then restore the detected motion to its original size try 'despeckle EedD'.
<p />
After the despeckle feature is done you can let the labeling feature search for areas of connected pixels and "label" each area. The program will now trigger motion based on the number of changed pixels in the largest area. In other words, the largest labeled area has to be above the threshold to trigger a motion detected.
<p />
The value EedDl is a good starting point. The possible combinations are endless and it requires many experiments to find the best combination. Just remember that the labeling feature only works as intended if it runs after the despeckle feature. Ie. the letter 'l' must be the last letter and only one 'l'.
<p />
If you have very few problems with false detections leave this option either blank or at EedD which will remove most of the single pixel noise.
A very detailed technical explanation of the despeckle part can be found at the webpage of the author of this feature <a href="http://emit.demon.co.uk/motion/" rel="nofollow" target="_top">Ian McConnell's Webcam: Motion Web Page</a>
<p />
<p />
<p />
<p />
<h3><a name="gap"></a> gap </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 60
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionGap">Option Topic</a>
</li></ul>
<p />
Gap is the seconds of no motion detection that triggers the end of an event. An event is defined as a series of motion images taken within a short timeframe.
<p />
Recommended value is 60 seconds (Default). The value 0 is allowed (but not recommended) and disables events causing all Motion to be written to one single mpeg file and no pre_capture. You can force an event to end and a new to begin using the http control 'http://host:port/thread_number/action/makemovie'. Disabling events has bad side effects on noise_tune and smartmask. Both features can only work properly outside an event. When gap is set to 0, both features don't work properly anymore.
<p />
An event is defined as a series of motion images taken within a short timeframe. E.g. a person walking through the room is an event that may have caused 10 single jpg images to be stored. This option defines how long a pause between detected motions that is needed to be defined as a new event.
<p />
The gap timer starts after the last motion is detected and post_capture images have been saved and appended to open movie mpeg files.
<p />
Any motion detected before the gap timer times out resets the gap timer so it starts counting over again.
<p />
<strong>Detailed Description</strong>
<p />
The option 'gap' is important. It defines how long a period of no motion detected it takes before we say an event is over. An event is defined as a series of motion images taken within a short timeframe. E.g. a person walking through the room is an event that may have caused 10 single jpg images to be stored. Motion detected includes post_captured frames set by the 'post_capture' option. The 'gap' option defines how long a pause between detected motions that is needed to be defined as a new event. A good starting value is 60 seconds.
<p />
The way 'gap' works in more technical terms is: <ul>
<li> Gap is a timer that timeout 'gap' seconds after the last video frame with motion is detected.
</li> <li> If 'post_capture' is activated then the gap timer starts counting after the last image of the post_capture buffer has been saved.
</li> <li> The gap timer is reset and starts all over each time new motion is detected, so you will not miss any action by having a short 'gap' value. It will just create more events (e.g. more mpegs files)
</li></ul>
<p />
The gap value impacts many functions in Motion. <ul>
<li> When the gap timer runs out the event number is increased by one next time motion is detected. When you use the %v conversion specifier in filenames or text features this means that the number in filename or text increased by one.
</li> <li> The pre_capture feature only works at the beginning of an event. So if you have a very large 'gap' value pre_capture is not working very often.
</li> <li> When you make mpegs using the ffmpeg features a new mpeg file is started at the beginning of an event when the first motion is detected. When 'gap' seconds has passed without motion (and post_captured frames saved) the mpeg files is completed and closed.
</li> <li> Do not use large gap values to generate one large mpeg4 file. If Motion stops working this mpeg4 file never gets properly completed and closed and you will not be able to view it.
</li> <li> Some of the tracking features sets the camera back to the center position when an event is over.
</li></ul>
<p />
Note that 'gap' and 'minimum_gap' have nothing to do with each other.
<p />
<p />
<p />
<p />
<h3><a name="lightswitch"></a> lightswitch </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 100
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionLightswitch">Option Topic</a>
</li></ul>
Ignore sudden massive light intensity changes given as a percentage of the picture area that changed intensity.
<p />
Experiment to see what works best for your application.
<p />
Note: From version 3.1.17 (snap release 2 and on) this option has changed from a boolean (on or off) to a number in percent between 0 and 100. Zero means the option is disabled.
<p />
The value defines the picture areas in percent that will trigger the lightswitch condition. When lightswitch is detected motion detection is disabled for 5 picture frames. This is to avoid false detection when light conditions change and when a camera changes sensitivity at low light.
<p />
<p />
<p />
<p />
<h3><a name="mask_file"></a> mask_file </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionMaskFile">Option Topic</a>
</li></ul>
<p />
PGM file to use as a sensitivity mask. This picture MUST have the same width and height as the frames being captured and be in binary format.
<p />
Full path of the PGM (portable gray map) mask file (binary format).
<p />
If you have one or more areas of the camera image in which you do NOT want motion detected (e.g. a tree that moves in the wind or a corner of the picture where you can see cars/pedestrians passing by) you need a mask file. This file is a picture that you create in your favorite photo editing program. The areas that you want detected must be white. The error that you want ignored must be black. The pgm image must be the same size (number of pixels high and wide) as the pictures that are taken by the camera (video4linux device).
<p />
You can adjust sensitivity by using gray tones.
<p />
If you do not have a mask file disable this option by not having it in the config file or comment it out ("#"or ";" as first character in line).
If you are using the <code>rotate</code> option, note that the mask is applied <em>after</em> the rotation.
<p />
<strong>Detailed Description</strong>
<p />
The mask file must be a pgm format image file (portable gray map). Note that you must choose the BINARY format.
<p />
The feature is simple. Create an image of exact the same size as the ones you get from your video device (camera). Make a purely white picture and paint the areas that you want to mask out black. You can also make gray areas where you want to lower the sensitivity to motion. Normally you will stick to pure black and white.
<p />
One easy method for generating the mask file is as follows.
<p />
You can just take a motion captured picture, edit it with black and white for the mask and save it as a pgm file.
If you cannot save in this format save as a grayscale jpg and then you can convert it to pgm format with
<p />
<code>djpeg -grayscale -pnm [inputfile] &gt; mask.pgm</code>
<p />
(assuming you have djpeg installed - part of the jpeg lib package).
<p />
Note that the mask file option masks off the detection of motion. The entire picture is still shown on the picture. This means that you cannot use the feature to mask off an area that you do not want people to see.
<p />
Below are an example of a webcam picture and a mask file to prevent the detection cars in the street.
<p />
Normal picture. Notice the street is visible through the hedge.
<p />
<img alt="normal.jpg" src="http://www.lavrsen.dk/foswiki/pub/Motion/ConfigOptionMaskFile/normal.jpg" />
<p />
Mask file (converted to png format so it can be shown by your web browser)
<p />
<table cellspacing="0" id="table11" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<tbody>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLastCol foswikiLast"> <img alt="mask1.png" src="http://www.lavrsen.dk/foswiki/pub/Motion/ConfigOptionMaskFile/mask1.png" /> </td>
</tr>
</tbody></table>
<p />
<p />
<p />
<p />
<h3><a name="max_mpeg_time"></a> max_mpeg_time </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 (infinite) - 2147483647
</li> <li> Default: 3600
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionMaxMpegTime">Option Topic</a>
</li></ul>
<p />
The maximum length of an mpeg movie in seconds. Set this to zero for unlimited length.
<p />
<p />
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="minimum_motion_frames"></a> minimum_motion_frames </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: 1 - 1000s
</li> <li> Default: 1
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionMinimumMotionFrames">Option Topic</a>
</li></ul>
<p />
Picture frames must contain motion at least the specified number of frames in a row before they are detected as true motion. At the default of 1, all motion is detected. Valid range is 1 to thousands, but it is recommended to keep it within 1-5.
<p />
Note that the picture frames are buffered by Motion and once motion is detected also the first frames containing motion are saved so you will not miss anything.
<p />
The feature is used when you get many false detections when the camera changes light sensitivity or light changes.
<p />
Experiment for best setting. Even though Motion accepts large values you should set this to a relatively low number (below 10). For each step larger than 1 Motion reserves space in RAM for the picture frame buffer. If you have a large value Motion will miss many frames from the camera while it is processing the all the pictures in the buffer.
<p />
<p />
<p />
<p />
<h3><a name="noise_level"></a> noise_level </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 255
</li> <li> Default: 32
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionNoiseLevel">Option Topic</a>
</li></ul>
<p />
The noise level is used as a threshold for distinguishing between noise and motion.
<p />
This is different from the threshold parameter. This is changes at pixel level. The purpose is to eliminate the changes generated by electric noise in the camera. Especially in complete darkness you can see the noise as small grey dots that come randomly in the picture. This noise can create false motion detection. What this parameter means is that the intensity of a pixel must change more than +/- the noise threshold parameter to be counted.
<p />
<p />
<p />
<p />
<h3><a name="noise_tune"></a> noise_tune </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionNoiseTune">Option Topic</a>
</li></ul>
<p />
Activates the automatic tuning of noise level.
<p />
This feature makes Motion continuously adjust the noise threshold for distinguishing between noise and motion. The 'noise_level' setting is ignored when activating this feature. This is a new feature and new algorithm. It may give different results depending on camera and light conditions. Report your experience with it on the Motion mailing list. If it does not work well, deactivate the 'noise_tune' option and use the manual setting of 'noise_level' instead.
<p />
<p />
<p />
<p />
<h3><a name="output_all"></a> output_all </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionOutputAll">Option Topic</a>
</li></ul>
<p />
Picture are saved continuously as if motion was detected all the time.
<p />
This feature is not meant to be the normal mode of operation. Especially not if you have the output_normal or output_motion features enabled since it will keep on saving pictures on the disk and you will soon run out of disk space. So be careful with this command.
<p />
If your frame rate is 10 pictures per second motion will save 10 new picture pr second until the disk is full.
<p />
It does all the normal actions that are done when motion is detected. It saves pictures on the harddisk, execute external scripts, etc as fast as the frame rate of the camera. So it is probably a good idea to run with a low framerate when using this feature and to not use activate all the features that saves files on the disk.
<p />
The idea of this feature is that you can turn the feature on and off for a short period of time to test or to generate continuous mpeg films when needed.
<p />
<p />
<p />
<p />
<h3><a name="post_capture"></a> post_capture </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionPostCapture">Option Topic</a>
</li></ul>
<p />
Specifies the number of frames to be captured after motion has been detected.
<p />
The purpose of this is mainly to create smooth video clips each time motion is detected. Use it to you personal taste (and disk space)..
<p />
This option is the preferred way to create continuous movies. Post_capture does not consume extra RAM and it does not create pauses in the movie even with large values.
<p />
If you only store mpegs movies and do not have output_normal on, then the recommended post_capture value is what is equivalent to 1-5 seconds of movie.
<p />
<p />
<p />
<p />
<h3><a name="pre_capture"></a> pre_capture </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 100s
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionPreCapture">Option Topic</a>
</li></ul>
<p />
Specifies the number of previous frames to be outputted at motion detection. Recommended range: 0 to 5, default=0. Do not use large values! Large values will cause Motion to skip video frames and cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead.
<p />
Motion buffers the number of picture frames defined by 'pre_capture'. When motion is detected the pictures in the buffer are included in the video clip generated by ffmpeg. The effect is that it seems the program knew in advance that the event was going to take place and started the recording before it actually happened. This is a nice feature that give more complete video clips of an event.
<p />
If pre_capture is set to 0 the feature is disabled. Keep this value below 5.
<p />
The recommended value would be approx 0.5 second of video so the value should be defined so it fits the framerate and the desired pre-capture time. E.g. 0.5 second at 20 frames pr second would mean a value of 5. You should never use a value larger than 10.
<p />
You can in theory have up to 100s of pre-captured frames but naturally this makes motion leave a larger footprint in the memory of the computer. More important Motion is processing all the buffered images including saving jpegs, encoding mpegs, writing to databases and executing external programs after the first image is detected as Motion.
<p />
Motion will not grab another image until this is done. This means that even moderate values for pre_capture combined with high framerates will mean that you will miss quite many frames of Motion. It is therefore recommended to use relative small values for pre_capture. Depending on your chosen framerate and depending on the features enabled values from 1-5 are sensible.
<p />
If you wish to create smooth mpegs during events using large pre_capture values will do the opposite! It will create a long pause where a lot of action is missed.
<p />
To get a smooth mpeg use a large value for <a href="/foswiki/bin/view/Motion/ConfigOptionPostCapture">post_capture</a> which does not cost any performance hit or RAM space.
<p />
<p />
<p />
<p />
<h3><a name="smart_mask_speed"></a> smart_mask_speed </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 10
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionSmartMaskSpeed">Option Topic</a>
</li></ul>
<p />
Slugginess of the smart mask. Default is 0 = DISABLED. 1 is slow, 10 is fast.
<p />
Smartmask is a dynamic, self-learning mask. Smartmask will disable sensitivity in areas with frequent motion (like trees in the wind). Sensitivity is turned on again after some time of no more motion in this area. The built mask is a bit larger at the borders than the actual motion was. This way smartmask works more reliable when sudden moves occur under windy conditions.
<p />
smart_mask_speed - tunes the slugginess of the mask. It accepts values from 0 (turned off) to 10 (fast). Fast means here that the mask is built quick, but it is also not staying very long with no more motion. Slow means that it takes a while until the mask is built but it also stays longer. A good start value for smart_mask_speed is 5. This setting is independent from the framerate. The attack and decay time is constant over all available framerates.
<p />
When smartmask is enabled and motion is also configured to either write motion-images or motion-mpegs, the current smartmask is copied as an overlay into the black/white motion-pictures/mpegs in red colour. Same thing happens to the webcam stream when Motion runs in <a href="/foswiki/bin/view/Motion/ConfigOptionSetupMode">setup_mode</a>. That way you can easily adjust smart_mask_speed.
<p />
<strong>Detailed Description</strong>
<p />
The <a href="/foswiki/bin/view/Motion/ConfigOptionMaskFile">mask_file</a> option provides a static mask to turn off sensitivity in certain areas. This is very usefull to mask a street with cars passing by all day long etc...
<p />
But imagine a scenario with large bushes and big trees where all the leaves are moving in the wind also triggering motion from time to time even with despeckle turned on. Of course you can also define a static mask here, but what if the bushes are growing during spring and summer? Well, you have to adapt the mask from time to time. What if the camera position moves slightly? What if someone grows new plants in your garden? You always have to setup a new static mask.
<p />
The answer to this problem is the smart mask feature introduced in Motion 3.1.18. A dynamic, self-learing mask.
<p />
Smart mask will disable sensitivity in areas with frequent motion (like trees in the wind). Sensitivity is turned on again after some time of no more motion in this area. The built mask is a bit larger at the borders than the actual motion. This way smartmask works more reliably when sudden moves occur under windy conditions.
<p />
<p />
<p />
<p />
<p />
<h3><a name="threshold"></a> threshold </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 2147483647
</li> <li> Default: 1500
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionThreshold">Option Topic</a>
</li></ul>
<p />
Threshold for declaring motion. The threshold is the number of changed pixels counted after noise filtering, masking, despeckle, and labelling.
<p />
The 'threshold' option is the most important detection setting. When motion runs it compares the current image frame with the previous and counts the number of changed pixels after having processed the image with noise filtering, masking, despeckle and labeling. If more pixels than defined by 'threshold' have changed we assume that we have detected motion. Set the threshold as low as possible so that you get the motion you want detected but large enough so that you do not get detections from noise and plants moving. Note that the larger your frames are, the more pixels you have. So for large picture frame sizes you need a higher threshold.
<p />
Use the -s (setup mode) command line option and/or the text_changes config file option to experiment to find the right threshold value. If you do not get small movements detected (see the mouse on the kitchen floor) lower the value. If motion detects too many birds or moving trees, increase the number. Practical values would be from a few hundred to 2000 indoors and 1000-10000 outdoors.
<p />
<p />
<p />
<p />
<h3><a name="threshold_tune"></a> threshold_tune </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionThresholdTune">Option Topic</a>
</li></ul>
<p />
Activates the automatic tuning of threshold level. ( It's broken )
<p />
This feature makes Motion continuously adjust the threshold for declaring motion.
<p />
The <a href="/foswiki/bin/view/Motion/ConfigOptionThreshold">threshold</a> setting is ignored when activating this feature. It may give different results depending on your camera, light conditions, indoor/outdoor, the motion to be detected etc. If it does not work well, deactivate the 'threshold_tune' option and use the manual setting of <a href="/foswiki/bin/view/Motion/ConfigOptionThreshold">threshold</a> instead.
<p />
<p />
<p />
<p />
<p />
<h2><a name="Image_File_Output"></a> <a href="/foswiki/bin/view/Motion/ImageFileOutput">Image File Output</a> </h2>
The following options controls how Motion generates images when detection motion.
<p />
<p />
<p />
<h3><a name="output_motion"></a> output_motion </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionOutputMotion">Option Topic</a>
</li></ul>
<p />
Output pictures with only the moving object. This feature generates the special motion type movies where you only see the pixels that changes as a graytone image. If labelling is enabled you see the largest area in blue. Smartmask is shown in red.
<p />
Motion images shows the motion content of the pictures. This is good for tuning and testing but probably not very interesting for the general public.
<p />
Default is not to store motion images. Motion pictures are stored the same place and with the same filename as normal motion triggered pictures except they have an "m" appended at the end of the filename before the .jpg or .ppm. E.g. the name can be 01-20020424232936-00m.jpg.
<p />
<p />
<p />
<p />
<h3><a name="output_normal"></a> output_normal </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: on, off, first, best, center (since 3.2.10)
</li> <li> Default: on
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionOutputNormal">Option Topic</a>
</li></ul>
<p />
Normal image is an image that is stored when motion is detected. It is the same image that was taken by the camera. I.e. not a motion image like defined by output_motion. Default is that normal images are stored.
<p />
If you set the value to 'first' Motion saves only the first motion detected picture per event.
<p />
If you set it to "best" Motion saves the picture with most changed pixels during the event. This is useful if you store mpegs on a webserver and want to present a jpeg to show the content of the mpeg on a webpage. "best" requires a little more CPU power and resources compared to "first".
<p />
Picture with motion nearest center of picture is saved when set to 'center' (since 3.2.10).
<p />
Set to 'off' to not write pictures (jpeg or ppm).
<p />
<p />
<p />
<p />
<h3><a name="ppm"></a> ppm </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionPpm">Option Topic</a>
</li></ul>
<p />
Output ppm images instead of jpeg. This uses less CPU time, but causes a LOT of hard disk I/O, and it is generally slower than jpeg.
<p />
The recommendation is to always use jpg except if you have a specific need to store high quality pictures without any quality loss. For web cameras you should always choose jpg. Note that the built in webcam server requires that this parameter is set to off.
<p />
<p />
<p />
<p />
<h3><a name="quality"></a> quality </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 100
</li> <li> Default: 75
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionQuality">Option Topic</a>
</li></ul>
<p />
The quality for the jpeg images in percent.
<p />
100 means hardly compressed. A small number means a much smaller file size but also a less nice quality image to look at. 50 is a good compromise for most.
<p />
<p />
<p />
<p />
<p />
<p />
<h2><a name="Tuning_Motion"></a> <a href="/foswiki/bin/view/Motion/TuningMotion">Tuning Motion</a> </h2>
<p />
Motion 3.2 introduces a new feature Setup Mode. This is a great new feature with really make tuning all the settings of Motion much more easy and transparent. In setup mode two things happen:
<p /> <ol>
<li> With 'motion -s' Motion runs in console mode instead of daemon. It outputs a lot of useful information for each frame from the camera. Each message is prefixed by [number] where number is the camera number (thread number).
</li> <li> When you look at the mjpeg webcam stream you see a black image with numbers. What you see is the number of changed pixels, number of labeled areas and noise setting. When something moves you see the pixels detected as Motion in black and white. The largest labelled area (assuming despeckle is enabled and with the 'l' at the end) is blue. It is only the blue areas which is counted as Motion. If smartmask is enabled you see this as red areas.
</li></ol>
<p />
Here is a suggestion how to initially setup Motion.
<p /> <ul>
<li> Disable despeckle (comment it out in motion.conf).
</li> <li> Disable smartmask
</li> <li> Enable both http control and webcam by setting port numbers. Example 8080 for control and 8081 for webcam.
</li> <li> Start Motion in setup mode
</li> <li> View the webcam stream. Either with Cambozola or with Firefox. <a href="http://localhost:8081/" rel="nofollow" target="_top">http://localhost:8081/</a> Firefox often needs to reload the page before it works. Bug in Firefox. Internet Explorer cannot show the stream unless you make a webpage on your Apache with Cambozola applet.
</li> <li> Open new browser window and connect to the http interface. <a href="http://localhost:8080/" rel="nofollow" target="_top">http://localhost:8080/</a> . You can now control and change almost anything while Motion is running. You cannot resize the image. That was too hard to code. To disable a feature enter a space.
</li> <li> Start by experimenting with noise level. Do this both during daylight and during darkness. You will be surprised to see how much noise a camera makes during night. Try using the automatic noise feature. It should work for most.
</li> <li> Now try the despeckle feature. Enable it using the recommended default EedDl. If this is not enough experiment. Remember that the l must be the last letter. It is fun to play with.
</li> <li> Set the threshold to what you want to trigger Motion.
</li></ul>
<p />
In normal mode you can use the same setting with two browser windows and experiment with settings of the camera if needed.
<p />
From the web interface you can ask Motion to write all your changes back to the config files (motion.conf and thread config files). It will even tidy them up for you so they look nice.
<p />
There are two sets of options to adjust. <ul>
<li> The options that controls the camera device: See <a href="/foswiki/bin/view/Motion/CaptureDeviceOptions">CaptureDeviceOptions</a>
</li> <li> The options that controls the actual motion detection: <a href="/foswiki/bin/view/Motion/MotionDetectionSettings">MotionDetectionSettings</a>
</li></ul>
<p />
<hr />
<p />
Normal picture frame
<p />
<img alt="outputnormal1.jpg" src="http://www.lavrsen.dk/foswiki/pub/Motion/TuningMotion/outputnormal1.jpg" />
<p />
<hr />
Motion type picture frame with despeckle. Note that the largest area is blue and only this is counted as Motion.
<p />
The Motion image shows how Motion maintains a "reference frame" which is not just the last picture frame but a matematical calculation of the past images. This enlarges real Motion and ensures that it is not easy to sneak in slowly.
<p />
<img alt="outputmotion1.jpg" src="http://www.lavrsen.dk/foswiki/pub/Motion/TuningMotion/outputmotion1.jpg" />
<hr />
<p />
<p />
<h2><a name="Generating_MPEG_films_with_ffmpe"></a> <a href="/foswiki/bin/view/Motion/MpegFilmsFFmpeg">Generating MPEG films with ffmpeg</a> </h2>
The ffmpeg option can generate mpeg films very fast and "on the fly". This means that the mpeg film is growing each time motion is detected.
<p />
Some people on the Motion mailing list have had trouble building the ffmpeg package because they did not have the NASM assembler package installed. So pay attention to this if you run into problems.
<p />
ffmpeg exists as binary packages for most distributions including RPMs and debian packages.
<p />
Ffmpeg is an interesting project. The releases have not been very consistent over time. The official releases are out of date now. So we are forced to take our chance and checkout a version from their CVS server and hope that we are lucky in getting a version that works. See <a href="http://ffmpeg.sourceforge.net" rel="nofollow" target="_top">ffmpeg project page</a>. We encourage the maintaners of such an important project to introduce better release schedules in the near future for the benefit of opensource software.
<p />
In order to help people finding a version of ffmpeg that works we have started testing the Motion package with a selection of binaries and a CVS snapshot. The CVS source snapshot of ffmpeg which is certified with Motion is available on the <a href="http://sourceforge.net/project/showfiles.php?group_id=13468&amp;package_id=116390" rel="nofollow" target="_top">Related projects file area on the Motion Sourceforge project</a>
<p />
Motion works with the following versions of ffmpeg: <ul>
<li> ffmpeg-0.4.8. With this release Motion supports mpeg1, mpeg4 and msmpeg4. Lately newer distributions have problems building this 2003 release of ffmpeg so many of you no longer have this option.
</li> <li> ffmpeg-0.4.9pre1. Is supported starting from Motion version 3.1.18. With this release Motion supports mpeg4 and msmpeg4 but not mpeg1. The reason is that the ffmpeg team has decided no longer to support non-standard framerates in their mpeg1 encoder library. Also ffmpeg-0.4.9pre1 gives people problems on newer distributions.
</li> <li> ffmpeg from CVS. This may work. We cannot continuously monitor and try every time a new source file is checked into ffmpeg. You will have to try.
</li> <li> ffmpeg RPMs. Currently each Motion release is tested with the current Livna ffmpeg rpm package for Fedora. See the <a href="/foswiki/bin/view/Motion/DownloadFiles">Download Files</a> page for direct links to the version which has been certified with the latest Motion release.
</li> <li> ffmpeg debian binaries. Latest versions from the debian repository for Debian Sarge works fine with Motion.
</li> <li> Certified ffmpeg CVS snapshot for latest Motion release is available from the <a href="http://sourceforge.net/project/showfiles.php?group_id=13468&amp;package_id=116390" rel="nofollow" target="_top">Motion Sourceforge Related Projects file area</a>
</li></ul>
<p />
The timelapse feature always runs mpeg1 with both ffmpeg 0.4.8 and 0.4.9 and newer. Motion simply creates the timelapse film with a standard mpeg1 framerate. <font color="#ff0000"> Note : maximum size for timelapse files is 2GB. </font>
<p />
In principle Motion can be made to support many other formats. It requires additional coding in Motion. You are welcome to submit <a href="/foswiki/bin/view/Motion/MotionPatches">patches</a>. All ffmpeg related code is in the source file ffmpeg.c. It is not trivial to do because the ffmpeg libraries not documented at all. All you have is a couple of code examples.
<p />
To build ffpmeg from source follow these steps:
<p />
Download the ffmpeg and untar it to /usr/local/ffmpeg. Then it should be a simple matter of entering the ffmpeg directory and run the commands
<p />
<pre>
cd /usr/local/ffmpeg
./configure --enable-shared
make
make install
</pre>
<p />
This creates the <code>libavcodec.so</code> and <code>libavformat.so</code> libraries under <code>/usr/local/lib</code> and header files under <code>/usr/local/include/ffmpeg</code>.
<p />
You probably need to do one more step.
<p />
Make sure you have 'root' privileges for the next steps.
<p />
Open the file <code>/etc/ld.so.conf</code> in your favorite text editor.
<p />
Add this line of text if it is not already there - otherwise go to the next step (ldconfig).
<p />
<code>/usr/local/lib</code>
Run the command <code>ldconfig</code>.
<p />
Motion should now be able to find the shared libraries for ffmpeg (<code>libavcodec.so</code> and <code>libavformat.so</code>) in <code>/usr/local/lib</code>.
<p />
You can also find a pre-compiled binary package (e.g. rpm or deb) and install this. Normally an rpm will place the <code>libavcodec.so</code> under <code>/usr/lib</code>.
There are various RPMs available from different repositories. Some need additional RPMs that are actually not needed by Motion but need to be installed to satisfy dependencies. The editor has tried different RPMs of ffmpeg-0.4.8 and they all seem to work.
<p />
Motion then need to be built by running <code>./configure</code>, <code>make</code> and <code>make install</code>.
(Note that with earlier versions of motion you had to specify the location of libavcodec. Now configure searches for the shared library in <code>/usr/lib</code> and <code>/usr/local/lib</code> by default.)
<p />
Note that if you install ffmpeg from source and already have ffmpeg installed from an RPM, the Motion configure may very well find the binary library from the rpm instead of the sources. Make sure to uninstall any old ffmpeg RPMs before you install ffmpeg from sources.
<p />
<strong>These are the config file options related to ffmpeg.</strong>
<p />
<p />
<p />
<h3><a name="ffmpeg_bps"></a> ffmpeg_bps </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 9999999
</li> <li> Default: 400000
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegBps">Option Topic</a>
</li></ul>
<p />
Bitrate of mpegs produced by ffmpeg. Bitrate is bits per second. Default: 400000 (400kbps). Higher value mans better quality and larger files. Option requires that ffmpeg libraries are installed.
<p />
To use this feature you need to install the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg Streaming Multimedia System</a>.
<p />
Experiment to get the desired quality. The better quality the bigger files. This option is ignored if ffmpeg_variable_bitrate is not 0 (disabled).
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_cap_motion"></a> ffmpeg_cap_motion </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegCapMotion">Option Topic</a>
</li></ul>
<p />
Use ffmpeg libraries to encode motion type mpeg movies where you only see the pixels that changes.
<p />
Works like ffmpeg_cap_new but outputs motion pixel type pictures instead.
<p />
This feature generates the special motion type movie where you only see the pixels that changes as a graytone image. If labelling is enabled you see the largest area in blue. Smartmask is shown in red. The filename given is the same as the normal mpegs except they have an 'm' appended after the filename before the .mpg. E.g. 20040424181525m.mpg
<p />
To use this feature you need to install the FFmpeg Streaming Multimedia System
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_cap_new"></a> ffmpeg_cap_new </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegCapNew">Option Topic</a>
</li></ul>
<p />
Use ffmpeg libraries to encode mpeg movies in realtime.
<p />
Generates a new film at the beginning of each new event and appends to the film for each motion detected within the same event. The current event ends when the time defined by the 'gap' option has passed with no motion detected. At the next detection of motion a new mpeg film is started.
<p />
To use this feature you need to install the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg Streaming Multimedia System</a>
<p />
Must not be included in config file without having ffmpeg installed.
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_deinterlace"></a> ffmpeg_deinterlace </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegDeinterlace">Option Topic</a>
</li></ul>
<p />
Use ffmpeg to deinterlace video. Necessary if you use an analog camera and see horizontal combing on moving objects in video or pictures.
<p />
To use this feature you need to install the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg Streaming Multimedia System</a>
<p />
Must not be included in config file without having ffmpeg installed.
<p />
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_timelapse"></a> ffmpeg_timelapse </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegTimelapse">Option Topic</a>
</li></ul>
<p />
Create a timelapse movie saving a picture frame at the interval in seconds set by this parameter. Set it to 0 if not used.
<p />
This feature uses ffmpegs libavcodec to encode a timelaps movie saving a picture frame at the interval in seconds set by this parameter. Setting this option to 0 disables it.
<p />
The feature gives your viewer the chance to watch the day pass by. It makes a nice effect to film flowers etc closeup during the day. Options like frame_rate, snapshot, gap etc have no impact on the ffmpeg timelapse function.
<p />
Note that the timelapse format is always mpeg1 independent of ffmpeg_video_codec. This is because mpeg1 allows the timelapse to stop and the file to be reopened and more film appended.
<p />
To use this feature you need to install the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg Streaming Multimedia System</a>.
<p />
(renamed from ffmpeg_timelaps to ffmpeg_timelapse in 3.1.14)
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_timelapse_mode"></a> ffmpeg_timelapse_mode </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: hourly, daily, weekly-sunday, weekly-monday, monthly, manual
</li> <li> Default: daily
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegTimelapseMode">Option Topic</a>
</li></ul>
<p />
The file rollover mode of the timelapse video.
<p />
Note that it is important that you use the conversion specifiers in ffmpeg_filename that ensure that the new timelapse file indeed is a new file. If the filename does not change Motion will simply append the timelapse pictures to the existing file.
<p />
The value 'Manual' means that Motion does not automatically rollover to a new filename. You can do it manually using the http control interface by setting the option 'ffmpeg_timelapse' to 0 and then back to your chosen value. Value 'hourly' rolls over on the full hour. Value 'daily' which is the default rolls over at midnight. There are two weekly options because depending on where you come from a week may either start on Sunday or Monday. And 'monthly' naturally rolls over on the 1st of the month.
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_variable_bitrate"></a> ffmpeg_variable_bitrate </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0, 2 - 31
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegVariableBitrate">Option Topic</a>
</li></ul>
<p />
Enables and defines variable bitrate for the ffmpeg encoder. ffmpeg_bps is ignored if variable bitrate is enabled. Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps, or the range 2 - 31 where 2 means best quality and 31 is worst.
<p />
Experiment for the value that gives you the desired compromise between size and quality.
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_video_codec"></a> ffmpeg_video_codec </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: mpeg1 (ffmpeg-0.4.8 only), mpeg4, msmpeg4, swf, flv, ffv1, mov
</li> <li> Default: mpeg4
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegVideoCodec">Option Topic</a>
</li></ul>
<p />
Codec to be used by ffmpeg for the video compression. Timelapse mpegs are always made in mpeg1 format independent from this option.
<p /> <ul>
<li> mpeg1 - gives you mpeg1 files with extension .mpg. It is only supported by the old ffmpeg version 0.4.8. The ffmpeg team decided no longer to support non-standard framerates for mpeg1 from ffmpeg version 0.4.9pre1.
</li> <li> mpeg4 - gives you mpeg4 files with extension .avi
</li> <li> msmpeg4 - also gives you mpeg4 files. It is s recommended for use with Windows Media Player because it requires with no installation of codec on the Windows client.
</li> <li> swf - gives you a flash film with extension .swf
</li> <li> flv - gives you a flash video with extension .flv
</li> <li> ffv1 - FF video codec 1 for Lossless Encoding (experimental)
</li> <li> mov - QuickTime (since 3.2.10).
</li></ul>
<p />
This option does not affect the timelapse feature. Timelapse is always recorded in mpeg1 format because we need to be able to append to an existing file. mpeg4 does not easily allow this.
<p />
<p />
<p />
<hr />
<p />
See also the section <a href="/foswiki/bin/view/Motion/AdvancedFilenames">Advanced Filenames</a> where the two additional options <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegFilename">ffmpeg_filename</a> and <a href="/foswiki/bin/view/Motion/ConfigOptionTimelapseFilename">timelapse_filename</a> are defined.
<p />
If you want to use this feature you can read about the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg Streaming Multimedia System</a>
<p />
<p />
<h2><a name="Snapshots_The_Traditional_Period"></a> <a href="/foswiki/bin/view/Motion/SnapshotsWebCam">Snapshots - The Traditional Periodic Web Camera</a> </h2>
Motion can also act like a traditional web camera.
<p />
<p />
<p />
<h3><a name="snapshot_interval"></a> snapshot_interval </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionSnapshotInterval">Option Topic</a>
</li></ul>
<p />
Make automated snapshots every 'snapshot_interval' seconds.
<p />
The snapshots are stored in the target directory + the directory/filename specified by the <a href="/foswiki/bin/view/Motion/ConfigOptionSnapshotFilename">snapshot_filename</a> option.
<p />
This is the traditional web camera feature where a picture is taken at a regular interval independently of motion in the picture.
<p />
<p />
<p />
See the also <a href="/foswiki/bin/view/Motion/ConfigOptionSnapshotFilename">snapshot_filename</a> option in the section <a href="/foswiki/bin/view/Motion/AdvancedFilenames">Advanced Filenames</a>.
<p />
<p />
<h2><a name="Text_Features"></a> <a href="/foswiki/bin/view/Motion/TextFeatures">Text Features</a> </h2>
Text features are highly flexible. You can taylor the text displayed on the images and films to your taste and you can add your own user defined text.
<p />
This is how the overlayed text is located.
<p />
<table border="1" width="354">
<tr>
<td width="344">
<table cellpadding="0" cellspacing="0" width="344">
<tr>
<td width="216">
<p>&nbsp;&nbsp;<br><br><br><br><br><br>&nbsp;</p>
</td>
<td width="128">
<p align="right">&nbsp;CHANGES<br><br><br><br><br><br>&nbsp;</p>
</td>
</tr>
<tr>
<td width="216">
<p><br><br>TEXT_LEFT</p>
</td>
<td width="128">
<p align="right">TEXT_RIGHT<br>YYYY-MM-DD<br>HH:MM:SS&nbsp;</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p />
You are allowed to put the text in quotation marks. This allows you to use leading spaces. By combining spaces and new lines '\n' you can place your text anywhere on the picture. Experiment to find your preferred look. When setting the text using http remote control the text must be URL encoded. The browser does this for you. If you need to set it with a command line tool, use a browser first and let it make the encoded URL for you. Then you can copy paste it to your script file or cron line or whatever you want to use.
<p />
Below are the options that controls the display of text. The 'locate' option is not a text feature but described here because it is related to information overlayed on the output images.
<p />
The <code>text_event</code> feature is special in that it defines the conversion specifier %C which can be used both for text display and for filenames.
<p />
<p />
<p />
<h3><a name="locate"></a> locate </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off, preview
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionLocate">Option Topic</a>
</li></ul>
<p />
Locate and draw a box around the moving object. Value 'preview' makes Motion only draw a box on a saved preview jpeg image and not on the saved mpeg movie.
<p />
The value 'preview' only works when 'output_normal' is set to either 'first' or 'best'.
<p />
<p />
<p />
<p />
<h3><a name="text_changes"></a> text_changes </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTextChanges">Option Topic</a>
</li></ul>
<p />
Turns the text showing changed pixels on/off.
<p />
By setting this option to 'on' the number of pixels that changed compared to the reference frame is displayed in the upper right corner of the pictures. This is good for calibration and test. Maybe not so interesting for a greater public. Set it to your personal taste.
<p />
<p />
<p />
<p />
<h3><a name="text_double"></a> text_double </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li></ul>
<p />
Draw characters at twice normal size on images.
<p />
This option makes the text defined by text_left, text_right and text_changes twice the normal size. This may be useful when using large picture formats such as 640 x 480.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="text_event"></a> text_event </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %Y%m%d%H%M%S
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTextEvent">Option Topic</a>
</li></ul>
<p />
This option defines the value of the speciel event conversion specifier %C. You can use any conversion specifier in this option except %C. Date and time values are from the timestamp of the first image in the current event.
<p />
The idea is that %C can be used filenames and text_left/right for creating a unique identifier for each event.
<p />
Option text_event defines the value %C which then can be used in filenames and text_right/text_left. The text_event/%C uses the time stamp for the first image detected in a new event. %C is an empty string when no event is in progress (gap period expired). Pre_captured and minimum_motion_frames images are time stamped before the event happens so %C in text_left/right does not have any effect on those images.
<p />
<p />
<p />
<p />
<h3><a name="text_left"></a> text_left </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTextLeft">Option Topic</a>
</li></ul>
<p />
User defined text overlayed on each in the lower left corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # &lt; &gt; , . : - + _ \n and vertical bar and <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> (codes starting by a %).
<p />
text_left is displayed in the lower left corner of the pictures. If the option is not defined no text is displayed at this position.
<p />
You can place the text in quotation marks to allow leading spaces. With a combination is spaces and newlines you can position the text anywhere on the picture.
<p />
<strong>Detailed Description</strong>
<p />
A conversion specifier is a code that starts by % (except newline which is \n). The <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
With a combination of text, spaces, new lines \n and conversion specifiers you have some very flexible text features.
<p />
For a full list of conversion specifiers see the section <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> for Advanced Filename and Text Feature.
<p />
<p />
<p />
<p />
<p />
<h3><a name="text_right"></a> text_right </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %Y-%m-%d\n%T
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTextRight">Option Topic</a>
</li></ul>
<p />
User defined text overlayed on each in the lower right corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # &lt; &gt; , . : - + _ \n and vertical bar and <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> (codes starting by a %). Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
<p />
text_right is displayed in the lower right corner of the pictures. If the option is not defined no text is displayed at this position.
<p />
You can place the text in quotation marks to allow leading spaces. With a combination is spaces and newlines you can position the text anywhere on the picture.
<p />
A major difference from text_left is that if this option is undefined the default is %Y-%m-%d\n%T which displays the date in ISO format YYYY-MM-DD and below the time in 24 hour clock HH:MM:SS.
<p />
<strong>Detailed Description</strong>
<p />
A conversion specifier is a code that starts by % (except newline which is \n). The <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
With a combination of text, spaces, new lines \n and conversion specifiers you have some very flexible text features.
<p />
For a full list of conversion specifiers see the section <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> for Advanced Filename and Text Feature.
<p />
<p />
<p />
<p />
<p />
<h2><a name="Advanced_Filenames"></a> <a href="/foswiki/bin/view/Motion/AdvancedFilenames">Advanced Filenames</a> </h2>
Motion has a very advanced and flexible automated filenaming feature.
<p />
By using <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> (codes that consist of a '%' followed by a letter) you can build up the filenames including sub directories for pictures and movies using any combination of letters, numbers and conversion specifiers which are codes that represents time, date, event number and frame numbers.
<p />
The option <code>target_dir</code> is the target directory for all snapshots, motion images and normal images. The default is the current working directory (current working directory of the terminal from which motion was started). You will normally always want to specify this parameter.
<p />
Note that the options <code>snapshot_filename</code>, <code>jpeg_filename</code>, <code>ffmpeg_filename</code>, and <code>timelapse_filename</code> all allow specifying directories by using '/' in the filename. These will all be relative to <code>target_dir</code>. This means in principle that you can specify <code>target_dir</code> as '/' and be 100% flexible. It also means that Motion can write files all over your harddisk if you make a mistake. It is recommended to specify the <code>target_dir</code> as deep or detailed as possible for this reason. And note that <code>targer_dir</code> does not allow conversion specifiers.
<p />
The conversion specifier %C which is defined by the option <a href="/foswiki/bin/view/Motion/ConfigOptionTextEvent">text_event</a> is interesting in connection with filenames because it can be used to create files and directories for each event in a very flexible way.
<p />
The convertion specifier %t (thread/camera number) is also very useful. Here is an example of filename definitions in motion.conf:
<p />
<pre>
target&#95;dir /usr/local/webcam
snapshot&#95;filename cam&#37;t/&#37;v-&#37;Y&#37;m&#37;d&#37;H&#37;M&#37;S-snapshot
jpeg&#95;filename cam&#37;t/&#37;v-&#37;Y&#37;m&#37;d&#37;H&#37;M&#37;S-&#37;q
ffmpeg&#95;filename cam&#37;t/&#37;v-&#37;Y&#37;m&#37;d&#37;H&#37;M&#37;S
timelapse&#95;filename cam&#37;t/&#37;Y&#37;m&#37;d&#37;H-timelapse
</pre>
<p />
The smart thing is that this defines the filename of all your camera threads in motion.conf so you do not need to specify target dir and filenames in the thread config files. In the above example an mpegfile for camera thread 3 will be saved as a filename similar to <code>/usr/local/webcam/cam3/28-20051128130840.avi</code>
<p />
NOTE: Unless you use the <code>minimum_gap</code> option to limit the number of shots to less then one per second - you must use the frame modifier %q as part of the <code>jpeg_filename</code>. Otherwise the pictures saved within the same second will overwrite each other. The %q in <code>jpeg_filename</code> ensures that each jpeg (or ppm) picture saved gets a unique filename.
<p />
<img src="/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Security Warning! Note that the flexibility of this feature also means you have to pay attention to the following. <ul>
<li> Anyone with access to the remote control port (http) can alter the values of these options and save files anywhere on your server with the same privileges as the user running Motion. Anyone can access your control port if you have not either limited access to localhost or limited access using firewalls in the server. You should always have a router between a machine running Motion with remote control enabled and the Internet and make sure the Motion control port is not accessible from the outside.
</li> <li> Anyone with local access to the computer and edit rights to the motion.conf file can alter the values of these options and save files anywhere on your server with the same privileges as the user running Motion. Make sure the motion.conf file is maximum readonly to anyone else but the user running Motion.
</li> <li> It is a good idea to run Motion as a harmless user. Not as root.
</li></ul>
<p />
<strong>These are the advanced filename options in motion.conf</strong>
<p />
<p />
<p />
<h3><a name="ffmpeg_filename_now_called_movie"></a> ffmpeg_filename (now called movie_filename) </h3>
<p />
<img src="/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> <font color="#ff0000">This option was renamed to <a href="/foswiki/bin/view/Motion/ConfigOptionMovieFilename">movie_filename</a> in 3.2.5 to enable better integration of alternative movie libraries to the current ffmpeg solution.</font>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %v-%Y%m%d%H%M%S
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionFfmpegFilename">Option Topic</a>
</li></ul>
<p />
File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This option was renamed to movie_filename in 3.2.5 to enable better integration of alternative movie libraries to the current ffmpeg solution.
<p />
Default value is equivalent to legacy 'oldlayout' option
For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H%M%S
<p />
File extension .mpg or .avi is automatically added so do not include this.
<p />
This option uses <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S for 'oldlayout on' and %Y/%m/%d/%H%M%S for 'oldlayout off'.
<p />
<p />
<p />
<p />
<h3><a name="jpeg_filename"></a> jpeg_filename </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %v-%Y%m%d%H%M%S-%q
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionJpegFilename">Option Topic</a>
</li></ul>
<p />
File path for motion triggered images (jpeg or ppm) relative to target_dir. Value 'preview' makes a jpeg filename with the same name body as the associated saved mpeg movie file.
<p />
Default value is equivalent to legacy 'oldlayout' option. For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H/%M/%S-%q
<p />
This option uses <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S-%q for 'oldlayout on' and %Y/%m/%d/%H/%M/%S-%q for 'oldlayout off'.
<p />
The value 'preview' only works when 'output_normal' is set to 'best'. It makes Motion name the best preview jpeg file (image with most changed pixels during the event) with the same body name as the mpeg movie created during the same event. The purpose is to create a good single image that represents the saved mpeg moview so you can decide if you want to see it and spend time downloading it from a web page.
<p />
<p />
<p />
<p />
<h3><a name="movie_filename"></a> movie_filename </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %v-%Y%m%d%H%M%S
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionMovieFilename">Option Topic</a>
</li></ul>
<p />
File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This was previously called ffmpeg_filename.
<p />
<img src="/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> This option was renamed from ffmpeg_filename to movie_filename in Motion 3.2.5.
<p />
Default value is equivalent to legacy 'oldlayout' option
For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H%M%S
<p />
File extension .mpg or .avi is automatically added so do not include this.
<p />
This option uses <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S for 'oldlayout on' and %Y/%m/%d/%H%M%S for 'oldlayout off'.
<p />
<p />
<p />
<p />
<h3><a name="snapshot_filename"></a> snapshot_filename </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %v-%Y%m%d%H%M%S-snapshot
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionSnapshotFilename">Option Topic</a>
</li></ul>
<p />
File path for snapshots (jpeg or ppm) relative to target_dir.
<p />
Default value is equivalent to legacy 'oldlayout' option. For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H/%M/%S-snapshot
<p />
File extension .jpg or .ppm is automatically added so do not include this
A symbolic link called lastsnap.jpg (or lastsnap.ppm) created in the target_dir will always point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'
<p />
This option uses <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S-snapshot for 'oldlayout on' and %Y/%m/%d/%H/%M/%S-snapshot for 'oldlayout off'.
<p />
For the equivalent of the now obsolete option 'snap_overwrite' use the value 'lastsnap'.
<p />
<p />
<p />
<p />
<h3><a name="target_dir"></a> target_dir </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined = current working directory
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTargetDir">Option Topic</a>
</li></ul>
<p />
Target directory for picture and movie files.
<p />
This is the target directory for all snapshots, images files and movie files. The default is the current working directory (current working directory of the terminal from which motion was started). You will normally always want to specify this parameter as an absolute path.
<p />
Note that the options snapshot_filename, jpeg_filename, ffmpeg_filename, and timelapse_filename all allows specifying directories. These will all be relative to 'target_dir'. This means in principle that you can specify target_dir as '/' and be 100% flexible. It also means that Motion can write files all over your harddisk if you make a mistake. It is recommended to specify the target_dir as deep or detailed as possible for this reason.
<p />
<p />
<p />
<p />
<h3><a name="timelapse_filename"></a> timelapse_filename </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %v-%Y%m%d-timelapse
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTimelapseFilename">Option Topic</a>
</li></ul>
<p />
File path for timelapse mpegs relative to target_dir (ffmpeg only).
<p />
Default value is equivalent to legacy 'oldlayout' option.
<p />
For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d-timelapse
<p />
File extension .mpg is automatically added so do not include this.
<p />
This option uses <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d-timelapse for 'oldlayout on' and %Y/%m/%d-timelapse for 'oldlayout off'.
<p />
<p />
<p />
<p />
<p />
<h2><a name="Conversion_Specifiers_for_Advanc"></a> <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers for Advanced Filename and Text Features</a> </h2>
The table below shows all the supported Conversion Specifiers you can use in the options <code>text_event</code>, <code>text_left</code>, <code>text_right</code>, <code>sql_query</code>, <code>snapshot_filename</code>, <code>jpeg_filename</code>, <code>ffmpeg_filename</code>, <code>timelapse_filename</code>, <code>on_event_start</code>, <code>on_event_end</code>, <code>on_picture_save</code>, <code>on_movie_start</code>, <code>on_movie_end</code>, and <code>on_motion_detected</code>.
<p />
In <code>text_left</code> and <code>text_right</code> you can additionally use '\n' for new line.
<p />
<table cellspacing="0" id="table12" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=12;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Conversion Specifier</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1 foswikiLastCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=12;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Description</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %a </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The abbreviated weekday name according to the current locale. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %A </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The full weekday name according to the current locale. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %b </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The abbreviated month name according to the current locale. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %B </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The full month name according to the current locale. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %c </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The preferred date and time representation for the current locale. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %C </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Text defined by the <a href="/foswiki/bin/view/Motion/ConfigOptionTextEvent">text_event</a> feature </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %d </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The day of the month as a decimal number (range 01 to 31). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %D </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Number of pixels detected as Motion. If labelling is enabled the number is the number of pixels in the largest labelled motion area. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %E </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Modifier: use alternative format, see below. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %f </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> File name - used in the <a href="/foswiki/bin/view/Motion/ConfigOptionOnPictureSave">on_picture_save</a>, <a href="/foswiki/bin/view/Motion/ConfigOptionOnMovieStart">on_movie_start</a>, <a href="/foswiki/bin/view/Motion/ConfigOptionOnMovieEnd">on_movie_end</a>, and <a href="/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a> features. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %F </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Equivalent to %Y-%m-%d (the ISO 8601 date format). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %H </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The hour as a decimal number using a 24-hour clock (range 00 to 23). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %i </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Width of the rectangle containing the motion pixels (the rectangle that is shown on the image when <a href="/foswiki/bin/view/Motion/ConfigOptionLocate">locate</a> is on). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %I </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The hour as a decimal number using a 12-hour clock (range 01 to 12). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %j </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The day of the year as a decimal number (range 001 to 366). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %J </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Height of the rectangle containing the motion pixels (the rectangle that is shown on the image when <a href="/foswiki/bin/view/Motion/ConfigOptionLocate">locate</a> is on). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %k </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank. (See also %H.) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %K </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> X coordinate in pixels of the center point of motion. Origin is upper left corner. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %l </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank. (See also %I.) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %L </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Y coordinate in pixels of the center point of motion. Origin is upper left corner and number is positive moving downwards (I may change this soon). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %m </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The month as a decimal number (range 01 to 12). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %M </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The minute as a decimal number (range 00 to 59). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %n </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Filetype as used in the <a href="/foswiki/bin/view/Motion/ConfigOptionOnPictureSave">on_picture_save</a>, <a href="/foswiki/bin/view/Motion/ConfigOptionOnMovieStart">on_movie_start</a>, <a href="/foswiki/bin/view/Motion/ConfigOptionOnMovieEnd">on_movie_end</a>, and <a href="/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a> features. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %N </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Noise level. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %o </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Threshold. The number of detected pixels required to trigger motion. When <a href="/foswiki/bin/view/Motion/ConfigOptionThresholdTune">threshold_tune</a> is 'on' this can be used to show the current tuned value of threshold. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %p </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Either 'AM' or 'PM' according to the given time value, or the corresponding strings for the current locale. Noon is treated as `pm' and midnight as `am'. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %P </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Like %p but in lowercase: `am' or `pm' or a corresponding string for the current locale. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %q </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Picture frame number within current second. For jpeg filenames this should always be included in the filename if you save more then 1 picture per second to ensure unique filenames. It is not needed in filenames for mpegs. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %Q </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Number of detected labels found by the despeckle feature </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %r </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The time in a.m. or p.m. notation. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %R </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The time in 24-hour notation (%H:%M). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %s </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The number of seconds since the Epoch, i.e., since 1970-01-01 00:00:00 UTC. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %S </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The second as a decimal number (range 00 to 61). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %t </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Thread number (camera number) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %T </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The time in 24-hour notation (%H:%M:%S). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %u </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The day of the week as a decimal, range 1 to 7, Monday being 1. See also %w. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %U </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. See also %V and %W. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %v </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Event number. An event is a series of motion detections happening with less than 'gap' seconds between them. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %V </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. See also %U and %W. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %w </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The day of the week as a decimal, range 0 to 6, Sunday being 0. See also %u. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %W </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %x </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The preferred date representation for the current locale without the time. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %X </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The preferred time representation for the current locale without the date. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %y </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The year as a decimal number without a century (range 00 to 99). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %Y </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The year as a decimal number including the century. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %z </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The time-zone as hour offset from GMT. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> %Z </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol foswikiLast"> The time zone or name or abbreviation. </td>
</tr>
</tbody></table>
<p />
<p />
<h2><a name="Webcam_Server"></a> <a href="/foswiki/bin/view/Motion/WebcamServer">Webcam Server</a> </h2>
Motion has simple webcam server built in. The video stream is in mjpeg format.
<p />
Each thread can have its own webcam server. If you enable the webcam server (option webcam_port to a number different from 0) and you have more than one camera, you must make sure to include webcam_port in each thread config file and set webcam_port to different and unique port numbers or zero (disable). Otherwise each webcam server will use the setting from the motion.conf file and try to bind to the same port. If the webcam_port numbers are not different from each other Motion will disable the webcam feature.
<p />
Note: The webcam server feature requires that the option <code>ppm</code> is set to <strong>off</strong>.
<p />
The <code>webcam_maxrate</code> and <code>webcam_quality</code> options are important to limit the load on your server and link. Don't set them too high unless you only use it on the localhost or on an internal LAN. The option <code>webcam_quality</code> is equivalent to the quality level for jpeg pictures.
<p />
The <code>webcam_limit</code> option prevents people from loading your Network connection by streaming for hours and hours. The options defines the number of picture frames sent as mjpeg Motion will allow without re-connecting (e.g. clicking refresh in the browser).
<p />
The option <code>webcam_localhost</code> is a security feature. When enabled you can only access the webserver on the same machine as Motion is running on. If you want to present a live webcam on your web site this feature must be disabled.
<p />
The webserver generates a stream in "multipart jpeg" format (mjpeg). You cannot watch the stream with most browsers. Only certain versions of Netscape works. Mozilla and Firefox brosers can view the mjpeg stream but you often have to refresh the page once to get the streaming going. Internet Explorer cannot show the mjpeg stream. For public viewing this is not very useful. There exists a java applet called <a href="http://www.charliemouse.com/code/cambozola/" rel="nofollow" target="_top">Cambozola</a> which enabled any Java capable browser to show the stream. To enable the feature to a broad audience you should use this applet or similar.
<p />
To use the webcam feature with Cambozola is actually very simple.
<p />
<strong>1.</strong> Create a html page in which you will want the streamed picture.
<p />
<strong>2.</strong> In the html page include this code
<p />
<pre>
&#60;applet code&#61;com.charliemouse.cambozola.Viewer
archive&#61;cambozola.jar width&#61;&#34;320&#34; height&#61;&#34;240&#34; style&#61;&#34;border-width:1; border-color:gray; border-style:solid;&#34;&#62;
&#60;param name&#61;url value&#61;&#34;http://www.myurl.com:8081&#34;&#62;
&#60;/applet&#62;
</pre>
<p />
Where the width and height is the image size of the video stream.
<p />
Replace www.myurl.com:8081 by the real url and port number of your choice.
<p />
<strong>3.</strong> In the same directory you place the cambozola.jar file. No need to build the java applet from source. Simply use the applet in the package.
<p />
<strong>4.</strong> Enable the feature in motion.conf.
<p />
You can also view the live webcam stream using <a href="http://www.mplayerhq.hu/" rel="nofollow" target="_top">MPlayer</a> like this:
<p />
<pre>mplayer -demuxer lavf http://www.myurl.com:8081/stream.mjpg</pre>
<p />
Note that the <code>stream.mjpg</code> part is important, without it you will get a <code>LAVF_check: no clue about this gibberish!</code> error from libavformat.
<p />
<strong>These are the special webcam parameters.</strong>
<p />
<p />
<p />
<h3><a name="webcam_limit"></a> webcam_limit </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 0 (unlimited)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamLimit">Option Topic</a>
</li></ul>
<p />
Limit the number of frames to number frames. After 'webcam_limit' number of frames the connection will be closed by motion. The value 0 means unlimited.
<p />
Number can be defined by multiplying actual webcam rate by desired number of seconds. Actual webcam rate is the smallest of the numbers <a href="/foswiki/bin/view/Motion/ConfigOptionFramerate">framerate</a> and <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamMaxrate">webcam_maxrate</a>.
<p />
<p />
<p />
<p />
<h3><a name="webcam_localhost"></a> webcam_localhost </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamLocalhost">Option Topic</a>
</li></ul>
<p />
Limits the access to the webcam to the localhost.
<p />
By setting this to on, the webcam can only be accessed on the same machine on which Motion is running.
<p />
<p />
<p />
<p />
<h3><a name="webcam_maxrate"></a> webcam_maxrate </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 100
</li> <li> Default: 1
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamMaxrate">Option Topic</a>
</li></ul>
<p />
Limit the framerate of the webcam in frames per second. Default is 1. Set the value to 100 for practically unlimited.
<p />
Don't set 'webcam_maxrate' too high unless you only use it on the localhost or on an internal LAN.
<p />
<p />
<p />
<p />
<h3><a name="webcam_motion"></a> webcam_motion </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamMotion">Option Topic</a>
</li></ul>
<p />
If set to 'on' Motion sends slows down the webcam stream to 1 picture per second when no motion is detected. When motion is detected the stream runs as defined by webcam_maxrate. When 'off' the webcam stream always runs as defined by webcam_maxrate.
<p />
Use this option to save bandwidth when there is not anything important to see from the camera anyway.
<p />
Note that this feature was greatly improved from Motion version 3.2.2. Before 3.2.2 the option stopped the webcam stream except when Motion was detected. This made the feature not very useful because it made it difficult to connect to the webcam stream and most mjpeg viewers would timeout and give an error message. From 3.2.2 the feature has been greatly improved and actually quite recommendable.
<p />
<p />
<p />
<p />
<h3><a name="webcam_port"></a> webcam_port </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamPort">Option Topic</a>
</li></ul>
<p />
TCP port on which motion will listen for incoming connects with its webcam server.
<p />
Note that each camera thread must have its own unique port number and it must also be different from the control_port number.
<p />
A good value to select is 8081 for camera 1, 8082 for camera 2, 8083 for camera 3 etc etc.
<p />
<p />
<p />
<p />
<h3><a name="webcam_quality"></a> webcam_quality </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 100
</li> <li> Default: 50
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionWebcamQuality">Option Topic</a>
</li></ul>
<p />
Quality setting in percent for the mjpeg picture frames transferred over the webcam connection. Keep it low to restrict needed bandwidth.
<p />
The mjpeg stream consists of a header followed by jpeg frames separated by content-length and boundary string. The quality level defines the size of the individual jpeg pictures in the mjpeg stream. If you set it too high you need quite a high bandwidth to view the stream.
<p />
<p />
<p />
<h2><a name="Remote_Control_with_http"></a> <a href="/foswiki/bin/view/Motion/RemoteControlHttp">Remote Control with http</a> </h2>
<p />
Motion can be remote controlled via a simple http interface. http is the language a normal web browser talks when it requests a web page. The web server answers back with some simple http headers followed by a webpage coded in HTML.
<p />
Most Motion config options can be changed while Motion is running except options related to the size of the captured images and mask files which are loaded only when Motion starts. So only your fantasy sets the limit to what you can change combining cron and the remote control interface for Motion.
<p />
So the most obvious tool to use to remote control Motion is any web browser. All commands are sent using the http GET method which simply means that the information is sent via the URL and maybe a query string. You can use any browser (Firefox, Mozilla, Internet Explorer, Konquerer, Opera etc). You can also use the text based browser lynx to control Motion from a console. It navigates fine through the very simple and minimalistic http control interface of Motion.
<p />
The details about how to control Motion via the URL is described in detail in the <a href="/foswiki/bin/view/Motion/MotionHttpAPI">Motion http API</a> topic.
<p />
But it is probably simpler to connect to the control port with a browser, navigate to the function you want, and copy the URL from the browser URL entry line. If your <a href="/foswiki/bin/view/Motion/ConfigOptionControlPort">control_port</a> is 8080 and you browse from the same machine on which Motion runs simply look up <a href="http://localhost:8080/" rel="nofollow" target="_top">http://localhost:8080/</a> and navigate around. Connecting from a remote machine is done by using a domain name (example <a href="http://mydomain.com:8080/" rel="nofollow" target="_top">http://mydomain.com:8080/</a>) or the IP address of the machine (example <a href="http://192.168.1.4:8080/" rel="nofollow" target="_top">http://192.168.1.4:8080/</a>). The option <a href="/foswiki/bin/view/Motion/ConfigOptionControlLocalhost">control_localhost</a> must be off to allow connection from a remote machine.
<p />
If you want to use a script or cron to automatically change Motion settings while Motion runs you use a program that can fetch a webpage. We simply just throw away the html page that Motion returns. Programs commonly available on Linux machines are wget and lwp-request. Here is an example of how to start and stop motion detection via cron. These two lines are added to /etc/crontab.
<p />
<pre>
0 9 &#42; &#42; &#42; root /usr/bin/lwp-request http://localhost:8080/0/detection/start &#62; /dev/null
0 18 &#42; &#42; &#42; root /usr/bin/lwp-request http://localhost:8080/0/detection/pause &#62; /dev/null
</pre>
<p />
If you want to use the http remote control from your own software (for example your own PHP front end) you can set the new motion.conf option html_output off. Then Motion answers back with very basic text only and no html around it. A bit like the xmlrpc interface did.
<p />
To remote control Motion from a web pages you can for example use PHP. In PHP it takes this simple code line to send a remote commend to Motion. Here we pause motion detection for camera 2
<p />
<code>readfile('http://localhost:8080/2/detection/pause');</code>
<p />
What happened to XMLRPC?
<p />
XMLRPC is replaced by a simpler http remote control interface. It is still being worked on but it is absolutely useable now and much nicer to work with than xmlrpc. Another advantage is that you do not need to install xmlrpc libraries. It is all written in standard C.
<p />
<img src="/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Security Warning! Note that this feature also means you have to pay attention to the following. <ul>
<li> Anyone with access to the remote control port (http) can alter the values of any options and save files anywhere on your server with the same privileges as the user running Motion. They can execute any command on your computer with the same privileges as the user running Motion. Anyone can access your control port if you have not either limited access to localhost or limited access using firewalls in the server. You should always have a router between a machine running Motion with remote control enabled and the Internet and make sure the Motion control port is not accessible from the outside.
</li> <li> If you limit control port to localhost you still need to take care of any user logging into the server with any kind of terminal session.
</li> <li> It is a good idea to run Motion as a harmless user. Not as root!!
</li></ul>
<p />
<strong>These are the config file options that control Motion.</strong>
<p />
These must be placed in motion.conf and not in a thread config file.
<p />
<p />
<p />
<h3><a name="control_authentication"></a> control_authentication </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4096 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionControlAuthentication">Option Topic</a>
</li></ul>
<p />
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.
<p />
By setting this to on, the control using http (browser) can only be accessed using login and password ( following the Basic Authentication defined in HTTP RFC).
<p />
<p />
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="control_html_output"></a> control_html_output </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionControlHtmlOutput">Option Topic</a>
</li></ul>
<p />
Enable HTML in the answer sent back to a browser connecting to the control_port. This option must be placed in motion.conf and not in a thread config file.
<p />
The recommended value for most is "on" which means that you can navigate and control Motion with a normal browser. By setting this option to "off" the replies are in plain text which may be easier to parse for 3rd party programs that control Motion.
<p />
<p />
<p />
<p />
<h3><a name="control_localhost"></a> control_localhost </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionControlLocalhost">Option Topic</a>
</li></ul>
<p />
Limits the http (html) control to the localhost. This option must be placed in motion.conf and not in a thread config file.
<p />
By setting this to on, the control using http (browser) can only be accessed on the same machine on which Motion is running.
<p />
<p />
<p />
<p />
<h3><a name="control_port"></a> control_port </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0 (disabled)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionControlPort">Option Topic</a>
</li></ul>
<p />
Sets the port number for the http (html using browser) based remote control. This option must be placed in motion.conf and not in a thread config file.
<p />
This sets the TCP/IP port number to be used for control of motion using http (browser). Port numbers below 1024 normally requires that you have root privileges. Port 8080 is a fine choice of port to use for the purpose.
<p />
<p />
<p />
<p />
-- <a href="/foswiki/bin/view/Main/KennethLavrsen">KennethLavrsen</a> - 12 Apr 2005
<p />
<h2><a name="External_Commands"></a> <a href="/foswiki/bin/view/Motion/ExternalCommands">External Commands</a> </h2>
Motion can execute external commands based on the motion detection and related events. They are all described in this section. The option <code>quiet</code> is also included in this section.
<p />
A redesign of the external commands was due. They were not very easy to understand, not all were flexible enough and some were missing. So a new external command feature set was made for 3.2.1 and on.
<p />
This is how the new script commands look like:
<p />
<table cellspacing="0" id="table13" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=13;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Function</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=13;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Old Option</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=13;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">New Option</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol3 foswikiLastCol"> <a rel="nofollow" href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=3;table=13;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Argument Appended</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Start of event (first motion) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> execute </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2"> on_event_start </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol3 foswikiLastCol"> None </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> End of event (no motion for gap seconds) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> <em>New!</em> </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2"> on_event_end </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol3 foswikiLastCol"> None </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Picture saved (jpg or ppm) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> onsave </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2"> on_picture_save </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol3 foswikiLastCol"> Filename of picture </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Movie starts (mpeg file opened) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> onmpeg </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2"> on_movie_start </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol3 foswikiLastCol"> Filename of movie </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Movie ends (mpeg file closed) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> onffmpegclose </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2"> on_movie_end </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol3 foswikiLastCol"> Filename of movie </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> Motion detected (each single frame with Motion detected) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLast"> <em>New!</em> </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLast"> on_motion_detected </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol3 foswikiLastCol foswikiLast"> None </td>
</tr>
</tbody></table>
<p />
Mail and sms has been removed because they were not configurable. If you want to send event-based mails or sms, just use one of those commands above and send the mail from that script. See <a href="/foswiki/bin/view/Motion/MotionGuideOneLargeDocument#MailSMS" class="foswikiCurrentTopicLink">What happened to mail and sms?</a>
<p />
<p />
<img src="/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Security Warning! Note that this feature also means you have to pay attention to the following. <ul>
<li> Anyone with access to the remote control port (http) can execute any command on your computer with the same privileges as the user running Motion. Anyone can access your control port if you have not either limited access to localhost or limited access using firewalls in the server. You should always have a router between a machine running Motion with remote control enabled and the Internet and make sure the Motion control port is not accessible from the outside.
</li> <li> If you limit control port to localhost you still need to take care of any user logging into the server with any kind of GUI or terminal session. All it takes is a browser or single command line execution to change settings in Motion.
</li> <li> It is a good idea to run Motion as a harmless user. Not as root!!
</li></ul>
<p />
<strong>These are the options</strong>
<p />
<p />
<p />
<h3><a name="on_area_detected"></a> on_area_detected </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionOnAreaDetected">Option Topic</a>
</li></ul>
<p />
Command to be executed when motion in a predefined area is detected. Check option area_detect.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="on_camera_lost"></a> on_camera_lost </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionOnCameraLost">Option Topic</a>
</li></ul>
<p />
Command to be executed when a camera can't be opened or if it is lost. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. (new in 3.2.10)
<p />
<!--
Add Additional Description Below
-->
<p />
NOTE: There is situations when motion don't detect a lost camera!<br /> It depends on the driver, some drivers dosn't detect a lost camera at all<br /> Some hangs the motion thread. Some even hangs the PC!
<p />
<p />
<p />
<p />
<h3><a name="on_event_end"></a> on_event_end </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionOnEventEnd">Option Topic</a>
</li></ul>
<p />
Command to be executed when an event ends after a period of no motion. The period of no motion is defined by option gap. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command.
<p />
Full path name of the program/script.
<p />
This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/user/bin/perl) as the first line of the script.
<p />
The command is run when an event is over. I.e. the number of seconds defined by the time 'gap' has passed since the last detection of motion and motion closes the mpeg file.
<p />
<p />
<p />
<p />
<h3><a name="on_event_start"></a> on_event_start </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionOnEventStart">Option Topic</a>
</li></ul>
<p />
Command to be executed when an event starts. An event starts at first motion detected after a period of no motion defined by gap. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">ConversionSpecifiers</a> and spaces as part of the command.
<p />
Full path name of the program/script.
<p />
This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/user/bin/perl) as the first line of the script.
<p />
The command is run when an event starts. I.e. the first motion is detected since the last event.
<p />
This option replaces the former options 'mail', 'sms' and 'execute'.
<p />
<p />
<p />
<p />
<h3><a name="on_motion_detected"></a> on_motion_detected </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionOnMotionDetected">Option Topic</a>
</li></ul>
<p />
Command to be executed when a motion frame is detected. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command.
<p />
Do not write "none" if you do not want to execute commands. Simply do not include the option in the file or comment it out by placing a "#" or ";" as the first character on the line before the execute command.
<p />
<p />
<p />
<h3><a name="on_movie_end"></a> on_movie_end </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionOnMovieEnd">Option Topic</a>
</li></ul>
<p />
Command to be executed when an ffmpeg movie is closed at the end of an event. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command.
<p />
Full path name of the program/script.
<p />
This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/user/bin/perl) as the first line of the script.
<p />
The command is run when an event is over. I.e. the number of seconds defined by the time 'gap' has passed since the last detection of motion and motion closes the mpeg file.
<p />
This option was previously called onffmpegclose.
<p />
Note that from Motion 3.2.4 the path name of the picture file is no longer appended to the command. Instead you can use the conversion specifier %f to insert the picture filename (full path) anywhere in the command.
<p />
Most common <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a>
<p /> <ul>
<li> %Y = year, %m = month, %d = date
</li> <li> %H = hour, %M = minute, %S = second
</li> <li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i and %J = width and height of motion area
</li> <li> %K and %L = X and Y coordinates of motion center
</li> <li> %C = value defined by text_event
</li> <li> %f = filename with full path
</li> <li> %n = number indicating filetype
</li></ul>
<p />
<p />
<p />
<p />
<p />
<h3><a name="on_movie_start"></a> on_movie_start </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionOnMovieStart">Option Topic</a>
</li></ul>
<p />
Command to be executed when an mpeg movie is created. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command.
<p />
Full path name of the program/script.
<p />
This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/user/bin/perl) as the first line of the script. When you use ffmpeg the film is generated on the fly and on_movie_start then runs when the new mpeg file is created. Often you will want to use the <a href="/foswiki/bin/view/Motion/ConfigOptionOnMovieEnd">on_movie_end</a> option which runs when the mpeg file is closed and the event is over.
<p />
This option was previously called onmpeg.
<p />
Note that from Motion 3.2.4 the path name of the picture file is no longer appended to the command. Instead you can use the conversion specifier %f to insert the picture filename (full path) anywhere in the command.
<p />
Most common <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a>
<p /> <ul>
<li> %Y = year, %m = month, %d = date
</li> <li> %H = hour, %M = minute, %S = second
</li> <li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i and %J = width and height of motion area
</li> <li> %K and %L = X and Y coordinates of motion center
</li> <li> %C = value defined by text_event
</li> <li> %f = filename with full path
</li> <li> %n = number indicating filetype
</li></ul>
<p />
<p />
<p />
<p />
<p />
<h3><a name="on_picture_save"></a> on_picture_save </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionOnPictureSave">Option Topic</a>
</li></ul>
<p />
Command to be executed when an image is saved. You can use <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command.
<p />
Full path name of the program/script.
<p />
This can be any type of program or script. Remember to set the execution bit in the file access control list (chmod) and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/usr/bin/perl) as the first line of the script.
<p />
Note that from Motion 3.2.4 the path name of the picture file is no longer appended to the command. Instead you can use the conversion specifier %f to insert the picture filename (full path) anywhere in the command.
<p />
Most common <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a>
<p /> <ul>
<li> %Y = year, %m = month, %d = date
</li> <li> %H = hour, %M = minute, %S = second
</li> <li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i and %J = width and height of motion area
</li> <li> %K and %L = X and Y coordinates of motion center
</li> <li> %C = value defined by text_event
</li> <li> %f = filename with full path
</li> <li> %n = number indicating filetype
</li></ul>
<p />
<p />
<p />
<p />
<p />
<h3><a name="quiet"></a> quiet </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionQuiet">Option Topic</a>
</li></ul>
<p />
Be quiet, don't output beeps when detecting motion.
<p />
Only works in non-daemon mode.
<p />
<p />
<p />
<p />
<a name="MailSMS"></a>
<h3><a name="What_happened_to_mail_and_sms"></a> What happened to mail and sms? </h3>
The 6 new on_xxxxx options replace the former execute, mail and sms options.
<p />
They are quite generic and flexible. These small bash scripts gives to the same functionality as mail and sms BUT you have all the flexibility you want to extend the messages, change the 'from' email address etc.
<p />
<h4><a name="Sending_email_at_start_of_event"></a> Sending email at start of event </h4>
<em>Script written by <a href="/foswiki/bin/view/Main/JoergWeber">JoergWeber</a></em>
<pre>
#!/bin/sh
# Motion sample script to send an e-mail at start of an event.
# Replaces the former &#39;mail&#39; option.
# Just define this script as &#39;on&#95;event&#95;start&#39;-script in motion.conf like that:
# on&#95;event&#95;start send&#95;mail &#34;&#37;Y-&#37;m-&#37;d &#37;T&#34;
#change to suit your needs:
#location of &#39;mail&#39; binary
MAIL&#61;&#34;/usr/bin/mail&#34;
#Destination e-mail address
TO&#61;&#34;root&#64;localhost&#34;
#Subject of the e-mail
SUBJECT&#61;&#34;Motion detected&#34;
#Don&#39;t change anything below this line
echo -e &#34;This is an automated message generated by motion.\n\nMotion detected: $1\n\n&#34; &#124; $MAIL -s &#34;$SUBJECT&#34; $TO
</pre>
<p />
<h4><a name="Sending_SMS_at_start_of_event"></a> Sending SMS at start of event </h4>
<em>Script written by <a href="/foswiki/bin/view/Main/JoergWeber">JoergWeber</a></em>
<p />
If you uncomment the line <code>#/usr/local/bin/send_mail $1</code> you can combine both sending email and sms.
<pre>
#!/bin/sh
# Motion sample script to send an sms at start of an event.
# Replaces the former &#39;sms&#39; option.
# Just define this script as &#39;on&#95;event&#95;start&#39;-script in motion.conf like that:
# on&#95;event&#95;start send&#95;sms &#34;&#37;Y-&#37;m-&#37;d &#37;T&#34;
#
# If you want to send an e-mail message here as well, just uncomment the last
# line of this script.
#change to suit your needs:
#location of &#39;sms-client&#39; binary
SMS&#95;CLIENT&#61;&#34;/usr/bin/sms&#95;client&#34;
#Destination sms number
TO&#61;&#34;12345&#34;
#Don&#39;t change anything below this line
$SMS&#95;CLIENT $TO &#34;Motion detected $1&#34;
#/usr/local/bin/send&#95;mail $1
</pre>
<p />
<p />
<p />
<h1><a name="Motion_Guide_Special_Features"></a> Motion Guide - Special Features </h1>
<p />
<h2><a name="Tracking_Control"></a> <a href="/foswiki/bin/view/Motion/TrackingControl">Tracking Control</a> </h2>
This is still at the experimental stage. Read more about it <a href="/foswiki/bin/view/Motion/MotionTracking">motion tracking</a> page.
<p />
<h3><a name="Tracking_Feature_with_Logitech_Q"></a> Tracking Feature with Logitech Quickcam Sphere/Orbit </h3>
Motion supports controlling the pan and tilt feature of a Logitech Quickcam Sphere/Orbit.
<p />
Motion can move the camera to a fixed position given in degrees pan (left-right) and tilt (down-up). Movement can be set with absolute coordinates or relative to current position. There is also an auto tracking feature for the Logitech Quickcam Sphere/Orbit but it is not very mature. It is fun to play with but not very useful yet. See this topic of how <a href="/foswiki/bin/view/Main/KennethLavrsen">KennethLavrsen</a> controls his Sphere: <a href="/foswiki/bin/view/Motion/LogitechSphereControl">LogitechSphereControl</a>.
<p />
For a detailed description of http remote control see the section <a href="/foswiki/bin/view/Motion/RemoteControlHttp">Remote Control with http</a>.
<p />
<strong>List of tracking options</strong>
<p />
<p />
<h3><a name="track_auto"></a> track_auto </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackAuto">Option Topic</a>
</li></ul>
<p />
Enable auto tracking
<p />
Requires a tracking camera type supported by Motion.
<p />
<p />
<p />
<p />
<h3><a name="track_iomojo_id"></a> track_iomojo_id </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackIomojoId">Option Topic</a>
</li></ul>
<p />
Use this option if you have an iomojo smilecam connected to the serial port instead of a general stepper motor controller.
<p />
Only used for iomojo camera.
<p />
<p />
<p />
<p />
<h3><a name="track_maxx"></a> track_maxx </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackMaxx">Option Topic</a>
</li></ul>
<p />
The maximum position for servo x.
<p />
Only used for stepper motor tracking.
<p />
<p />
<p />
<p />
<h3><a name="track_maxy"></a> track_maxy </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackMaxy">Option Topic</a>
</li></ul>
<p />
The maximum position for servo y.
<p />
Only used for stepper motor tracking.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="track_motorx"></a> track_motorx </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackMotorx">Option Topic</a>
</li></ul>
<p />
The motor number that is used for controlling the x-axis.
<p />
Only used for stepper motor tracking.
<p />
<p />
<p />
<p />
<h3><a name="track_motory"></a> track_motory </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackMotory">Option Topic</a>
</li></ul>
<p />
The motor number that is used for controlling the y-axis.
<p />
Only used for stepper motor tracking.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="track_move_wait"></a> track_move_wait </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 10
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackMoveWait">Option Topic</a>
</li></ul>
<p />
Delay during which tracking is disabled after auto tracking has moved the camera. Delay is defined as number of picture frames.
<p />
The actual delay is depending on the chosen framerate. If you want the camera to move maximum once every 2 seconds and the framerate is 10 then you need to set the track_move_wait value to 2 * 10 = 20.
<p />
<p />
<p />
<p />
<h3><a name="track_port"></a> track_port </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackPort">Option Topic</a>
</li></ul>
<p />
This is the device name of the serial port to which the stepper motor interface is connected.
<p />
Only used for stepper motor tracking.
<p />
<p />
<p />
<p />
<h3><a name="track_speed"></a> track_speed </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 255
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackSpeed">Option Topic</a>
</li></ul>
<p />
Speed to set the motor to.
<p />
Only used for stepper motor tracking.
<p />
<p />
<p />
<p />
<h3><a name="track_step_angle_x"></a> track_step_angle_x </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0-90
</li> <li> Default: 10
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackStepAngleX">Option Topic</a>
</li></ul>
<p />
Angle in degrees the camera moves per step on the X-axis with auto tracking. Currently only used with pwc type cameras.
<p />
Requires a tracking camera type pwc.
<p />
<p />
<p />
<p />
<h3><a name="track_step_angle_y"></a> track_step_angle_y </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0-40
</li> <li> Default: 10
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackStepAngleY">Option Topic</a>
</li></ul>
<p />
Angle in degrees the camera moves per step on the Y-axis with auto tracking. Currently only used with pwc type cameras.
<p />
Requires a tracking camera type pwc.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="track_stepsize"></a> track_stepsize </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 40
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackStepsize">Option Topic</a>
</li></ul>
<p />
Number of steps to make.
<p />
Only used for stepper motor tracking.
<p />
<p />
<p />
<p />
<h3><a name="track_type"></a> track_type </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: 0 (none), 1 (stepper), 2 (iomojo), 3 (pwc), 4 (generic), 5 (uvcvideo)
</li> <li> Default: 0 (None)
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionTrackType">Option Topic</a>
</li></ul>
<p />
Type of tracker.
<p />
Motion has special tracking options which use either a serial stepper motor controller, an iomojo smile cam or a Philips <a href="/foswiki/bin/view/Motion/WebCam">WebCam</a> driver compatible pan/tilt camera such as the Logitech Quickcam Sphere or Orbit.
<p />
To disable tracking, set this to 0 and the other track options are ignored.
<p />
Value 1 is for the special <a href="/foswiki/bin/view/Motion/MotionTracking">Motion Tracking</a> project using a stepper motor and a home made controller.
<p />
Value 2 is for the iomojo smilecam
<p />
Value 3 is for pwc type USB tracking cameras such as the Logitech Quickcam Sphere/Orbit which is driven by the pwc (Philips <a href="/foswiki/bin/view/Motion/WebCam">WebCam</a>) driver. To use this camera your version of pwc must be at least 8.12.
<p />
Value 4 is the generic track type. Currently it has no other function than enabling some of the internal Motion features related to tracking. Eventually more functionality will be implemented for this type.
<p />
Value 5 is for uvcvideo type USB tracking cameras such as the Logitech Quickcam Sphere/Orbit MP (new Model) which is driven by the <a href="http://linux-uvc.berlios.de/" rel="nofollow" target="_top">uvcvideo</a> driver. This option was added in Motion 3.2.8.
<p />
<p />
<p />
<p />
<p />
<p />
<h2><a name="Using_Databases"></a> <a href="/foswiki/bin/view/Motion/UsingDatabases">Using Databases</a> </h2>
Motion can be compiled with both MySQL and PostgreSQL database support. When enabled Motion adds a record to a table in the database as specified by the <a href="/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a>. The query contains the fields that are used and the value are given by using <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> for dynamic data like filename, time, number of detected pixels etc. Motion does not place any binary images in the database and it cannot remove old records.
<p />
Motion only adds records to the database when files are created. The database contains records of saved files which means to get a record in the database the feature that enables for example motion detection, timelapse, snapshots etc must be enabled. The sql_log options defines which types of files are logged in the database.
<p />
The following sql_log options are common to both MySQL and PostgreSQL.
<p />
<p />
<p />
<h3><a name="sql_log_image"></a> sql_log_image </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionSqlLogImage">Option Topic</a>
</li></ul>
<p />
Log to the database when creating motion triggered image file.
<p />
Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="sql_log_mpeg"></a> sql_log_mpeg </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionSqlLogMpeg">Option Topic</a>
</li></ul>
<p />
Log to the database when creating motion triggered mpeg file.
<p />
Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="sql_log_snapshot"></a> sql_log_snapshot </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionSqlLogSnapshot">Option Topic</a>
</li></ul>
<p />
Log to the database when creating a snapshot image file.
<p />
Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="sql_log_timelapse"></a> sql_log_timelapse </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionSqlLogTimelapse">Option Topic</a>
</li></ul>
<p />
Log to the database when creating timelapse mpeg file
<p />
Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="sql_query"></a> sql_query </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionSqlQuery">Option Topic</a>
</li></ul>
<p />
SQL query string that is sent to the database. The values for each field are given by using <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">convertion specifiers</a>
<p />
Most common <a href="/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a>
<p /> <ul>
<li> %Y = year, %m = month, %d = date
</li> <li> %H = hour, %M = minute, %S = second
</li> <li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i and %J = width and height of motion area
</li> <li> %K and %L = X and Y coordinates of motion center
</li> <li> %C = value defined by text_event
</li> <li> %f = filename with full path
</li> <li> %n = number indicating filetype
</li></ul>
<p />
<p />
<p />
See the "MySQL" section for detailed information about the database itself.
<p />
<h2><a name="MySQL"></a> MySQL </h2>
You can use the MySQL database to register each file that is stored by motion.
<p />
You need to generate a new database with a name of your own choice. You must enter this name in the config file (mysql_db option). The default value for the option <a href="/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a> requires that you create a new database in MySQL with a new table called "security" with the following fields:
<p />
insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
<p /> <ul>
<li> camera (int) - camera (thread) number
</li> <li> filename (char60) - filename (full path)
</li> <li> frame (int) - the number of the picture frame
</li> <li> file_type (int) - file type as a number - see table below.
</li> <li> time_stamp (timestamp) - timestamp for the picture in native database format
</li> <li> text_event (timestamp) - The text from the text_event option which by default is compatible with timestamps in SQL.
</li></ul>
<p />
Note from version 3.2.4 the introduction of <a href="/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a> completely redefines the way you setup the SQL feature. It is now 100% flexible and can easily be made compatible with your existing Motion database from earlier versions of Motion.
<p />
These are the file type descriptions and the file type numbers stored in the database.
<p />
<table cellspacing="0" id="table14" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<tbody>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="400" bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Normal image </td>
<td width="70" bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol"> 1 </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="400" bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Snapshot image </td>
<td width="70" bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol"> 2 </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="400" bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Motion image (showing only pixels defined as motion) </td>
<td width="70" bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol"> 4 </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="400" bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Normal mpeg image </td>
<td width="70" bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol"> 8 </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="400" bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Motion mpeg (showing only pixels defined as motion) </td>
<td width="70" bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol"> 16 </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="400" bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> Timelapse mpeg </td>
<td width="70" bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol foswikiLast"> 32 </td>
</tr>
</tbody></table>
<p />
You can create the table using the following SQL statement.
<p />
<code>CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp(14), text_event timestamp(14));</code>
<p />
If you choose to use text_event for a non-timestamp value you can instead define something like.
<p />
<code>CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp(14), text_event char(40));</code>
<p />
<p />
Remember to update grant table to give access to the mysql username you choose for motion.
<p />
It would be too much to go into detail about how to setup and use MySQL. After all this is a guide about Motion. However here are some hints and links.
<p />
<a href="http://www.linuxplanet.com/linuxplanet/tutorials/1046/1/" rel="nofollow" target="_top">Setting Up a MySQL Based Website</a> - A beginners guide from Linux Planet.
<p />
<a href="http://hotwired.lycos.com/webmonkey/99/21/index2a.html" rel="nofollow" target="_top">Webmonkey PHP/!MySQL tutorial</a> - Entertaining and easy to read.
<p />
The <a href="http://www.phpmyadmin.net/" rel="nofollow" target="_top">phpMyAdmin homepage</a>. The best and simplest tool to use MySQL (editors opinion). Requires Apache/PHP.
<p />
<strong>The options for MySQL</strong>
<p />
<p />
<p />
<h3><a name="mysql_db"></a> mysql_db </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionMysqlDb">Option Topic</a>
</li></ul>
<p />
Name of the MySQL database.
<p />
MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature.
<p />
If you compiled motion with MySQL support you will need to set the mysql options if you want motion to log events to the database.
<p />
<p />
<p />
<p />
<h3><a name="mysql_host"></a> mysql_host </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: localhost
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionMysqlHost">Option Topic</a>
</li></ul>
<p />
IP address or domain name for the MySQL server. Use "localhost" if motion and MySQL runs on the same server.
<p />
MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="mysql_password"></a> mysql_password </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionMysqlPassword">Option Topic</a>
</li></ul>
<p />
The MySQL password.
<p />
MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="mysql_user"></a> mysql_user </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionMysqlUser">Option Topic</a>
</li></ul>
<p />
The MySQL user name.
<p />
MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature.
<p />
<p />
<p />
<p />
<h2><a name="PostgreSQL"></a> PostgreSQL </h2>
Same/similar as for MySQL above.
<p />
<strong>The options for PostgreSQL</strong>
<p />
<p />
<p />
<h3><a name="pgsql_db"></a> pgsql_db </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionPgsqlDb">Option Topic</a>
</li></ul>
<p />
Name of the PostgreSQL database.
<p />
PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature.
<p />
If you compiled motion with PostgreSQL support you will need to set all the pgsql_ options if you want motion to log events to the database.
<p />
<p />
<p />
<p />
<h3><a name="pgsql_host"></a> pgsql_host </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: localhost
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionPgsqlHost">Option Topic</a>
</li></ul>
<p />
IP address or domain name for the PostgreSQL server. Use "localhost" if motion and PostgreSQL runs on the same server.
<p />
PostgreSQL CONFIG FILE OPTION. Motion must be built with pgsql_db libraries to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="pgsql_password"></a> pgsql_password </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionPgsqlPassword">Option Topic</a>
</li></ul>
<p />
The PostgreSQL password.
<p />
PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="pgsql_port"></a> pgsql_port </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 5432
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionPgsqlPort">Option Topic</a>
</li></ul>
<p />
The PostgreSQL server port number.
<p />
PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="pgsql_user"></a> pgsql_user </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionPgsqlUser">Option Topic</a>
</li></ul>
<p />
The PostgreSQL user name.
<p />
PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature.
<p />
<p />
<p />
<p />
<p />
<p />
<h2><a name="Video4Linux_Loopback_Device"></a> <a href="/foswiki/bin/view/Motion/LoopbackDevice">Video4Linux Loopback Device</a> </h2>
You can use this driver for looking at motion in realtime. The video4linux driver is written by the same author that first created Motion. You can find the source and a brief description at the <a href="/foswiki/bin/view/Motion/VideoFourLinuxLoopbackDevice">video4linux loopback device web page</a>.
<p />
The video4linux device is a Kernel module which installs itself as a video pipe. It has an input and an output. The module simply takes anything that comes on its input and send it out at the output. The purpose of this is to create a standard video4linux type video device that other programs can then use. You may now ask: "What do I need that for?".
<p />
Only one program can access a video device at a time. When motion is using a camera - no other program can access the same camera. But motion is made to be able to feed a video signal to the video loopback device. This way an additional program such as Camstream, Xawtv, a video stream server etc can watch the signal from a camera that motion uses already. What you see is not the live camera stream but the exact same picture that motion uses for detecting motion and the same pictures that are saved/streamed. You can also choose to see the "motion" type images where you see the pixels that are changing - live. Originally the video4linux pipe was used as an interface between Motion and a Webcam server. Since version 2.9 Motion has had its own webserver so this usage is no longer very relevant.
<p />
When you install the video loopback device it will create an input - for example /dev/video5 and an output - for example /dev/video6. You can then tell motion to "pipe" the video signal to the /dev/video5 and look at the pictures live using e.g. Camstream on /dev/video6. Camstream is "fooled" to think it is looking at a real camera.
<p />
<strong>Installing</strong>
<p />
Installing the video loopback device is not difficult. At least not when you have this document available.
<p />
First you must prepare your system for more video devices. You will need two extra devices for each video pipe that you want.
<p />
For example if you have 4 cameras they will probably run at /dev/video0, /dev/video1, /dev/video2, and /dev/video3. So you will need additional 8 video devices. This is easy to do.
<p />
<pre>
mknod /dev/video4 c 81 4
mknod /dev/video5 c 81 5
mknod /dev/video6 c 81 6
mknod /dev/video7 c 81 7
mknod /dev/video8 c 81 8
mknod /dev/video9 c 81 9
mknod /dev/video10 c 81 10
mknod /dev/video11 c 81 11
</pre>
<p />
Note that the video device number is the same as the last parameter given on each line.
<p />
You may need to set the ownership and permissions (chown and chmod) to be the same as the video devices that were already there.
<p />
Now you need to install the video loopback device.
<p />
Download the latest <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/VideoFourLinuxLoopbackDevice" target="_top">video4linux loopback device</a> . Place the file in a place of your own choice.
<p />
Untar and uncompress the file to the place you want the program installed. Editor recommends /usr/local/vloopback.
<p />
<code>cd /usr/local</code>
<p />
<code>tar -xvzf /path/to/vloopback-1.1-rc1.tar.gz</code>
<p />
You now have a directory called vloopback-1.1-rc1. You can rename it to vloopback (mv vloopback-1.1-rc1 vloopback). I recommend creating a symbolic link to the current version. This way you can more easily experiment with different versions simply by changing the link.
<p />
<code>ln -s vloopback-1.1-rc1 vloopback</code>
<p />
Now change to the new directory
<p />
<code>cd vloopback</code>
<p />
Build the code
<p />
<code>make</code>
<p />
There is a good chance that the make will not work and give you a long list of errors. To run make the following must be available on you machine. <ul>
<li> The kernel source files must be installed.
</li> <li> The source files must be available at /usr/src/linux.<br />E.g. the new Red Hat 7.3 does not have a link to the sources called linux. Instead there is a link called linux-2.4. This is easy to fix. Just create a link to the real source tree. Do not rename! Add a link using this command (replacing the kernel version number with the one you have on your machine)<br /> <code>ln -s /usr/src/linux-2.4.18-4 /usr/src/linux</code>
</li> <li> Alternatively you can change the vloopback makefile so that the "LINUXSRC=/usr/src/linux" line is changed to the actual path. I recommend the link solution since this may solve other similar problems that you can get when installing other software.
</li></ul>
<p />
When compiling on a newer Linux distribution you may get a warning about a header file malloc.h. To remove this warning simply change the header reference as suggested by the warning.
<p />
In vloopback.c you replace the line
<p />
<code>#include &lt;linux/malloc.h&gt;</code>
<p />
with the line
<p />
<code>#include &lt;linux/slab.h&gt;</code>
<p />
Install the code you built as a Kernel module. There are two options: pipes should be set to the number of video loopbacks that you want. Probably one for each camera. The dev_offset defines which video device number will be the first. If dev_offset is not defined the vloopback module will install itself from the first available video device. If you want the cameras to be assigned to the lower video device numbers you must either load vloopback after loading the video device modules OR use the dev_offset option when loading vloopback. Vloopback then installs itself in the sequence input 0, output 0, input 1, output 1, input 2, output 2 etc. Here is shown the command for our example of 4 cameras and 4 loopback devices and the first loopback device offset to /dev/video4.
<p />
<code>/sbin/insmod /usr/local/vloopback/vloopback.o pipes=4 dev_offset=4</code>
<p />
When you run the command you may get a warning about tainting the Kernel. Just ignore this.
You can choose to copy the vloopback.o file into a directory in the /lib/modules tree where the insmod/modprobe programs are already looking for modules. Then the command gets simpler (/sbin/insmod vloopback pipes=.....).
<p />
If you want the loopback device to load during boot, you can place the call in one of the bootup scripts such as /etc/rc.d/rc.local. Vloopback should be loaded before you start motion.
<p />
To activate the vloopback device in motion set the 'video_pipe' option in the motion.conf file. You can also view the special motion pictures where you see the changed pixels by setting the option 'motion_video_pipe' in motion.conf. When setting the video_pipe and/or motion_video_pipe options either specify the input device as e.g. /dev/video4. You can also set the parameter to '-' which means that motion will find the first vacant video loopback device input. If you have more than one camera you may want to control which loopback device each thread uses. Then you need to define the specific device name in motion.conf for the first camera and in each thread config file for the other cameras. If you set the video_pipe parameter to '-' in the motion.conf file and not setting it in the thread config files, motion automatically assign video devices in the same sequence as the threads are loaded. You can combine both video_pipe and motion_video_pipe but then naturally you will need twice as many pipes.
<p />
De-activating should be done with this command
<p />
<code>/sbin/modprobe -r vloopback</code>
<p />
<strong>Description of the motion.conf options related to video loopback device.</strong>
<p />
<p />
<p />
<h3><a name="motion_video_pipe"></a> motion_video_pipe </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionMotionVideoPipe">Option Topic</a>
</li></ul>
<p />
The video4linux video loopback input device for motion images. If a particular pipe is to be used then use the device filename of this pipe, if a dash '-' is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe. Default: not set
<p />
Using this you can view the results in real time. E.g. by using the program <a href="http://www.smcc.demon.nl/camstream/" rel="nofollow" target="_top">camstream</a>. The difference between this option and the video-pipe option is that this option shows the motion version of the images instead of the normal images.
<p />
Disable this option by not having it in the config file (or comment it out with "#" or ";").
<p />
<p />
<p />
<p />
<p />
<h3><a name="video_pipe"></a> video_pipe </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="/foswiki/bin/view/Motion/ConfigOptionVideoPipe">Option Topic</a>
</li></ul>
<p />
The video4linux video loopback input device for normal images. If a particular pipe is to be used then use the device filename of this pipe. If a dash '-' is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe.
<p />
Using this you can view the results in real time. E.g. by using the program <a href="http://www.smcc.demon.nl/camstream/" rel="nofollow" target="_top">camstream</a>.
<p />
Disable this option by not having it in the config file (or comment it out with "#" or ";").
<p />
<p />
<p />
<p />
<p />
<p />
<p />
-- <a href="/foswiki/bin/view/Main/KennethLavrsen">KennethLavrsen</a> - 13 Apr 2005