forked from Motion-Project/motion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
motion_guide.html
5418 lines (5093 loc) · 211 KB
/
motion_guide.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<h1><a name="Motion_Guide_One_Large_Document."></a> Motion Guide </h1>
<p></p>
<p></p>
<ul>
<li> <a href="#Motion_Overview"> Overview </a> </li>
<li> <a href="#Install_Build"> Installing with apt / debs / building from source </a></li>
<li> <a href="#Important_Definitions"> Important Definitions </a></li>
<li> <a href="#The_Config_Files"> The Configuration Files </a></li>
<li> <a href="#Command_Line_Options"> Command Line Options </a></li>
<li> <a href="#Signals_Sent"> Signals (sent with e.g. kill command) </a></li>
<li> <a href="#Error_Logging"> Error Logging </a></li>
<li> <a href="#Basic_Setup"> The Basic Setup </a></li>
<li> Configuration Options</li>
<ul>
<li> <a href="#Configuration_OptionsAlpha"> Listed alphabetically with mapping of old option names to current names </a></li>
<li> <a href="#Configuration_OptionsTopic"> Listed by topic </a></li>
<li> <a href="#Configuration_OptionsDetail"> Detail descriptions of each option</a></li>
</ul>
<p></p>
<p></p>
</ul>
<h2><a name="Motion_Overview"></a> Overview </h2>
<ul>
<ul>
<li> <a href="#What_is_Motion"> What is Motion? </a></li>
<li> <a href="#How_do_I_get_Motion_and_what_does_it_cost"> 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_use"> 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>
<li> <a href="#Known_Problems"> Known Problems </a></li>
</ul>
<p></p>
<h3><a name="What_is_Motion"></a> What is Motion? </h3>
<p></p>
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></p>
The program is written in C and was made for the Linux operating system. Recent revisions have also made it
available for BSD.
<p></p>
Motion is a command line based tool with only limited support for configuration via a http interface.
The many configuration options are set via the command line or configuration files.
<p></p>
The output from motion can be:
<p></p>
<ul>
<li> jpg files</li>
<li> ppm format files</li>
<li> movie video sequences</li>
</ul>
<p></p>
<h3><a name="How_do_I_get_Motion_and_what_does_it_cost"></a> How do I get Motion and what does it cost? </h3>
<p></p>
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></p>
<h3><a name="Maintenance_and_Support"></a> Maintenance and Support </h3>
<p></p>
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="https://lists.sourceforge.net/lists/listinfo/motion-user">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></p>
To get Motion direct your browser to the <a href="https://motion-project.github.io/">Motion Homepage</a>.
<p></p>
On the <a href="https://github.com/Motion-Project/motion/releases/">Releases</a> page you will find
links to the latest stable version binaries for some of the most popular Linux distributions.
p></p>
Motion was originally written by Jeroen Vreeken and later Folkert van Heusden continued as a
lead programmer with Kenneth Lavrsen responsible for Motion Guide, website and releases on Sourceforge.
<p></p>
Staring with version 3.4.1 Motion is managed on github with many maintainers and contributors.
<p></p>
For support we encourage you to join the mailing list instead of writing to the maintainers directly.
Newbies and stupid questions are welcome on the list. Contributions in the form of pull requests to the github
repository are also very welcome.
<p></p>
<h3><a name="Which_version_to_download_and_use"></a> Which version to download and use? </h3>
<p></p>
The most current release version can be found on the github releases page <a href="https://github.com/Motion-Project/motion/releases">here</a>.
The master branch of the github repository represents the official development branch of Motion. Additional
independent development forks exist
in other Github repos that contain additional bug fixes, enhanced features and updated documentation.
This guide is based upon the features and options included in the source code with which it is distributed.
It was re-written in September 2015 to reflect the changes and options in the code at that time.
The majority of the new options and changed names represent differences between the 3.2.12 version
and the legacy SVN trunk. Since 3.2.12 many options have been renamed to make setting up Motion easier.
A cross reference of the old 3.2.12 option names to the new names can be
reviewed <a href="#Configuration_OptionsAlpha">here</a>
<p></p>
Motion is included in Debian and Ubuntu while RPM users currently must build from source.
<p></p>
<h3><a name="What_features_does_Motion_have"></a> What features does Motion have? </h3>
<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 </li>
<li> Real time creation of 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 a particular event occurs</li>
<li> Motion tracking</li>
<li> Feed events to an MySQL, PostgreSQL or SQLite3 database.</li>
<li> Feed video back to a video4linux loopback for real time viewing</li>
<li> Control via simple web interface.</li>
<li> Automatic noise and threshold control</li>
<li> Ability to control the pan/tilt of a tracking camera.</li>
<li> Highly configurable display of text on images.</li>
<li> Highly configurable definition of path and file names of the stored images and movies.</li>
</ul>
<p></p>
<h3><a name="FreeBSD"></a> FreeBSD </h3>
<p></p>
Motion was originally developed for Linux and it is still mainly developed and supported for this platform.
Thanks to contributions of Angel Carpintero, Motion now builds on BSD platforms.
See the file README.FreeBSD for instructions that are unique to the FreeBSD distribution.
<p></p>
<h3><a name="MacOSX"></a> MacOSX </h3>
<p></p>
As of this writing, Motion currently is not able to be built on MacOSX due to lack of a required header file.
See <a href="https://github.com/Motion-Project/motion/issues">Issues</a> for tracking of the status for MacOSX.
<p></p>
<h3><a name="Documentation"></a> Documentation </h3>
<p></p>
You have the following sources of information:
<p></p>
<ul>
<li> This Motion Guide</li>
<li> The <a href="https://github.com/Motion-Project/motion/wiki/FAQ">Frequently Asked Questions</a></li>
<li> The author of the program has written a description of the <a href="https://github.com/Motion-Project/motion/wiki/Technology">technology behind motion</a>.</li>
<li> The man page. After installation simply type 'man motion' into a terminal screen.</li>
</ul>
<p></p>
<h3><a name="Supported_Hardware"></a> Supported Hardware </h3>
<p></p>
Motion supports video input from three kinds of sources.
<p></p>
Standard video4linux devices (e.g. /dev/video0), network cameras and the PI camera. Motion has no drivers for cameras.
Installing or configuring the camera itself is outside the scope of this document. Generally, if the device works with
other common video player software, it will work with Motion (and vice versa). As a result, it is
often convenient to first get the device working with other software and then use those connection options with Motion.
<p></p>
<p></p>
<h3><a name="Known_Problems"></a> Known Problems</a> </h3>
<p></p>
See also the <a href="https://github.com/Motion-Project/motion/wiki/FAQ">Frequently Asked Questions</a>
and <a href="https://github.com/Motion-Project/motion/issues">Issues</a> for known open issues.
<p></p>
<p></p>
</ul>
<h2><a name="Install_Build"></a> Installing with apt / debs / building from source </h2>
<ul>
<p></p>
<ul>
<li> <a href="#Install_Apt"> Installing with apt</a></li>
<li> <a href="#Install_Deb"> Installing with a release deb package</a></li>
<li> <a href="#Abbreviated_Building"> Abbreviated Building Guide</a></li>
<li> <a href="#Preparation_For_Building"> Preparation For Building </a></li>
<li> <a href="#Configure_Script"> Configure Script </a></li>
<li> <a href="#Make"> Make </a></li>
<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> <a href="#Upgrading_From_Older_Version"> Upgrading From Older Version </a></li>
<p></p>
<p></p>
</ul>
<h3><a name="Install_Apt"></a> Installing with apt </h3>
<ul>
<p></p>
Motion is part of the Ubuntu and Debian repositories and can be installed with the apt tool.
<p></p>
Open up a terminal window and type: <code><strong>sudo apt-get install motion</strong></code>
<p></p>
</ul>
<h3><a name="Install_Deb"></a> Installing with a release deb package </h3>
<ul>
Motion can also be installed from the release deb files.
<p></p>
Determine the deb file name that is appropriate for the distribution and platform from
the <a href="https://github.com/Motion-Project/motion/releases">Releases</a> page
and open up a terminal window and type:
<p></p>
<ul>
<code><strong>wget https://github.com/Motion-Project/motion/releases/{deb package name} </strong></code>
</ul>
<p></p>
Next, install the retrieved deb package. Below is a sample method to install that
uses the gdebi tool.
<p></p>
<ul>
<code><strong>sudo apt-get install gdebi-core</strong></code>
<p></p>
<code><strong>sudo gdebi {deb package name}</strong></code>
</ul>
<p></p>
</ul>
<h3><a name="Abbreviated_Building"></a> Abbreviated Building Guide </a> </h3>
<ul>
<p></p>
<p></p>
If you are familiar with the building of applications, then the following is a basic build / install
script for Ubuntu. If errors occur during the process or you wish to customize the build, please
review the extended building instructions further below.
<p></p>
<code><strong>sudo apt-get install autoconf automake build-essential pkgconf libtool libzip-dev
libjpeg62 libjpeg62-dev git libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavdevice-dev </strong></code>
<p></p>
<code><strong>cd ~</strong></code>
<br><code><strong>git clone https://github.com/Motion-Project/motion.git</strong></code>
<br><code><strong>cd motion</strong></code>
<br><code><strong>autoreconf -fiv</strong></code>
<br><code><strong>./configure</strong></code>
<br><code><strong>make</strong></code>
<br><code><strong>make install</strong></code>
<p></p>
<p></p>
<p></p>
</ul>
<h3><a name="Preparation_For_Building"></a> Preparation For Building</a> </h3>
<ul>
<p></p>
<p></p>
In order to build Motion from source many shared libraries must be installed.
The particular libraries needed will vary depending upon the features desired.
<p></p>
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 programs
from source that use these 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 contain the header files (xxx.h) that Motion needs to build. 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></p>
Open a terminal and run the following commands to install the packages.
<p></p>
Ubuntu / Debian Packages
<ul>
<li>Required</li>
<ul>
<p></p>
<code><strong>sudo apt-get install autoconf automake build-essential pkgconf libtool git libzip-dev libjpeg62 libjpeg62-dev </strong></code>
<p></p>
</ul>
<p></p>
<li>Optional Packages</li>
<ul>
<li>FFMpeg Functionality(Required for creating movies, using network cameras, etc. See note below!)</li>
<ul>
<p></p>
<code><strong>sudo apt-get install libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavdevice-dev</strong></code>
<p></p>
</ul>
<li>MySQL database functionality</li>
<ul>
<p></p>
<code><strong>sudo apt-get install mysql-server libmysqlclient-dev</strong></code>
<p></p>
</ul>
<li>PostgreSQL database functionality</li>
<ul>
<p></p>
<code><strong>sudo apt-get install postgresql libpq-dev</strong></code>
<p></p>
</ul>
<li>SQLite3 database functionality</li>
<ul>
<p></p>
<code><strong>sudo apt-get install sqlite3</strong></code>
<p></p>
</ul>
<li>JPEG Turbo</li>
<ul>
<p></p>
<code><strong>sudo apt-get install libjpeg-turbo8 libjpeg-turbo8-dev</strong></code>
<p></p>
</ul>
<li>Webp Image Support</li>
<ul>
<p></p>
<code><strong>sudo apt-get install libwebp-dev</strong></code>
<p></p>
</ul>
</ul>
Important ffmpeg/libav note: Motion has been built to use either the libav or the ffmpeg set of libraries.
Which set of libraries to use is a user selection and possibly dependent upon which is available in the
Ubuntu/Debian repositories. The packages listed above are those that are available within Ubuntu 16.04.
The package names in earlier versions or on other distributions will vary. The configure
option can also be used to remove the ffmpeg/libav functionality and the dependency on these libraries.
</ul>
<p></p>
<p></p>
openSUSE Packages
<ul>
<li>Required</li>
<ul>
<p></p>
<code><strong>sudo zypper install autoconf automake libtool git </strong></code>
<p></p>
<code><strong>sudo zypper install --type pattern devel_basis </strong></code>
<p></p>
<code><strong>sudo zypper install libjpeg8-devel </strong></code>
<p></p>
<code><strong>sudo zypper install -t pattern devel_C_C++ </strong></code>
<p></p>
</ul>
<p></p>
<li>Optional Packages</li>
<ul>
<li>FFMpeg Functionality(Required for creating movies, using network cameras, etc. SEE NOTE BELOW!)</li>
<ul>
<p></p>
<code><strong>sudo zypper ar -f -n packman-essentials http://packman.inode.at/suse/openSUSE_13.1/Essentials/ packman-essentials</strong></code>
<p></p>
<code><strong>sudo zypper ar -f -n packman-multimedia http://packman.inode.at/suse/openSUSE_13.1/Multimedia/ packman-multimedia</strong></code>
<p></p>
<code><strong>sudo zypper install libffmpeg-devel</strong></code>
<p></p>
</ul>
<li>MySQL database functionality</li>
<ul>
<p></p>
<code><strong>Not known by author</strong></code>
<p></p>
</ul>
<li>PostgreSQL database functionality</li>
<ul>
<p></p>
<code><strong>Not known by author</strong></code>
<p></p>
</ul>
<li>SQLite3 database functionality</li>
<ul>
<p></p>
<code><strong>Not known by author</strong></code>
<p></p>
</ul>
<li>Webp Image Support</li>
<ul>
<p></p>
<code><strong>sudo zypper install libwebp-devel </strong></code>
<p></p>
</ul>
</ul>
Important ffmpeg note: The ffmpeg libraries indicated above are provided by a external repository. This may
change in the future. Validate that the repository is still valid when doing the install on openSUSE systems.
The default for the configure is to require that ffmpeg or Libav is installed. Use the configure option to
compile without the ffmpeg / libav functionality.
</ul>
<p></p>
<p></p>
<p></p>
FreeBSD
<ul>
<li>Required packages</li>
<ul>
<li>autoconf</li>
<li>automake</li>
<li>gmake</li>
<li>pkgconf</li>
</ul>
<li>Optional database packages</li>
<ul>
<li>mysql57-client</li>
<li>postgresql95-contrib</li>
<li>sqlite3</li>
</ul>
<li>Webcams packages</li>
<ul>
<li>webcamd</li>
<li>v4l_compat</li>
</ul>
<li>Webp Image Support</li>
<ul>
<li>libwebp</li>
</ul>
</ul>
</ul>
<h3><a name="Configure_Script"></a> Configure Script</a> </h3>
<ul>
Motion uses a set tools called the "autotools" in order to generate the required scripts in order to
compile and install Motion. The next step after installing all of the required and desired libraries is to
have the autotools create a configure script. To do this open a terminal and change to the directory with
the source code and type
<p></p>
<code><strong>autoreconf </strong></code>
<p></p>
If the 'configure' file exists and contains a valid script, the tool will return immediately since no additional work
needs to be completed. If the script needs updating, then it will take a moment to return. Once it has been executed,
a file called 'configure' will exist in the directory. Note that if the command is run as
<p></p>
<code><strong>autoreconf -f</strong></code>
<p></p>
The -f parameter instructs it to force a new configure file to be created. This can be preferable in certain
situations so that the configure script gets updated with the correct version number.
Once the 'configure' file is created, we can execute it. What the script does is interrogate the system and look
for all the needed items in order to compile Motion. In this process it looks to determine which optional components
have been installed on the system and if found sets flags to indicate for them to be included. If a particular library
is required by Motion and is not found, the configure script will issue an error. The error means that the library was
not found because it was either not installed or that it was installed into a location that the script could not find.
With the Motion configure script, once it has ended it also lists out all of the optional components that were located.
Note that if you KNOW that a particular component is installed yet the configure script reports it as not installed, then
it may be necessary to use one or more of the configure options described below to tell the script where to find
the particular component.
<p></p>
To run the configure your current directory must be the motion directory. You type
<p></p>
<code>./configure</code>
<p></p>
You can add the parameter <code>./configure --help</code> to get help on the different switches.
<p></p>
When the configure script finishes you should validate that the options desired
were correctly identified by the configure. In particular, the ffmpeg option is occasionally not
found even if it is actually installed. Various users have indicated this to be a particular
problem with the PI. If using a PI and have this issue, you can use the following option
<p></p>
<code>./configure --with-ffmpeg=/usr/lib/arm-linux-gnueabihf</code>
<p></p>
For a long term option, you can edit the file
<code>$HOME/.bashrc</code>
and within it place the following two lines at the end
<code>PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf:$PKG_CONFIG_PATH</code>
<code>export PKG_CONFIG_PATH</code> This option will however only become
effective the next time you get into the terminal shell.
<p></p>
<p></p>
The following options can be specified with the configure script to customize
how Motion is built.
<table border="1" class="fixed" >
<colgroup>
<col width="200px">
<col width="500px">
<col width="700px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > Options</td>
<td bgcolor="#edf4f9" word-wrap:break-word > Description <br> Defaults for the options are specified in brackets [ ]</td>
<td bgcolor="#edf4f9" word-wrap:break-word > Editors comment </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > -h, --help </td>
<td bgcolor="#edf4f9" word-wrap:break-word > display this help and exit</td>
<td bgcolor="#edf4f9" word-wrap:break-word > </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --help=short</td>
<td bgcolor="#edf4f9" word-wrap:break-word > display options specific to this package </td>
<td bgcolor="#edf4f9" word-wrap:break-word > This command shows the options special to motion.</td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --help=recursive </td>
<td bgcolor="#edf4f9" word-wrap:break-word > display the short help of all the included packages </td>
<td bgcolor="#edf4f9" word-wrap:break-word > </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word >-V, --version </td>
<td bgcolor="#edf4f9" word-wrap:break-word > display version information and exit</td>
<td bgcolor="#edf4f9" word-wrap:break-word > Provides the version number of the source code and autotools </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > -q, --quiet, --silent </td>
<td bgcolor="#edf4f9" word-wrap:break-word > do not print `checking...' messages </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Illustrates only the results of the script. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --cache-file=FILE </td>
<td bgcolor="#edf4f9" word-wrap:break-word > cache test results in FILE. [disabled] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > No function</td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > -C, --config-cach </td>
<td bgcolor="#edf4f9" word-wrap:break-word > alias for `--cache-file=config.cache' </td>
<td bgcolor="#edf4f9" word-wrap:break-word > No function </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > -n, --no-create</td>
<td bgcolor="#edf4f9" word-wrap:break-word > do not create output files </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Used for testing if other switches produce error - without writing anything to the disk </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --srcdir=DIR</td>
<td bgcolor="#edf4f9" word-wrap:break-word > find the sources in DIR. [configure dir or `..'] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > DIR is a directory path. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > Installation directories:</td>
<th bgcolor="#edf4f9" word-wrap:break-word > </th>
<th bgcolor="#edf4f9" word-wrap:break-word > </th>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --prefix=PREFIX </td>
<td bgcolor="#edf4f9" word-wrap:break-word > install architecture-independent files in PREFIX <br /> [/usr/local]</td>
<td bgcolor="#edf4f9" word-wrap:break-word > The default /usr/local means that <br><br> The executable binary "motion" is installed in /usr/local/bin <br> The manual page in /usr/local/man/man1 <br>The document files in /usr/local/docs/motion<br>The configuration file in /usr/local/etc/motion <br>The example config files in /usr/local/motion/examples <br><br> If you are experimenting with many parallel versions it may be interesting to set the PREFIX to e.g. /usr/local/motion and then add /usr/local/motion/bin to your search path (or simply cd /usr/local/motion/bin before execution). <br /> This way you can change version just by changing the symbolic link in /usr/local/motion as suggested earlier in this guide. <br /> If you are installing the software on a machine where you have no access to the /usr/local but have write access to a home directory, then you should change this to point to a directory within your home tree. <br /> Example: --prefix=$HOME </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --exec-prefix=EPREFIX </td>
<td bgcolor="#edf4f9" word-wrap:break-word > install architecture-dependent files in EPREFIX <br /> [PREFIX] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > If you set this it only defines an alternative installation directory for the executable binary. <br /> Note: The executable binary will be placed in a directory "bin" below the directory specified by this option <br /> Editor recommends leaving this as default (i.e. not setting it). </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --bindir=DIR</td>
<td bgcolor="#edf4f9" word-wrap:break-word > user executables [EPREFIX/bin] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > With this option you can control exactly in which directory the executable binary is installed. The previous option automatically adds the bin directory. Here you are in fill control. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --sbindir=DIR </td>
<td bgcolor="#edf4f9" word-wrap:break-word > System admin executables [EPREFIX/sbin] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Not used by motion. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --libexecdir=DIR</td>
<td bgcolor="#edf4f9" word-wrap:break-word > program executables [EPREFIX/libexec] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Not used by motion. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --datadir=DIR</td>
<td bgcolor="#edf4f9" word-wrap:break-word > read-only architecture-independent data [PREFIX/share] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Not used by motion. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --sysconfdir=DIR</td>
<td bgcolor="#edf4f9" word-wrap:break-word > read-only single-machine data [PREFIX/etc] </td>
<td bgcolor="#edf4f9" word-wrap:break-word >
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 motion/ subdirectory inside 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-dist.conf file that you may have edited.
</td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --sharedstatedir=DIR </td>
<td bgcolor="#edf4f9" word-wrap:break-word > modifiable architecture-independent data [PREFIX/com] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Not used by motion. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --localstatedir=DIR </td>
<td bgcolor="#edf4f9" word-wrap:break-word > modifiable single-machine data [PREFIX/var] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Not used by motion. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --libdir=DIR </td>
<td bgcolor="#edf4f9" word-wrap:break-word > object code libraries [EPREFIX/lib]</td>
<td bgcolor="#edf4f9" word-wrap:break-word > Not used by motion. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --includedir=DIR</td>
<td bgcolor="#edf4f9" word-wrap:break-word > C header files [PREFIX/include] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Not used by motion. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --oldincludedir=DIR</td>
<td bgcolor="#edf4f9" word-wrap:break-word > C header files for non-gcc [/usr/include] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Not used by motion. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --infodir=DIR </td>
<td bgcolor="#edf4f9" word-wrap:break-word > info documentation [PREFIX/info] </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Not used by motion. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --mandir=DIR</td>
<td bgcolor="#edf4f9" word-wrap:break-word > man documentation [PREFIX/man]</td>
<td bgcolor="#edf4f9" word-wrap:break-word > Editor recommends the default.</td>
</tr>
<tr>
<th bgcolor="#edf4f9" word-wrap:break-word > Optional Packages: </th>
<th bgcolor="#edf4f9" word-wrap:break-word > </th>
<th bgcolor="#edf4f9" word-wrap:break-word > </th>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --without-bktr </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Exclude bktr video subsystem devices </td>
<td bgcolor="#edf4f9" word-wrap:break-word > ONLY used in *BSD </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --without-v4l2 </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Exclude using v4l2 (video4linux2) subsystem. Makes Motion so it only supports network cameras. </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Can be used if you do not need support and maybe lack some of the libraries for it. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --with-webp </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Compile with webp image support</td>
<td bgcolor="#edf4f9" word-wrap:break-word > </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --with-ffmpeg=DIR </td>
<td bgcolor="#edf4f9" word-wrap:break-word > 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" word-wrap:break-word >
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 may not need to specify the directory prefix.
Configure should 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)
or export that location to be included in the PKG_CONFIG_PATH
The option of --with-ffmpeg is the default for Motion. If the required libraries are not located, the
configure script will stop at the ffmpeg section and report which libraries need to be installed.
Once the required libraries are installed, run the script again. As noted previously, make sure
to install the -dev versions.
For more information on FFmpeg see the documentation for the FFmpeg project. <br />
</td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --without-ffmpeg </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Do not compile with ffmpeg </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Use this if you do not want to compile with ffmpeg. If ffmpeg is not installed you must specify this option for Motion to build without ffmpeg. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --without-mysql </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Do not compile with MySQL support </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Use this if you do not want to include MySQL support in the package. <br /> This can also be useful if you get compilation errors related to MySQL and you actually do not need the feature anyway. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --without-pgsql </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Do not compile with PostgreSQL support </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Use this if you do not want to include PostgreSQL support in the package. <br /> This can also be useful if you get compilation errors related to PostgreSQL and you actually do not need the feature anyway. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --without-sqlite3 </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Disable sqlite3 support in motion. </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Use this if you do not want to include SQLite3 support in the package. <br /> This can also be useful if you get compilation errors related to SQLite4 and you actually do not need the feature anyway. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --without-optimizecpu </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Exclude autodetecting platform and cpu type. This will disable the compilation of gcc optimizing code by platform and cpu. </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Use this if the optimization causes problems. Typically if you build on some non X386 compatible CPU. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > --with-developer-flags </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Add additional warning flags for the compiler. </td>
<td bgcolor="#edf4f9" word-wrap:break-word > 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. </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
</ul>
<h3><a name="Make"></a> Make </h3>
<ul>
Once the configure script has successfully finished and indicates all options desired, a 'makefile' is created.
The makefile builds the Motion program and links in all of the required libraries. To run the makefile on most
distributions, type: <code>make</code> For FreeBSD distributions use <code>gmake</code>
<p></p>
The makefile will go through each of the files and compile it. Depending upon the source code obtained, there may be many
warnings or possibly none.
<p></p>
If the notifications indicate undefined references, then it is most likely that
an additional library needs to be added in via the configure switches. Many of these additional missing libraries
issues are related to the version of ffmpeg and how it was built or installed. The following is a sample of some
of the extra ffmpeg libraries that may need to be added.
<p></p>
<code>
-lavformat -lswscale -lavcodec -lavutil -lfdk-aac -lswresample -lm -lopus -lz -lva -lvpx -lx264 -lmp3lame -lbz2 -ldl -lvorbisenc -lvorbis -ltheoraenc -ltheoradec
</code>
<p></p>
<p></p>
Once the makefile has completed correctly, it will report 'build complete'.
<p></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></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></p>
<h3><a name="Make_Install"></a> Make Install </h3>
For most distributions type <code>make install</code> to install the files. For FreeBSD systems, use
<code>gmake install</code>
<p></p>
These commands create the required directories and copy the files into the following locations. (default directories):
<ul>
<li>/usr/local/bin</li>
<li>usr/local/man/man1</li>
<li>/usr/local/etc/motion</li>
<li>/usr/local/share/doc/motion</li>
<li>/usr/local/share/motion/examples</li>
</ul>
<p></p>
The contents of what gets copied into each directory is as follows:
(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</li>
<li> Example configuration files "*.conf" to /usr/local/share/motion/examples</li>
<li> Configuration file "motion-dist.conf" to /usr/local/etc/motion</li>
</ul>
Note that 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></p>
<h3><a name="Un_Install"></a> Un-install </h3>
From the motion base installation directory you simply run <code>make uninstall</code>
<p></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></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></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></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></p>
<p></p>
</ul>
<h3><a name="Upgrading_From_Older_Version"></a> Upgrading From Older Version </h3>
<ul>
If you are upgrading from an older version of Motion many options have been renamed, added or removed.
The author recommends that you start by copying the configuration files from the older version to a safe
location for reference only. Then start with a clean copy of the new motion-dist.conf installed and make changes to it.
<p></p>
<p></p>
</ul>
</ul>
<h2><a name="Important_Definitions"></a> Important Definitions </h2>
<ul>
<p></p>
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
options.
<p></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/movie 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 red.</li>
<li> A "normal" image is the real image taken by the camera with text overlaid.</li>
</ul>
<p></p>
<p></p>
</ul>
<h2><a name="The_Config_Files"></a> The Configuration Files </h2>
<p></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></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></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/motion)</li>
</ol>
If you have write access to /usr/local/etc/motion then the editor recommends having only one motion.conf file
in the default /usr/local/etc/motion directory.
<p></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/motion directory.
<p></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></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 at the same time. The motion.conf file establishes global parameters that apply to all
cameras and separate camera.conf files that specify the parameters that apply to
each specific camera. The camera.conf files are specified at the bottom of the motion.conf file. If you only
have one camera you only need the motion.conf file but if you have more than one camera, then you will
need to have
<strong>one camera config file per camera</strong> plus the motion.conf file.
<p></p>
So if you have for example two cameras you need motion.conf
<strong>and two</strong> camera config files. So a total of <strong>three</strong> config files.
<p></p>
An option that is common to all cameras can be placed in motion.conf. (You can also put all parameters in the
camera files but that makes a lot of editing when you change a common thing).
<p></p>
An option that is unique to a camera must be defined in each camera file.
<p></p>
<em>It is often seen that people copy the entire motion.conf into the camera 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 camera config files</em>
<p></p>
The first camera is defined in the first camera file called from motion.conf. The 2nd camera is defined in the
2nd camera file called from motion.conf etc.
<p></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 camera config file.
<p></p>
To make it clear, the camera files format and syntax is the same as motion.conf. An example of what you might want
in a camera file as follows: assume you have two cameras, attached to one system. Create files camera0.conf and
camera1.conf. At the end of motion.conf, uncomment out the lines that refer to them. The full contents of the
camera files can be as simple as
<p></p>
<p></p>
camera0.conf:
<br><code><strong> videodevice /dev/video0</strong></code>
<br><code><strong>stream_port 8081</strong></code>
<p></p>
<p></p>
camera1.conf:
<br><code><strong> videodevice /dev/video1</strong></code>
<br><code><strong>stream_port 8082</strong></code>
<p></p>
<p></p>
<p></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 "camera" is defined in motion.conf, the camera 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 camera config file.</li>
<li> Motion reads the command line option again overruling any previously defined options.</li>
</ol>
So always call the camera config files in the end of the motion.conf file. If you define options in motion.conf
AFTER the camera file calls, the same options in the camera files will never be used. So always put the camera
file call at the end of motion.conf.
<p></p>
Nearly all config options can be unique for a specific camera and placed in a camera config file.
There are a few options that must be in motion.conf and cannot be in a camera config
file: stream_auth_method, webcontrol_* , daemon, and camera.
<p></p>
If motion is built without specific features such as ffmpeg, mysql etc it will ignore the options that
belong to those features.
<p></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 camera.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>
<p></p>
</ul>
<h2><a name="Command_Line_Options"></a> Command Line Options </h2>
<ul>
<p></p>
SYNOPSIS
<pre>
motion [ -hbnsm ] [ -c config file path ] [ -d level ] [ -k level ] [ -p process_id_file ] [ -l log_file ]
</pre>
<p></p>
<ul>
<li>-c : Full path and filename of config file.</li>
<li>-h : Show help screen</li>
<li>-b : Run in daemon mode</li>
<li>-n : Run in non-daemon mode</li>
<li>-s : Run in setup mode. Also forces non-daemon mode.</li>
<li>-d : Run with message log level 1 - 9</li>
<li>-k : Run with message log type 1 - 9</li>
<li>-l : Full path and file name for log file</li>
<li>-p : Full path and file name for the process id file</li>
<li>-m : Start in pause mode</li>
</ul>
<p></p>
<p></p>
</ul>
<h2><a name="Signals_Sent"></a> Signals (sent with e.g. kill command) </h2>
<ul>
<p></p>
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 ¦ 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></p>
<table border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<thead>
<tr>
<th bgcolor="#edf4f9" word-wrap:break-word > Signal </th>
<th bgcolor="#edf4f9" word-wrap:break-word > Description </th>
<th bgcolor="#edf4f9" word-wrap:break-word > Editors comment </th>
</tr>
</thead>
<tbody>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > SIGHUP </td>
<td bgcolor="#edf4f9" word-wrap:break-word > The config file will be reread. </td>
<td bgcolor="#edf4f9" word-wrap:break-word > This is a very useful signal when you experiment with settings in the config file. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > SIGTERM </td>
<td bgcolor="#edf4f9" word-wrap:break-word > If needed motion will create an movie file of the last event and exit </td>
<td bgcolor="#edf4f9" word-wrap:break-word > </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > SIGUSR1 </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Motion will create an movie file of the current event. </td>
<td bgcolor="#edf4f9" word-wrap:break-word > </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
</ul>
<h2><a name="Error_Logging"></a> Error Logging </h2>
<ul>
<p></p>
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></p>
Error logging has been implemented so that errors during daemon (background) mode are logged in the syslog or to the user
specified log file.
<p></p>
The log 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>
<p></p>
</ul>
<h2><a name="Basic_Setup"></a> Basic Setup </h2>
<ul>
<p></p>
Before you can start using Motion you need to know some basics about your camera(s).
<p></p>
For video4linux devices, the camera must be installed per the requirements of the camera. It is
out of the scope of this document to tell you how to do this and it depends on which type of camera. Once
the camera is installed it will have the device name(s) of /dev/video0, /dev/video1, /dev/video2...
<p></p>
FreeBSD has a different naming scheme for pci devices that use the bktr subsystem. The bktr subsystem will report
devices using a naming scheme of /dev/bktr0, /dev/bktr1, etc. These device may also need to use the other
special device for the tuner. The tuner will need to be specified with the tunerdevice option as /dev/tuner0.
<p></p>
<strong>USB cameras</strong> take a lot of bandwidth. A USB camera connected to a USB2 port or hub consumes virtually
all the bandwidth that the port can handle. Even with a small framesize and low framerate you should not expect to have
more than one camera per USB controller. If you need more than one USB camera it is possible to add extra USB PCI cards