forked from Motion-Project/motion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
motion_config.html
5769 lines (5476 loc) · 262 KB
/
motion_config.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
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<link href="motion.png" rel="icon" type="image/png">
<title>Motion</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="motion_stylesheet.css" media="screen">
<script>
function fnc_topnav() {
var x = document.getElementById("id_topnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
function fnc_subnav() {
var x = document.getElementById("id_subnav");
if (x.className === "subnav") {
x.className += " responsive";
} else {
x.className = "subnav";
}
}
</script>
</head>
<body>
<div class="topnav" id="id_topnav">
<img class="logoimg" src="motion.gif">
<a class="topnav-d" href="https://motion-project.github.io/motion_support.html">Support</a>
<a class="topnav-d" href="https://motion-project.github.io/motion_news.html" >News</a>
<a class="topnav-d" href="https://motion-project.github.io/motion_guide.html" >Documentation</a>
<a class="topnav-d" href="https://motion-project.github.io/motion_download.html">Download</a>
<a class="topnav-d" href="https://motion-project.github.io/index.html">Home</a>
<a class="topnav-m" href="https://motion-project.github.io/index.html">Home</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_download.html">Download</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_guide.html" >Documentation</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_news.html" >News</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_support.html">Support</a>
<a href="javascript:void(0);" class="icon" onclick="fnc_topnav()">☰</a>
</div>
<section class="page-header">
<h1>
Configuration
</h1>
</section>
<div class="subnav" id="id_subnav">
<div class="dropdown">
<button class="dropbtn">Basic Setup</button>
<div class="dropdown-content">
<a href="#top">General</a>
<a href="#basic_setup_v4l2">V4L2 Devices</a>
<a href="#basic_setup_network">Network Cameras</a>
<a href="#basic_setup_picam">Pi Camera</a>
<a href="#basic_setup_composite">Composite Cards</a>
<a href="#basic_setup_static">Static Files</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Commands/Files</button>
<div class="dropdown-content">
<a href="#commandlineoptions">Command Line</a>
<a href="#configfiles">Configuration Files </a>
<a href="#Signals_Sent">Signals</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Options-List</button>
<div class="dropdown-content">
<a href="#Configuration_OptionsAlpha" >Sorted alphabetically</a>
<a href="#Configuration_OptionsTopic" >Sorted by topic</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">General/Cameras</button>
<div class="dropdown-content">
<a href="#OptTopic_System_Processing">System Processing</a>
<a href="#conversion_specifiers">Conversion Specifiers</a>
<a href="#OptTopic_Video4Linux_Devices">Video4Linux Devices</a>
<a href="#OptTopic_Network_Cameras">Network Cameras</a>
<a href="#OptTopic_Raspi_Cameras">Pi Cameras</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Processing/Output</button>
<div class="dropdown-content">
<a href="#OptTopic_Image_Processing">Image Processing</a>
<a href="#OptTopic_Motion_Detection">Motion Detection</a>
<a href="#OptTopic_Scripts">Script Execution</a>
<a href="#OptTopic_Pictures">Pictures</a>
<a href="#OptTopic_Movies">Movies</a>
<a href="#OptTopic_Pipe">Pipe Output</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Webcontrol/Streams</button>
<div class="dropdown-content">
<a href="#OptTopic_Webcontrol">Webcontrol</a>
<a href="#OptTopic_Stream">Live Stream</a>
<a href="#OptTopic_Database">Database Options</a>
<a href="#OptTopic_Tracking">Tracking Options</a>
</div>
</div>
<a href="javascript:void(0);" class="icon" onclick="fnc_subnav()">menu⇓   </a>
</div>
<section class="main-content">
<h2><a name="Basic_Setup"></a> Basic Setup </h2>
<ul>
<p></p>
Motion is able to process images from many different types of cameras. The following is brief overview
of the process to set up the Motion software.
<ul>
<li>Determine the type of camera
<ul>
<li> <a href="#basic_setup_v4l2" >v4l2 devices</a> which are most webcams</li>
<li> <a href="#basic_setup_composite" >Composite capture cards</a> </li>
<li> <a href="#basic_setup_network" >Network or IP cameras</a> </li>
<li> <a href="#basic_setup_picam" >The PI camera</a> </li>
<li> <a href="#basic_setup_static" >Static movie files</a>.
</ul>
<li>Specify the camera in the <a href="#configfiles" >configuration files</a>.</li>
<li>Start Motion from a terminal via the <a href="#commandlineoptions" >command line</a></li>
<li>Review the messages to ensure camera was found and press cntrl-c to exit</li>
<li>Specify a <a href="#target_dir" >target_dir</a> in the configuration file.</li>
<li>Enable the <a href="#OptDetail_Stream" >web stream</a> in the configuration file </li>
<ul>
<li> Specify a <a href="#stream_port" >stream_port</a></li>
<li> Optionally turn off <a href="#stream_localhost" >stream_localhost</a> if you want to view
the stream from a different computer</li>
</ul>
<li>Enable the <a href="#OptDetail_Webcontrol" >web control</a> in the configuration file </li>
<ul>
<li> Specify a <a href="#webcontrol_port" >webcontrol_port</a></li>
<li> Optionally turn off <a href="#webcontrol_localhost" >webcontrol_localhost</a> if you want to view
the webcontrol from a different computer</li>
<li> Specify which parameters to show on the webcontrol via <a href="#webcontrol_parms" >webcontrol_parms</a></li>
<li> Optionally specify a <a href="#stream_preview_method" >stream_preview_method</a></li>
</ul>
</ul>
The above should allow users to get Motion running and being able to view images via the stream. The
next steps refine and finish a basic setup.
<ul>
<li> Refine how the image is captured with the <a href="#OptTopic_Image_Processing" >image processing</a> parameters</li>
<li> Specify the <a href="#OptTopic_Motion_Detection" >motion detection</a> parameters</li>
<li>
<a href="#OptTopic_Scripts" >Execute scripts</a>, Save
<a href="#OptTopic_Pictures" >pictures</a> or
<a href="#OptTopic_Movies" >movies</a>.
</li>
</ul>
The most difficult step in the above process will be the motion detection settings and specifying them
to minimize the false positives. To assist this process, Motion provides the
<a href="#stream_preview_method" >stream_preview_method</a> option 3 which allows users to see side
by side images of where the motion is occurring next to the regular image.
<ul>
<li> Specify <a href="#stream_preview_method" >stream_preview_method 3</a></li>
<li> Specify <a href="#webcontrol_parms" >webcontrol_parms 2</a> </li>
<li> Start Motion and in a web browser navigate to the webcontrol port</li>
<li> Try adjusting the
<a href="#threshold" >threshold</a>,
<a href="#noise_level" >noise_level</a>,
<a href="#despeckle_filter" >despeckle_filter</a> and
<a href="#smart_mask_speed" >smart_mask_speed</a>
</li>
<li> Make sure to write configuration to file in order to save any changes.</li>
</ul>
Motion also includes a <a href="#setup_mode" >setup_mode</a> which provides more values reported
on the motion images and in the log to assist the setup.
<p></p>
The following are some additional topics which may be of interest during the initial setup.
<ul>
<li>Run automatically at start (Run as <a href="#basic_setup_service" >service</a>)</li>
<li>Remove depreciated parameters warnings (<a href="#config_depreciated" >Remove Depreciated</a>)</li>
<li>List/include all possible configuration parameters (<a href="#config_listall" >All parameters</a>)</li>
</ul>
<p></p>
<a name="basic_setup_v4l2"></a>
<strong>Video4linux devices</strong> 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>
USB cameras 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
to your computer. It is also possible that your computer has more than one controller for different USB slots. For
example, if the computer has six USB ports, the three on the left may be on controller A versus the three on the right
may be on controller B. In this situation, connecting two cameras to ports only on the left would not work due to
excessive bandwidth. However connecting one camera to port on the right and the other to the port on the left
may work since they are on different controllers.
<p></p>
Motion permits the use of video cards that have discreet input channels. Since USB cameras do not have input channels,
the option <a href="#input" >input</a> must be set to the value -1 for USB cameras.
<p></p>
<a name="basic_setup_network"></a>
<strong>Network cameras</strong> are set up via the
<a href="#netcam_url" >netcam_url</a> parameter.
The latest versions of Motion support rtsp format which many cameras now stream. Some users have requested
a list of the network cameras that will work with Motion. Since Motion can now process RTSP streams, almost
all cameras are supported. Simply review the specifications of the camera and validate that
RTSP or RTMP is listed. The cameras that will not work are those specifically sold to be integrated into
proprietary software monitoring systems. When determining cameras, consider carefully before selecting a
wireless camera. Cameras require a solid consistent signal and use a lot of bandwidth. Inconsistencies in
the wireless signal can result in a poor user experience so the use of a hardwired camera is recommended.
<p></p>
The URL connection string to enter is specific to the camera and is
usually provided by the manufacturer. The connection string is the same as what would be used by other
video playing software such as VLC. If the camera does not stream via RTSP and instead uses a MJPEG, then Motion
can also view that format. See the option <a href="#netcam_url" >netcam_url</a> for
additional options.
<p></p>
<a name="basic_setup_picam"></a>
<strong>Raspberry Pi cameras</strong> can be set up two different ways. If Motion is installed by using the
apt packages (e.g. apt-get install motion), then the camera must be set up using the bcm2835-v4l2 module which creates
a v4l2 device for the camera. Users will need to install this module using the
command <code>sudo modprobe bcm2835-v4l2</code>. This
will set up the camera as a normal v4l2 device and it can be accessed via a standard /dev/videoX device. If Motion is
built from source or installed via the deb packages on the project release page, then an additional option is to set
up the camera using the <a href="#mmalcam_name" >mmalcam_name</a> parameter or using
the bcm2835-v4l2 module. <strong>When Motion is installed via apt, the mmalcam option is not available.</strong>
<p></p>
<a name="basic_setup_composite"></a>
<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></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="#input" >input</a>. Input channel numbers start at 0
(which is why the value -1 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 camera config files with the
same video device name but different input numbers Motion automatically
goes into round robin mode.
<p></p>
Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3.
Others 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></p>
Some capture cards are specially made for surveillance with for example 4 inputs.
Others have a TV tuner, a composite input and perhaps also a S-Video input.
For all these cards the inputs are numbered. The numbering varies from card to card so the easiest
is to experiment with a program such as VLC that can show the video stream.
<p></p>
If you use the TV tuner input you also need to set the frequency of the TV channel using the
option <a href="#frequency" >frequency</a>. Otherwise
set <a href="#frequency" >frequency</a> to 0.
<p></p>
Finally you need to set the TV <a href="#norm" >norm</a>.
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></p>
<a name="basic_setup_static"></a>
<strong>Static files</strong> can also be processed by Motion in one of two ways. The first method
is by using the <a href="#netcam_url" >netcam_url</a> option and using a prefix of file:\\. With
this method, Motion will process the file at the speed specified by
<a href="#framerate" >framerate</a>. This allows the user to either speed up or slow down the video
processing to suit the particular need.
<p></p>
The second option for processing a static file requires a bit of additional setup and uses a
v4l2loopback device. To set this up, first install the loopback software as described in the
<a href="#OptDetail_Pipe" >Output - Pipe Options</a>
section of this guide to create a /dev/videoX device and then use software such as ffmpeg to stream
the static file into the v4l2 device. e.g.
<code> ffmpeg -re -i mymovie.mp4 -f v4l2 /dev/video0 </code> Then in a separate terminal, start Motion
with it set to use the <code>/dev/video0</code> device as input. This method can can also be used to
reformat the content to a different format. The following outputs the original movie into a gray pixel format.
<code> ffmpeg -re -i mymovie.mp4 -f v4l2 -pix_fmt gray /dev/video0 </code>
This can be helpful as a interim process where ffmpeg supports a particular input but that format is not yet supported
by Motion.
<p></p>
<a name="basic_setup_service"></a>
<strong>Run as Service</strong>
<p></p>
The following instructions are only applicable to Debian and Ubuntu based systems. For other distributions, users
should consult their distribution documentation and provide pull requests to the Motion developers so that this
section can be updated with their distribution.
<p></p>
Motion can be set up to run as a service which means that it will start automatically whenever the computer
is started. When Motion is installed from apt or from a deb file, default files are installed which can be
easily modified so that Motion starts as a service. If Motion is built directly from source and installed,
then these additional files will need to be copied, modified and installed manually from the source and packaging
repositories.
<p></p>
When setting up Motion to run as a service, it should be done only after all the other configuration
has been completed. It is much easier to edit and revise the parameters when Motion is just running
in a terminal rather than as a service.
<p></p>
To set up to run as a service, first edit the file <code>/etc/default/motion</code> and revise the line
to indicate <code>start_motion_daemon=yes</code>.
Next, edit the main motion.conf file and specify <a href="#daemon" >daemon</a> as <code>on</code>
When the computer is restarted, Motion should now be running. The following commands control
the Motion service.
<ul>
<li>Start the Motion service<code>sudo service motion start</code></li>
<li>Stop the Motion service<code>sudo service motion stop</code></li>
<li>Restart the Motion service<code>sudo service motion restart</code></li>
</ul>
<p></p>
When running as a service, Motion runs as the user <code>motion</code> and this user is automatically
added to the user group of <code>video</code>. By only be included in this user group, when Motion is
run, it will only have limited permissions. It is NOT recommended that this user get added to the
<code>sudo</code> group. Instead, only add this user to groups that are specifically required.
<p></p>
On newer distributions, the above method of running a service is depreciated (but still functional) in
favor of the systemctl method. Since this is not available on all the distributions which Motion is
deployed, the above method is retained. Once systemctl is available on all the deployed versions, Motion
will transition to systemctl as the service method. For users that wish to systemctl rather than the above
method, a <code>motion.system</code> file is included in the source code.
<p></p>
For users that are building and installing from source without a deb file, the file <code>motion.init-Debian</code>
will need to be copied from the examples directory or from the source directory. It will need to be renamed and put
into <code>/etc/init.d/motion</code>. Ensure that it is also marked as executable and has root ownership. Next,
create the file <code>/etc/default/motion</code> with the entry as specified above. Finally, create the
<code>motion</code> user as needed. The scripts that create the groups and users when using
the deb packages can be used as a model. These scripts can be reviewed in the motion-packaging repo, within the
debian directory, motion.postinst (e.g. <code>motion-packaging/debian/motion.postinst</code>
<p></p>
<p></p>
</ul>
<h2><a name="commandlineoptions"></a> Command Line Options </h2>
<ul>
<p></p>
SYNOPSIS
<code>motion [ -hbnsm ] [ -c config file path ] [ -d level ] [ -k level ] [ -p pid_file ] [ -l log_file ]</code>
<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="configfiles"></a> The Configuration Files </h2>
<ul>
<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 /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 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>
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 specified in each camera file.
<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> videodevice /dev/video0</code>
<p></p>
<p></p>
camera1.conf:
<br /><code> videodevice /dev/video1</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: 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>
<a name="config_depreciated"></a>
<p></p>
<strong>Depreciated Parameters</strong>
<p></p>
Over the years, Motion has added many new configuration parameters and changed the name
of a few of them so that there is some consistency to the parameter names. Since version
3.4.1, when a configuration parameter has a new name or additional functionality, Motion will
try to interpret the value specified for the old parameter and translate it to the new parameter.
These translations will be reported in the log as Motion is started. To eliminate these warnings,
ensure that a <a href="#webcontrol_port" >webcontrol_port</a> is specified and that the
<a href="#webcontrol_interface" >webcontrol_interface</a> is specified as 0 (or not listed). Then start
motion, open a browser and navigate to the webcontrol port. When on that page, select
<code>write configuration</code>. This will re-write the configuration files with all the current
parameters to Motion. Note that depending upon where the configuration files are located, Motion
may need to be started using <code>sudo</code>.
<p></p>
<a name="config_listall"></a>
<p></p>
<strong>Parameters in distributed configuration files</strong>
<p></p>
As of this writing, Motion includes over 150 parameters. With this volume of parameters, navigating
the configuration file with every possible has become onerous. Starting with version 4.2, the distributed
configuration files only include a limited subset of the configuration parameters. Users can add to the
files as needed the parameters that are applicable to their set up. Users that wish to have every parameter
listed and included in the configuration file can follow the process described immediately above in
the <a href="#config_depreciated" >Remove Depreciated</a> section.
i.e. Use the webcontrol interface to write out the configuration file.
<p></p>
Extended descriptions / documentation are not included in the configuration file. This guide
should be consulted for documentation of the configuration parameters.
<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>
<div class="tblsignal">
<table border="1" class="fixed" >
<colgroup>
<col width="30%">
<col width="30%">
<col width="30%">
</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>
</div>
<p></p>
<p></p>
</ul>
<h2><a name="Configuration_OptionsAlpha"></a> Configuration Options-Listed Alphabetically </h2>
<ul>
<p></p>
These are the options that can be used in the config file.
<p></p>
All number values are integer numbers (no decimals allowed). Boolean options can be on or off.
<p></p>
Some configuration options are only used if Motion is built on a system that has the matching software libraries installed (MySQL, PostgreSQL, SQLite, FFMPEG, etc).
<p></p>
<p></p>
<style>
@media screen and (max-width: 48em) {
.tblalpha td:nth-of-type(1):before {content: "v3.2"; padding-right: 10px;}
.tblalpha td:nth-of-type(2):before {content: "v4.0"; padding-right: 10px;}
.tblalpha td:nth-of-type(3):before {content: "v4.1"; padding-right: 10px;}
.tblalpha td:nth-of-type(4):before {content: "Cur."; padding-right: 10px;}
}
</style>
<div class="tblalpha">
<table cellspacing="0" border="0">
<colgroup width="15%"></colgroup>
<colgroup width="25%"></colgroup>
<colgroup width="25%"></colgroup>
<colgroup width="25%"></colgroup>
<tr>
<td align="left"><b>Version 3.2</b></td>
<td align="left"><b>Version 4.0</b></td>
<td align="left"><b>Version 4.1</b></td>
<td align="left"><b>Current Version</b></td>
</tr>
<tr>
<td align="left">area_detect</td>
<td align="left">area_detect</td>
<td align="left">area_detect</td>
<td align="left"><a href="#area_detect" >area_detect</a></td>
</tr>
<tr>
<td height="17" align="left">auto_brightness</td>
<td align="left">auto_brightness</td>
<td align="left">auto_brightness</td>
<td align="left"><a href="#auto_brightness" >auto_brightness</a></td>
</tr>
<tr>
<td align="left">thread</td>
<td align="left">camera</td>
<td align="left">camera</td>
<td align="left"><a href="#camera" >camera</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">camera_dir</td>
<td align="left">camera_dir</td>
<td align="left"><a href="#camera_dir" >camera_dir</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">camera_id</td>
<td align="left">camera_id</td>
<td align="left"><a href="#camera_id" >camera_id</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">camera_name</td>
<td align="left">camera_name</td>
<td align="left"><a href="#camera_name" >camera_name</a></td>
</tr>
<tr>
<td align="left">daemon</td>
<td align="left">daemon</td>
<td align="left">daemon</td>
<td align="left"><a href="#daemon" >daemon</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">database_busy_timeout</td>
<td align="left">database_busy_timeout</td>
<td align="left"><a href="#database_busy_timeout" >database_busy_timeout</a></td>
</tr>
<tr>
<td align="left">mysql_db</td>
<td align="left">database_dbname</td>
<td align="left">database_dbname</td>
<td align="left"><a href="#database_dbname" >database_dbname</a></td>
</tr>
<tr>
<td align="left">pgsql_db</td>
<td align="left">database_dbname</td>
<td align="left">database_dbname</td>
<td align="left"><a href="#database_dbname" >database_dbname</a></td>
</tr>
<tr>
<td align="left">mysql_host</td>
<td align="left">database_host</td>
<td align="left">database_host</td>
<td align="left"><a href="#database_host" >database_host</a></td>
</tr>
<tr>
<td align="left">pgsql_host</td>
<td align="left">database_host</td>
<td align="left">database_host</td>
<td align="left"><a href="#database_host" >database_host</a></td>
</tr>
<tr>
<td align="left">mysql_password</td>
<td align="left">database_password</td>
<td align="left">database_password</td>
<td align="left"><a href="#database_password" >database_password</a></td>
</tr>
<tr>
<td align="left">pgsql_password</td>
<td align="left">database_password</td>
<td align="left">database_password</td>
<td align="left"><a href="#database_password" >database_password</a></td>
</tr>
<tr>
<td align="left">pgsql_port</td>
<td align="left">database_port</td>
<td align="left">database_port</td>
<td align="left"><a href="#database_port" >database_port</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">database_type</td>
<td align="left">database_type</td>
<td align="left"><a href="#database_type" >database_type</a></td>
</tr>
<tr>
<td align="left">mysql_user</td>
<td align="left">database_user</td>
<td align="left">database_user</td>
<td align="left"><a href="#database_user" >database_user</a></td>
</tr>
<tr>
<td align="left">pgsql_user</td>
<td align="left">database_user</td>
<td align="left">database_user</td>
<td align="left"><a href="#database_user" >database_user</a></td>
</tr>
<tr>
<td align="left">despeckle</td>
<td align="left">despeckle_filter</td>
<td align="left">despeckle_filter</td>
<td align="left"><a href="#despeckle_filter" >despeckle_filter</a></td>
</tr>
<tr>
<td align="left">output_all</td>
<td align="left">emulate_motion</td>
<td align="left">emulate_motion</td>
<td align="left"><a href="#emulate_motion" >emulate_motion</a></td>
</tr>
<tr>
<td align="left">gap</td>
<td align="left">event_gap</td>
<td align="left">event_gap</td>
<td align="left"><a href="#event_gap" >event_gap</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left">flip_axis</td>
<td align="left"><a href="#flip_axis" >flip_axis</a></td>
</tr>
<tr>
<td align="left">framerate</td>
<td align="left">framerate</td>
<td align="left">framerate</td>
<td align="left"><a href="#framerate" >framerate</a></td>
</tr>
<tr>
<td align="left">frequency</td>
<td align="left">frequency</td>
<td align="left">frequency</td>
<td align="left"><a href="#frequency" >frequency</a></td>
</tr>
<tr>
<td align="left">height</td>
<td align="left">height</td>
<td align="left">height</td>
<td align="left"><a href="#height" >height</a></td>
</tr>
<tr>
<td align="left">input</td>
<td align="left">input</td>
<td align="left">input</td>
<td align="left"><a href="#input" >input</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left"><a href="#lightswitch_frames" >lightswitch_frames</a></td>
</tr>
<tr>
<td align="left">lightswitch</td>
<td align="left">lightswitch</td>
<td align="left">lightswitch</td>
<td align="left"><a href="#lightswitch_percent" >lightswitch_percent</a></td>
</tr>
<tr>
<td align="left">locate</td>
<td align="left">locate_motion_mode</td>
<td align="left">locate_motion_mode</td>
<td align="left"><a href="#locate_motion_mode" >locate_motion_mode</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">locate_motion_style</td>
<td align="left">locate_motion_style</td>
<td align="left"><a href="#locate_motion_style" >locate_motion_style</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">logfile</td>
<td align="left">logfile</td>
<td align="left"><a href="#log_file" >log_file</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">log_level</td>
<td align="left">log_level</td>
<td align="left"><a href="#log_level" >log_level</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">log_type</td>
<td align="left">log_type</td>
<td align="left"><a href="#log_type" >log_type</a></td>
</tr>
<tr>
<td align="left">mask_file</td>
<td align="left">mask_file</td>
<td align="left">mask_file</td>
<td align="left"><a href="#mask_file" >mask_file</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left">mask_privacy</td>
<td align="left"><a href="#mask_privacy" >mask_privacy</a></td>
</tr>
<tr>
<td align="left">minimum_frame_time</td>
<td align="left">minimum_frame_time</td>
<td align="left">minimum_frame_time</td>
<td align="left"><a href="#minimum_frame_time" >minimum_frame_time</a></td>
</tr>
<tr>
<td align="left">minimum_motion_frames</td>
<td align="left">minimum_motion_frames</td>
<td align="left">minimum_motion_frames</td>
<td align="left"><a href="#minimum_motion_frames" >minimum_motion_frames</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">mmalcam_control_params</td>
<td align="left">mmalcam_control_params</td>
<td align="left"><a href="#mmalcam_control_params" >mmalcam_control_params</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">mmalcam_name</td>
<td align="left">mmalcam_name</td>
<td align="left"><a href="#mmalcam_name" >mmalcam_name</a></td>
</tr>
<tr>
<td align="left">ffmpeg_bps</td>
<td align="left">ffmpeg_bps</td>
<td align="left">ffmpeg_bps</td>
<td align="left"><a href="#movie_bps" >movie_bps</a></td>
</tr>
<tr>
<td align="left">ffmpeg_video_codec</td>
<td align="left">ffmpeg_video_codec</td>
<td align="left">ffmpeg_video_codec</td>
<td align="left"><a href="#movie_codec" >movie_codec</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">ffmpeg_duplicate_frames</td>
<td align="left">ffmpeg_duplicate_frames</td>
<td align="left"><a href="#movie_duplicate_frames" >movie_duplicate_frames</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">extpipe</td>
<td align="left">extpipe</td>
<td align="left"><a href="#movie_extpipe" >movie_extpipe</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">use_extpipe</td>
<td align="left">use_extpipe</td>
<td align="left"><a href="#movie_extpipe_use" >movie_extpipe_use</a></td>
</tr>
<tr>
<td align="left">movie_filename</td>
<td align="left">movie_filename</td>
<td align="left">movie_filename</td>
<td align="left"><a href="#movie_filename" >movie_filename</a></td>
</tr>
<tr>
<td align="left">max_mpeg_time</td>
<td align="left">max_movie_time</td>
<td align="left">max_movie_time</td>
<td align="left"><a href="#movie_max_time" >movie_max_time</a></td>
</tr>
<tr>
<td align="left">ffmpeg_cap_new</td>
<td align="left">ffmpeg_output_movies</td>
<td align="left">ffmpeg_output_movies</td>
<td align="left"><a href="#movie_output" >movie_output</a></td>
</tr>
<tr>
<td align="left">ffmpeg_cap_motion</td>
<td align="left">ffmpeg_output_debug_movies</td>
<td align="left">ffmpeg_output_debug_movies</td>
<td align="left"><a href="#movie_output_motion" >movie_output_motion</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left"><a href="#movie_passthrough" >movie_passthrough</a></td>
</tr>
<tr>
<td align="left">ffmpeg_variable_bitrate</td>
<td align="left">ffmpeg_variable_bitrate</td>
<td align="left">ffmpeg_variable_bitrate</td>
<td align="left"><a href="#movie_quality" >movie_quality</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left"><a href="#native_language" >native_language</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left">netcam_highres</td>
<td align="left"><a href="#netcam_highres" >netcam_highres</a></td>
</tr>
<tr>
<td align="left">netcam_keepalive</td>
<td align="left">netcam_keepalive</td>
<td align="left">netcam_keepalive</td>
<td align="left"><a href="#netcam_keepalive" >netcam_keepalive</a></td>
</tr>
<tr>
<td align="left">netcam_proxy</td>
<td align="left">netcam_proxy</td>
<td align="left">netcam_proxy</td>
<td align="left"><a href="#netcam_proxy" >netcam_proxy</a></td>
</tr>
<tr>
<td align="left">netcam_tolerant_check</td>
<td align="left">netcam_tolerant_check</td>
<td align="left">netcam_tolerant_check</td>
<td align="left"><a href="#netcam_tolerant_check" >netcam_tolerant_check</a></td>
</tr>
<tr>
<td align="left">netcam_url</td>
<td align="left">netcam_url</td>
<td align="left">netcam_url</td>
<td align="left"><a href="#netcam_url" >netcam_url</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">rtsp_uses_tcp</td>
<td align="left">rtsp_uses_tcp</td>
<td align="left"><a href="#netcam_use_tcp" >netcam_use_tcp</a></td>
</tr>
<tr>
<td align="left">netcam_userpass</td>
<td align="left">netcam_userpass</td>
<td align="left">netcam_userpass</td>
<td align="left"><a href="#netcam_userpass" >netcam_userpass</a></td>
</tr>
<tr>
<td align="left">noise_level</td>
<td align="left">noise_level</td>
<td align="left">noise_level</td>
<td align="left"><a href="#noise_level" >noise_level</a></td>
</tr>
<tr>
<td align="left">noise_tune</td>
<td align="left">noise_tune</td>
<td align="left">noise_tune</td>
<td align="left"><a href="#noise_tune" >noise_tune</a></td>
</tr>
<tr>
<td align="left">norm</td>
<td align="left">norm</td>
<td align="left">norm</td>
<td align="left"><a href="#norm" >norm</a></td>
</tr>
<tr>
<td align="left">on_area_detected</td>
<td align="left">on_area_detected</td>
<td align="left">on_area_detected</td>
<td align="left"><a href="#on_area_detected" >on_area_detected</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left">on_camera_found</td>
<td align="left"><a href="#on_camera_found" >on_camera_found</a></td>
</tr>
<tr>
<td align="left">on_camera_lost</td>
<td align="left">on_camera_lost</td>
<td align="left">on_camera_lost</td>
<td align="left"><a href="#on_camera_lost" >on_camera_lost</a></td>
</tr>
<tr>
<td align="left">on_event_end</td>
<td align="left">on_event_end</td>
<td align="left">on_event_end</td>
<td align="left"><a href="#on_event_end" >on_event_end</a></td>
</tr>
<tr>
<td align="left">on_event_start</td>
<td align="left">on_event_start</td>
<td align="left">on_event_start</td>
<td align="left"><a href="#on_event_start" >on_event_start</a></td>
</tr>
<tr>
<td align="left">on_motion_detected</td>
<td align="left">on_motion_detected</td>
<td align="left">on_motion_detected</td>
<td align="left"><a href="#on_motion_detected" >on_motion_detected</a></td>
</tr>
<tr>
<td align="left">on_movie_end</td>
<td align="left">on_movie_end</td>
<td align="left">on_movie_end</td>
<td align="left"><a href="#on_movie_end" >on_movie_end</a></td>
</tr>
<tr>
<td align="left">on_movie_start</td>
<td align="left">on_movie_start</td>
<td align="left">on_movie_start</td>
<td align="left"><a href="#on_movie_start" >on_movie_start</a></td>
</tr>
<tr>
<td align="left">on_picture_save</td>
<td align="left">on_picture_save</td>
<td align="left">on_picture_save</td>
<td align="left"><a href="#on_picture_save" >on_picture_save</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left">exif_text</td>
<td align="left">exif_text</td>
<td align="left"><a href="#picture_exif" >picture_exif</a></td>
</tr>
<tr>
<td align="left">output_normal</td>
<td align="left">output_pictures</td>
<td align="left">output_pictures</td>
<td align="left"><a href="#picture_output" >picture_output</a></td>