forked from sackmotion/motion
-
Notifications
You must be signed in to change notification settings - Fork 1
/
motion_guide.html
3542 lines (3532 loc) · 349 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><a name="_Motion_Guide_One_Large_Document"></a> Motion Guide - One Large Document. </h1>
This version of the Guide is made for inclusion in the Motion download package for off line reading.
<p />
If you read this document from the distribution package of Motion or from some not up to date mirror you should know that the URL for the always up to date version is <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuide" target="_top">http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuide</a>. If you are already on the new TWiki based Motion site clicking the link just mentioned will lead you to the index page for the Motion Guide documents.
<hr />
This topic consists of the following subtopics:
<a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionOverview" class="twikiLink">MotionOverview</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/KnownProblems" class="twikiLink">KnownProblems</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/InstallOverview" class="twikiLink">InstallOverview</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/PrepareInstall" class="twikiLink">PrepareInstall</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigureScript" class="twikiLink">ConfigureScript</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MakeInstall" class="twikiLink">MakeInstall</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/UpgradingFromOlderVersion" class="twikiLink">UpgradingFromOlderVersion</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/RunningMotionConfigFiles" class="twikiLink">RunningMotionConfigFiles</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/CommandLineOptions" class="twikiLink">CommandLineOptions</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigFileOptions" class="twikiLink">ConfigFileOptions</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/SignalsKill" class="twikiLink">SignalsKill</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ErrorLogging" class="twikiLink">ErrorLogging</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/CaptureDeviceOptions" class="twikiLink">CaptureDeviceOptions</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionDetectionSettings" class="twikiLink">MotionDetectionSettings</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ImageFileOutput" class="twikiLink">ImageFileOutput</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/TuningMotion" class="twikiLink">TuningMotion</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MpegFilmsFFmpeg" class="twikiLink">MpegFilmsFFmpeg</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/SnapshotsWebCam" class="twikiLink">SnapshotsWebCam</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/TextFeatures" class="twikiLink">TextFeatures</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/AdvancedFilenames" class="twikiLink">AdvancedFilenames</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConversionSpecifiers" class="twikiLink">ConversionSpecifiers</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/WebcamServer" class="twikiLink">WebcamServer</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/RemoteControlHttp" class="twikiLink">RemoteControlHttp</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ExternalCommands" class="twikiLink">ExternalCommands</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/TrackingControl" class="twikiLink">TrackingControl</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/UsingDatabases" class="twikiLink">UsingDatabases</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/LoopbackDevice" class="twikiLink">LoopbackDevice</a>.
<hr />
<p />
<div class="twikiToc"> <ul>
<li> <a href="#Motion_Guide_Installation"> Motion Guide - Installation</a> <ul>
<li> <a href="#Motion_Overview"> Motion Overview</a> <ul>
<li> <a href="#What_is_Motion"> What is Motion?</a>
</li> <li> <a href="#How_do_I_get_Motion_and_what_doe"> How do I get Motion and what does it cost?</a>
</li> <li> <a href="#Maintenance_and_Support"> Maintenance and Support</a>
</li> <li> <a href="#Which_version_to_download_and_us"> Which version to download and use?</a>
</li> <li> <a href="#What_features_does_Motion_have"> What features does Motion have?</a>
</li> <li> <a href="#FreeBSD"> FreeBSD</a>
</li> <li> <a href="#MacOSX"> MacOSX</a>
</li> <li> <a href="#Documentation"> Documentation</a>
</li> <li> <a href="#Supported_Hardware"> Supported Hardware</a>
</li></ul>
</li> <li> <a href="#Known_Problems"> Known Problems</a>
</li> <li> <a href="#How_do_I_install_Motion"> How do I install Motion?</a>
</li> <li> <a href="#Preparation_For_Install"> Preparation For Install</a>
</li> <li> <a href="#Configure_Script"> Configure Script</a>
</li> <li> <a href="#Make"> Make</a> <ul>
<li> <a href="#Make_Install"> Make Install</a>
</li> <li> <a href="#Un_install"> Un-install</a>
</li> <li> <a href="#Additional_Make_Options"> Additional Make Options</a>
</li></ul>
</li> <li> <a href="#Upgrading_From_Older_Version"> Upgrading From Older Version</a>
</li> <li> <a href="#Running_Motion"> Running Motion</a> <ul>
<li> <a href="#Important_Definitions"> Important Definitions</a>
</li> <li> <a href="#The_Config_Files"> The Config Files</a>
</li></ul>
</li> <li> <a href="#Command_Line_Options"> Command Line Options</a>
</li> <li> <a href="#Config_File_Options"> Config File Options</a> <ul>
<li> <a href="#Options_in_Alphabetical_Order"> Options in Alphabetical Order.</a>
</li></ul>
</li> <li> <a href="#Signals_sent_with_e_g_kill_comma"> Signals (sent with e.g. kill command)</a>
</li> <li> <a href="#Error_Logging"> Error Logging</a>
</li></ul>
</li> <li> <a href="#Motion_Guide_Basic_Features"> Motion Guide - Basic Features</a> <ul>
<li> <a href="#Capture_Device_Options_The_Basic"> Capture Device Options - The Basic Setup</a>
</li> <li> <a href="#video4linux_V4L_devices"> video4linux (V4L) devices</a> <ul>
<li> <a href="#auto_brightness"> auto_brightness</a>
</li> <li> <a href="#brightness"> brightness</a>
</li> <li> <a href="#contrast"> contrast</a>
</li> <li> <a href="#framerate"> framerate</a>
</li> <li> <a href="#frequency"> frequency</a>
</li> <li> <a href="#height"> height </a>
</li> <li> <a href="#hue"> hue</a>
</li> <li> <a href="#input"> input </a>
</li> <li> <a href="#minimum_frame_time"> minimum_frame_time</a>
</li> <li> <a href="#norm"> norm</a>
</li> <li> <a href="#rotate"> rotate</a>
</li> <li> <a href="#saturation"> saturation</a>
</li> <li> <a href="#tunerdevice"> tunerdevice</a>
</li> <li> <a href="#videodevice"> videodevice</a>
</li> <li> <a href="#width"> width</a>
</li></ul>
</li> <li> <a href="#Network_Cameras"> Network Cameras</a> <ul>
<li> <a href="#netcam_proxy"> netcam_proxy</a>
</li> <li> <a href="#netcam_url"> netcam_url</a>
</li> <li> <a href="#netcam_userpass"> netcam_userpass</a>
</li></ul>
</li> <li> <a href="#Round_Robin_feature"> Round Robin feature</a> <ul>
<li> <a href="#roundrobin_frames"> roundrobin_frames</a>
</li> <li> <a href="#roundrobin_skip"> roundrobin_skip</a>
</li> <li> <a href="#switchfilter"> switchfilter</a>
</li></ul>
</li> <li> <a href="#Motion_Detection_Settings"> Motion Detection Settings</a> <ul>
<li> <a href="#despeckle"> despeckle</a>
</li> <li> <a href="#gap"> gap</a>
</li> <li> <a href="#lightswitch"> lightswitch </a>
</li> <li> <a href="#low_cpu"> low_cpu</a>
</li> <li> <a href="#mask_file"> mask_file</a>
</li> <li> <a href="#max_mpeg_time"> max_mpeg_time</a>
</li> <li> <a href="#minimum_gap"> minimum_gap</a>
</li> <li> <a href="#minimum_motion_frames"> minimum_motion_frames</a>
</li> <li> <a href="#night_compensate"> night_compensate</a>
</li> <li> <a href="#noise_level"> noise_level</a>
</li> <li> <a href="#noise_tune"> noise_tune</a>
</li> <li> <a href="#output_all"> output_all</a>
</li> <li> <a href="#post_capture"> post_capture</a>
</li> <li> <a href="#pre_capture"> pre_capture</a>
</li> <li> <a href="#smart_mask_speed"> smart_mask_speed</a>
</li> <li> <a href="#threshold"> threshold</a>
</li> <li> <a href="#threshold_tune"> threshold_tune</a>
</li></ul>
</li> <li> <a href="#Image_File_Output"> Image File Output</a> <ul>
<li> <a href="#output_motion"> output_motion</a>
</li> <li> <a href="#output_normal"> output_normal</a>
</li> <li> <a href="#ppm"> ppm</a>
</li> <li> <a href="#quality"> quality</a>
</li></ul>
</li> <li> <a href="#Tuning_Motion"> Tuning Motion</a>
</li> <li> <a href="#Generating_MPEG_films_with_ffmpe"> Generating MPEG films with ffmpeg</a> <ul>
<li> <a href="#ffmpeg_bps"> ffmpeg_bps</a>
</li> <li> <a href="#ffmpeg_cap_motion"> ffmpeg_cap_motion</a>
</li> <li> <a href="#ffmpeg_cap_new"> ffmpeg_cap_new</a>
</li> <li> <a href="#ffmpeg_deinterlace"> ffmpeg_deinterlace</a>
</li> <li> <a href="#ffmpeg_timelapse"> ffmpeg_timelapse</a>
</li> <li> <a href="#ffmpeg_timelapse_mode"> ffmpeg_timelapse_mode</a>
</li> <li> <a href="#ffmpeg_variable_bitrate"> ffmpeg_variable_bitrate</a>
</li> <li> <a href="#ffmpeg_video_codec"> ffmpeg_video_codec</a>
</li></ul>
</li> <li> <a href="#Snapshots_The_Traditional_Period"> Snapshots - The Traditional Periodic Web Camera</a> <ul>
<li> <a href="#snapshot_interval"> snapshot_interval</a>
</li></ul>
</li> <li> <a href="#Text_Features"> Text Features</a> <ul>
<li> <a href="#locate"> locate</a>
</li> <li> <a href="#text_changes"> text_changes</a>
</li> <li> <a href="#text_double"> text_double</a>
</li> <li> <a href="#text_event"> text_event</a>
</li> <li> <a href="#text_left"> text_left</a>
</li> <li> <a href="#text_right"> text_right</a>
</li></ul>
</li> <li> <a href="#Advanced_Filenames"> Advanced Filenames</a> <ul>
<li> <a href="#ffmpeg_filename_now_called_movie"> ffmpeg_filename (now called movie_filename)</a>
</li> <li> <a href="#jpeg_filename"> jpeg_filename</a>
</li> <li> <a href="#movie_filename"> movie_filename</a>
</li> <li> <a href="#snapshot_filename"> snapshot_filename</a>
</li> <li> <a href="#target_dir"> target_dir</a>
</li> <li> <a href="#timelapse_filename"> timelapse_filename</a>
</li></ul>
</li> <li> <a href="#Conversion_Specifiers_for_Advanc"> Conversion Specifiers for Advanced Filename and Text Features</a>
</li> <li> <a href="#Webcam_Server"> Webcam Server</a> <ul>
<li> <a href="#webcam_limit"> webcam_limit</a>
</li> <li> <a href="#webcam_localhost"> webcam_localhost</a>
</li> <li> <a href="#webcam_maxrate"> webcam_maxrate</a>
</li> <li> <a href="#webcam_motion"> webcam_motion</a>
</li> <li> <a href="#webcam_port"> webcam_port</a>
</li> <li> <a href="#webcam_quality"> webcam_quality</a>
</li></ul>
</li> <li> <a href="#Remote_Control_with_http"> Remote Control with http</a> <ul>
<li> <a href="#control_authentication"> control_authentication</a>
</li> <li> <a href="#control_html_output"> control_html_output</a>
</li> <li> <a href="#control_localhost"> control_localhost</a>
</li> <li> <a href="#control_port"> control_port</a>
</li></ul>
</li> <li> <a href="#External_Commands"> External Commands</a> <ul>
<li> <a href="#on_event_end"> on_event_end</a>
</li> <li> <a href="#on_event_start"> on_event_start</a>
</li> <li> <a href="#on_motion_detected"> on_motion_detected</a>
</li> <li> <a href="#on_movie_end"> on_movie_end</a>
</li> <li> <a href="#on_movie_start"> on_movie_start</a>
</li> <li> <a href="#on_picture_save"> on_picture_save</a>
</li> <li> <a href="#quiet"> quiet</a>
</li> <li> <a href="#What_happened_to_mail_and_sms"> What happened to mail and sms?</a> <ul>
<li> <a href="#Sending_email_at_start_of_event"> Sending email at start of event</a>
</li> <li> <a href="#Sending_SMS_at_start_of_event"> Sending SMS at start of event</a>
</li></ul>
</li></ul>
</li></ul>
</li> <li> <a href="#Motion_Guide_Special_Features"> Motion Guide - Special Features</a> <ul>
<li> <a href="#Tracking_Control"> Tracking Control</a> <ul>
<li> <a href="#Tracking_Feature_with_Logitech_Q"> Tracking Feature with Logitech Quickcam Sphere/Orbit</a>
</li> <li> <a href="#track_auto"> track_auto</a>
</li> <li> <a href="#track_iomojo_id"> track_iomojo_id</a>
</li> <li> <a href="#track_maxx"> track_maxx</a>
</li> <li> <a href="#track_maxy"> track_maxy</a>
</li> <li> <a href="#track_motorx"> track_motorx</a>
</li> <li> <a href="#track_motory"> track_motory</a>
</li> <li> <a href="#track_move_wait"> track_move_wait</a>
</li> <li> <a href="#track_port"> track_port</a>
</li> <li> <a href="#track_speed"> track_speed</a>
</li> <li> <a href="#track_step_angle_x"> track_step_angle_x</a>
</li> <li> <a href="#track_step_angle_y"> track_step_angle_y</a>
</li> <li> <a href="#track_stepsize"> track_stepsize</a>
</li> <li> <a href="#track_type"> track_type</a>
</li></ul>
</li> <li> <a href="#Using_Databases"> Using Databases</a> <ul>
<li> <a href="#sql_log_image"> sql_log_image</a>
</li> <li> <a href="#sql_log_mpeg"> sql_log_mpeg</a>
</li> <li> <a href="#sql_log_snapshot"> sql_log_snapshot</a>
</li> <li> <a href="#sql_log_timelapse"> sql_log_timelapse</a>
</li> <li> <a href="#sql_query"> sql_query</a>
</li></ul>
</li> <li> <a href="#MySQL"> MySQL</a> <ul>
<li> <a href="#mysql_db"> mysql_db</a>
</li> <li> <a href="#mysql_host"> mysql_host</a>
</li> <li> <a href="#mysql_password"> mysql_password</a>
</li> <li> <a href="#mysql_user"> mysql_user</a>
</li></ul>
</li> <li> <a href="#PostgreSQL"> PostgreSQL</a> <ul>
<li> <a href="#pgsql_db"> pgsql_db</a>
</li> <li> <a href="#pgsql_host"> pgsql_host</a>
</li> <li> <a href="#pgsql_password"> pgsql_password</a>
</li> <li> <a href="#pgsql_port"> pgsql_port</a>
</li> <li> <a href="#pgsql_user"> pgsql_user</a>
</li></ul>
</li> <li> <a href="#Video4Linux_Loopback_Device"> Video4Linux Loopback Device</a> <ul>
<li> <a href="#motion_video_pipe"> motion_video_pipe</a>
</li> <li> <a href="#video_pipe"> video_pipe</a>
</li></ul>
</li></ul>
</li></ul>
</div>
<p />
<h1><a name="Motion_Guide_Installation"></a> Motion Guide - Installation </h1>
<p />
<h2><a name="Motion_Overview"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionOverview" class="twikiLink">Motion Overview</a> </h2>
<p />
<h3><a name="What_is_Motion"></a><a name="What_is_Motion_"></a> What is Motion? </h3>
Motion is a program that monitors the video signal from one or more cameras and is able to detect if a significant part of the picture has changed. Or in other words, it can detect motion.
<p />
The program is written in C and is made for the Linux operating system.
<p />
Motion is a command line based tool. It has absolutely no graphical user interface. Everything is setup either via the command line or via a set of configuration files (simple ASCII files that can be edited by any ASCII editor).
<p />
The output from motion can be:
<p /> <ul>
<li> jpg files
</li> <li> ppm format files
</li> <li> mpeg video sequences
</li></ul>
<p />
<h3><a name="How_do_I_get_Motion_and_what_doe"></a> How do I get Motion and what does it cost? </h3>
Motion is an open source type of project. It does not cost anything. Motion is published under the <a href="http://www.gnu.org/licenses/gpl.html" rel="nofollow" target="_top">GNU GENERAL PUBLIC LICENSE</a> (GPL) version 2 or later. It may be a bit difficult to understand all the details of the license text (especially if your first language is not English). It means that you can get the program, install it and use it freely. You do not have to pay anything and you do not have to register anywhere or ask the author or publisher for permission. The GPL gives you both rights and some very reasonable duties when it comes to copying, distribution and modification of the program. So in very general terms you do not have to worry about licensing as a normal hobby user. If you want to use Motion in a commercial product, if you want to distribute either modified or original versions of Motion - for free or for a fee, you should read the license carefully. For more information about free software and the GPL, I encourage you to study the very interesting documents about the subject available the of the Free Software Foundation pages about the <a href="http://www.gnu.org/philosophy/philosophy.html" rel="nofollow" target="_top">Philosophy of the GNU Project</a>.
<p />
<h3><a name="Maintenance_and_Support"></a> Maintenance and Support </h3>
Both Motion and the Motion Guide are written by people that do all this as a hobby and without asking for any payments or donations. We have a life other than developing Motion and its documentation. This means that bugfixes and updates to this guide are done as our time and families allow it. You are however encouraged to participate and contribute in a very active <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MailingList" class="twikiLink">mailing list</a>. It is a list with a very "positive attitude" and with many contributors that propose features, post patches, discuss problems and patiently answer newbie questions with a very positive spirit. Expect 1-10 emails per day.
<p />
To get motion direct your browser to the <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome" class="twikiCurrentWebHomeLink twikiLink">Motion Homepage</a>.
<p />
On the <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/DownloadFiles" class="twikiLink">Download Files</a> page you will find a links to the latest stable version both as sources and binaries for some of the most popular Linux distributions. You will also find links to development versions. Snapshot releases are special test releases that are normally very stable. Every day a <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionDailySourceSnap" class="twikiLink">Motion Daily Source Snap</a> is created from the <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionSubversion" class="twikiLink">Motion Subversion</a>
<p />
Motion was originally written by Jeroen Vreeken who still actively participates in the development of Motion and later Folkert van Heusden continued as a lead programmer with Kenneth Lavrsen responsible for Motion Guide, website and releases on Sourceforge.
<p />
From version 3.1.12 Motion is now project managed entirely by Kenneth Lavrsen, and the project now shift towards being developed by many contributers.
<p />
For support we encourage you to join the mailing list instead of writing to Jeroen, Folkert or Kenneth directly. We are all very active on the mailing list and by using the mailing list much more users will have benefit of the answers. Newbies and stupid questions are welcome on the list. Contributions in the form of patches are also very welcome on the mailing list.
<p />
<h3><a name="Which_version_to_download_and_us"></a> Which version to download and use? </h3>
Versions 3.2.X are the current version. There is at the moment no development branch. The versions 3.1.X ended at 3.1.20 and there will be no more 3.1.X releases. If you use use a version older than 3.2.X you are encouraged to update.
<p />
Since 3.1.13 quite many options have been renamed to make setting up Motion easier. From 3.1.17-18 some unfinished features have been removed. The Berkeley mpeg feature is now removed because the ffmpeg feature is now mature and much better working. At version 3.1.18 a new network camera feature was introduced replacing the old cURL based netcam code and introducing support of mjpeg streaming cameras. However this new code was quite difficult to get stable. During the development of 3.2.2 the network camera code was totally rewritten again learning from our experience and now finally it seems to be stable.
<p />
Since 3.2.3 Debian users can find binary packages on the Motion Sourceforge file download page. You can find Debian versions of Motion in different Debian repositories but they are all out of date and hardly ever get updated.
<p />
<h3><a name="What_features_does_Motion_have"></a><a name="What_features_does_Motion_have_"></a> What features does Motion have? </h3>
See more description at the <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome" class="twikiCurrentWebHomeLink twikiLink">Motion Homepage</a>. <ul>
<li> Taking snapshots of movement
</li> <li> Watch multiple video devices at the same time
</li> <li> Watch multiple inputs on one capture card at the same time
</li> <li> Live streaming webcam (using multipart/x-mixed-replace)
</li> <li> Real time creation of mpeg movies using libraries from ffmpeg
</li> <li> Take automated snapshots on regular intervals
</li> <li> Take automated snapshots at irregular intervals using cron
</li> <li> Executing external program when detecting movement
</li> <li> Execute external program at the beginning of an event of several motion detections.
</li> <li> Execute external program at the end of an event of several motion detections.
</li> <li> Execute external program when a picture is saved.
</li> <li> Execute external program when a movie mpeg is created (opened)
</li> <li> Execite external program when a movie mpeg ends (closed)
</li> <li> Motion tracking
</li> <li> Feed events to an MySQL or PostgreSQL database.
</li> <li> Feed video back to a video4linux loopback for real time viewing
</li> <li> Web interface using <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/RelatedProjects" class="twikiLink">Motion Related Projects</a> such as <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionCGI" class="twikiLink">motion.cgi</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/KennethsWebcamPackage" class="twikiLink">Kenneths Webcam Package</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/KevinsWebpage" class="twikiLink">Kevins Webpage</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/XMotionTool" class="twikiLink">X-Motion</a> and many more.
</li> <li> User configurable and user defined on screen display.
</li> <li> Control via simple web interface.
</li> <li> Automatic noise and threshold control
</li> <li> Ability to control the pan/tilt of a Logitech Sphere (or Orbit) camera
</li> <li> Highly configurable display of text on images.
</li> <li> High configurable definition of path and file names of the stored images and films.
</li></ul>
<p />
You can find more information and links at the <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome" target="_top">Motion Homepage</a>.
<p />
<h3><a name="FreeBSD"></a><a name="_FreeBSD"></a> FreeBSD </h3>
<p />
Motion is originally developed for Linux and it is still mainly developed and supported for this platform. From version 3.1.15 an experimental port has been made by Angel Carpintero. Not all features of Motion are supported at this time and it still needs a lot of test time on different hardware. Angel is very interested in feedback. Join the Motion Mailing List and give your feedback there. Patches for bugfixes and for enabling the missing features are very welcome. The rest of this guide is still mainly targeted for Linux users. Follow this topic to <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/FreeBSD" target="_top">Install FreeBSD</a>.
<p />
<h3><a name="MacOSX"></a><a name="_MacOSX"></a> MacOSX </h3>
<p />
From Motion version 3.2.4 it is now also possible to build and install Motion under <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MacOSX" class="twikiLink">MacOSX</a>. Feature set it the same as for FreeBSD. See the <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MacOSX" class="twikiLink">MacOSX</a> topic for specific help how to install Motion and its dependencies on <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MacOSX" class="twikiLink">MacOSX</a>. Again this port has been contributed by Angel Carpintero.
<p />
<h3><a name="Documentation"></a> Documentation </h3>
You have the following sources of information:
<p /> <ul>
<li> This <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuide" class="twikiLink">Motion Guide</a>.
</li> <li> The <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/FrequentlyAskedQuestions" class="twikiLink">Frequently Asked Questions</a>
</li> <li> The author of the program has written a description of the <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionTechnology" class="twikiLink">technology behind motion</a>.
</li> <li> The man page. After installation simply write man motion
</li> <li> The default motion.conf file (motion-dist.conf) that comes with the package.
</li></ul>
<p />
<h3><a name="Supported_Hardware"></a> Supported Hardware </h3>
Input devices: Here we are thinking about the cameras.
<p />
Motion supports video input from two kinds of sources.
<p />
Standard video4linux devices (e.g. /dev/video0). Motion has no drivers for cameras. Installing the camera itself is outside the scope of this document. But here are some nice links. <ul>
<li> <a href="http://www.saillard.org/pwc/" rel="nofollow" target="_top">Driver for USB Philips cameras (and more)</a> This driver is a fork of the old pcw(x) driver which got kicked out of the kernel. (see: <a href="http://www.smcc.demon.nl/webcam/" rel="nofollow" target="_top">http://www.smcc.demon.nl/webcam/</a>). See also the new <a href="http://www.lavrsen.dk/twiki/bin/view/PWC/WebHome" class="twikiLink">PWC Documentation Site</a> which is hosted in this wiki.
</li> <li> <a href="http://bytesex.org/bttv/index.html" rel="nofollow" target="_top">BTTV Driver</a> (capture cards). Part of many distributions now.
</li> <li> <a href="http://alpha.dyndns.org/ov511/" rel="nofollow" target="_top">OV511</a> based USB cameras are supported as standard by newer Kernels.
</li> <li> <a href="http://spca50x.sourceforge.net/spca50x.php" rel="nofollow" target="_top">kernel driver for USB cameras based on Sunplus spca50</a>
</li> <li> <a href="http://rivatv.sourceforge.net/" rel="nofollow" target="_top">rivatv.sourceforge.net</a> Driver for tv/composite/svideo input with most Nvidia based video cards.
</li></ul>
Network cameras (which are actually cameras with a built in web server that can be connected directory to your network). <ul>
<li> <a href="http://www.axis.com/" rel="nofollow" target="_top">Axis Communications</a>
</li></ul>
<p />
<p />
<h2><a name="Known_Problems"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/KnownProblems" class="twikiLink">Known Problems</a> </h2>
See also the <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/FrequentlyAskedQuestions" class="twikiLink">Frequently Asked Questions</a> and <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/BugReports" class="twikiLink">Bug Reports</a> for known open bugs.
<p />
<strong>Kernel 2.6 and pwc.</strong> Note that for kernel 2.6 there is a new release of the Philips WebCam (pwc) drivers 10.0.X. It is recommended to install this. At the time of this being written the 2.6.12+ kernels have a version of pwc built-in but it is a cripled version which can only support very small picture size. You can however download the latest source code of the pwc driver (at this time 10.0.11) and build it without having to rebuild your kernel. But you will need to have either the kernel sources or a special kernel-header package installed to compile it. See <a href="http://www.lavrsen.dk/twiki/bin/view/PWC/InstallationOfPWC" class="twikiLink">Installation of PWC</a> page which is also hosted in this wiki.
<p />
If you use use a <strong>Logitech Quickcam Orbit or Sphere</strong> using the driver pwc/pwcx and kernel 2.6.X you should replace the file in the Motion sources called pwc-ioctl.h with the one that comes with the your pwc version. Motion is shipped with 3 versions of pwc-ioctl.h-VERSION. Rename the one that fits your major pwc version number best to pwc-ioctl.h (after renaming the current to something else). There has been some small adjustments in the API that requires that you have the right header file.
<p />
<strong>Camera picture dimensions must be multiple of 16</strong>
Dimentions of camera image must have both height and width that are a multiple of 16. Thís is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16. But if you intend to monitor a network camera which is saving jpeg images you may have to pay attention to the dimensions of the picture.
<p />
<strong>ffmpeg_filename has changed name to movie_filename</strong>
The 3.2.5 release contains a motion_guide and man page in which it was forgotten to change ffmpeg_filename to movie_filename. Please note that the option that defines the filenames for mpeg movies is now called movie_filename. This change is made because we may soon implement alternatives to ffmpeg and then ffmpeg_filename will be a bad name. This is fixed in release 3.2.5.1.
<p />
<strong>error: `time_current_frame' undeclared (first use in this function)</strong>
A bug in 3.2.5 and 3.2.5.1 where a bugfix related to snapshot feature has created a new bug when you compile Motion without ffmpeg libs installed. This is fixed in 3.2.6.
<p />
<p />
<h2><a name="How_do_I_install_Motion"></a><a name="How_do_I_install_Motion_"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/InstallOverview" class="twikiLink">How do I install Motion</a>? </h2>
Motion is mainly distributed as source files that you must compile yourself. There is also an RPM made on Fedora Core 3. And Debian packages are available for selected versions.
<p />
The short overview of the steps to install Motion from sources. <ul>
<li> <strong>Preparation</strong>: Motion uses a number of shared libraries that must be installed on your computer before you can build Motion. The needed shared libraries depends on the features you wish to use. Features network camera, ffmpeg, MySQL and PostgreSQL needs specific shared libraries installed. See preparation section for more information.
</li></ul>
<p /> <ul>
<li> <strong>Download</strong> the motion source files (distributed as tar'ed and compressed files). Place the file in a place of your own choice.
</li></ul>
<p /> <ul>
<li> <strong>Untar and uncompress</strong> the file to the place you want the program installed. Editor recommends placing the motion source file directory in /usr/local. If you do not have write access to the /usr/local directory (you are under the mercy of an ignorant system administrator with a severe case of paranoia) - you can install the program in a directory in your home directory. You will then need to read the next section about how to configure before you compile the program. Below is shown the exact commands using version 3.2.X installed in /usr/local as an example (replace /path/to with the actual placement of the tar.gz file).
</li></ul>
<UL>
<pre>
cd /usr/local
tar -xvzf /path/to/motion-3.2.X.tar.gz
</pre>
</UL> <ul>
<li> You will now have created a directory called motion-3.2.X. You can rename it to motion (mv motion-3.1.X motion). I recommend creating a symbolic link to the current version. This way you can more easily experiment with different version simply by changing the link.
</li></ul>
<UL>
<pre>
ln -s motion-3.2.X motion
</pre>
</UL> <ul>
<li> Now change to the new directory
</li></ul>
<UL>
<pre>
cd motion
</pre>
</UL> <ul>
<li> Run configure. You can start with the defaults. If you need to modify the installation parameters you can read the next section.
</li></ul>
<UL>
<pre>
./configure
</pre>
</UL> <ul>
<li> Build the code
</li></ul>
<UL>
<pre>
make
</pre>
</UL> <ul>
<li> Install the code, manual page, etc
</li></ul>
<UL>
<pre>
make install
</pre>
</UL> <ul>
<li> In /etc/motion/etc you will find a file called motion-dist.conf. If it is the first time you install Motion - rename this file to <strong>motion.conf</strong> and edit as a minimum the settings: <strong>videodevice</strong>, <strong>input</strong>, <strong>norm</strong>, <strong>frequency</strong>, <strong>width</strong>, <strong>height</strong> and <strong>target_dir</strong>. That should get you going.
</li></ul>
<p /> <ul>
<li> Run the program. To enable more features you must modify the config file.
</li></ul>
<UL>
<pre>
motion
</pre>
</UL>
<p />
<p />
<h2><a name="Preparation_For_Install"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/PrepareInstall" class="twikiLink">Preparation For Install</a> </h2>
<p />
Note: If you're using SuSE 9.2, you might want to <strong>ADDITIONALLY</strong> have a look at <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/SuSE92Prep" class="twikiLink">Compiling on SuSE 9.2</a>. As mentioned on that page as well, <em>you will still need to read the instructions here as well</em>.
<p />
Before you start you may need to install a number of shared libraries that Motion uses. If they are missing the feature will simply normally not be included. Most of these libraries can be found on the CDs of your distribution. A few will have to be downloaded from the Internet. Note that when you install software using pre-compiled binaries (Redhat type RPMs, Debian debs etc) you normally only get what is needed to run the programs themselves. In order to compile other programs from source that uses these pre-compiled libraries you also need to installed the development packages. These are normally called the same name as the package suffixed by -devel or -dev. These development packages contains the header files (xxx.h) that Motion needs to build with the shared libraries. If you build a library from sources you already have these header files. It is recommended to simply install the pre-compiled binary packages and their development brothers.
<p />
This is a list of shared libraries used by Motion and the RPM packages that provides them.
<p />
Motion will always need these libraries to be built and work
<table style="border-width:1px;" cellspacing="0" cellpadding="0" class="twikiTable" border="1"><tr class="twikiTableEven"><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=0;table=1;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Library</a> </th><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=1;table=1;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">RPM Packages</a> </th><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=2;table=1;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Debian Packages</a> </th></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> libm, libresolv, libdl, libpthread, libc, ld-linux, libcrypt, and libnsl </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> glibc and glibc-devel </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> libc6 , libc6-dev ,libglib1.2 </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> libjpeg </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> libjpeg and libjpeg-devel </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> libjpeg62 and libjpeg62-dev ( optional libjpeg-mmx-dev ) </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol twikiLast"> libz </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> zlib and zlib-devel </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> zlib1g and zlib1g-dev </td></tr>
</table>
<p />
For generating mpeg films with <strong>ffmpeg</strong> you need this library:<br>
(See also the section <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MpegFilmsFFmpeg" class="twikiLink">Generating MPEG films with ffmpeg</a> for how to install ffmpeg and libavformat/libavcodec)<br>
<em>Motion must be installed with revision 0.4.8 or 0.4.9pre1 of ffmpeg. Motion will also work with later CVS snapshots of ffmpeg but the API of the ffmpeg libraries changes all the time and without warning. If you have problems compiling Motion or with running an RPM of Motion you may try with an older CVS snapshot of ffmpeg. The Motion developers will like to know when ffmpeg changes and breaks Motion so we can fix it. Please file a bug report then with the exact date of the ffmpeg CVS version you have trouble with.</em>
<p />
<table style="border-width:1px;" cellspacing="0" cellpadding="0" class="twikiTable" border="1"><tr class="twikiTableEven"><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=0;table=2;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Library</a> </th><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=1;table=2;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">RPM Packages</a> </th><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=2;table=2;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Debian Packages</a> </th></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol twikiLast"> libavcodec, libavformat </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> ffmpeg and ffmpeg-devel or install from source </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> libavcodec-dev libavcodec0d libavformat-dev libavformat0d (*) </td></tr>
</table>
<p />
<strong>Debian</strong> has not provided deb packages for ffmpeg due patent issues. However this is about to change so checkout for availability of newer versions of debian ffmpeg debs. You can build yourself from source or from <a href="http://debian-multimedia.org/" rel="nofollow" target="_top">Christian Marillat website</a> or apt repository.
<pre>
deb http://www.debian-multimedia.org stable main # ( etch )
deb http://www.debian-multimedia.org testing main # ( lenny )
deb http://www.debian-multimedia.org unstable main # ( sid )
</pre>
Add the suitable line to your /etc/apt/sources.list and run this:
<pre>
apt-get update ; apt-get -y install libavcodec-dev libavcodec0d libavformat-dev libavformat0d
</pre>
<p />
For logging in <strong>MySQL</strong> you need this library:
<table style="border-width:1px;" cellspacing="0" cellpadding="0" class="twikiTable" border="1"><tr class="twikiTableEven"><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=0;table=3;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Library</a> </th><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=1;table=3;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">RPM Packages</a> </th><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=2;table=3;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Debian Packages</a> </th></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol twikiLast"> libmysqlclient </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> mysql and mysql-devel </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> libmysqlclient15-off and libmysqlclient15-dev </td></tr>
</table>
<p />
For logging in <strong>PostgreSQL</strong> you need this library:
<table style="border-width:1px;" cellspacing="0" cellpadding="0" class="twikiTable" border="1"><tr class="twikiTableEven"><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=0;table=4;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Library</a> </th><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=1;table=4;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">RPM Packages</a> </th><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=2;table=4;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Debian Packages</a> </th></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol twikiLast"> libpq </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> postgresql-libs and postgresql-devel </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> libpq-dev and libpq4 </td></tr>
</table>
<p />
<p />
<h2><a name="Configure_Script"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigureScript" class="twikiLink">Configure Script</a> </h2>
Configure is script that you run to setup the build environment for the C-compiler. It generates the "Makefile" which the program "make" uses to compile and install the software.
<p />
To run configure your current directory must be the motion directory. You type
<p />
<code>./configure</code>
<p />
You can add the parameter <code>./configure --help</code> to get help on the different switches.
<p />
This is walk through of the options.
<p />
<a name="edittable1"></a>
<div class="editTable"><form name="edittable1" action="http://www.lavrsen.dk/twiki/bin/viewauth/Motion/ConfigureScript#edittable1" method="post">
<input type="hidden" name="ettablenr" value="1" />
<input type="hidden" name="etedit" value="on" />
<table style="border-width:1px;" cellspacing="0" cellpadding="0" class="twikiTable" border="1"><tr class="twikiTableEven"><th width="160" bgcolor="#6b7f93" align="left" valign="top" style="width:160;text-align:left;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <span style="color:#ffffff"> <strong> Option </strong> </span> </th><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" maxcols="0"> <span style="color:#ffffff"> <strong> Description<br />Defaults for the options<br /> are specified in brackets [ ] </strong> </span> </th><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" maxcols="0"> <span style="color:#ffffff"> <strong> Editors comment </strong> </span> </th></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> -h, --help </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> display this help and exit </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --help=short </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> display options specific to this package </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> This command shows the options special to motion. Recommended </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --help=recursive </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> display the short help of all the included packages </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> -V, --version </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> display version information and exit </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Gives no useful information </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> -q, --quiet, --silent </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> do not print `checking...' messages </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Not very useful. Output to screen is only a few lines anyway. </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --cache-file=FILE </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> cache test results in FILE. [disabled] </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> No function </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> -C, --config-cach </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> alias for `--cache-file=config.cache' </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> No function </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> -n, --no-create </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> do not create output files </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Used for testing if other switches produce error - without writing anything to the disk </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --srcdir=DIR </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> find the sources in DIR. [configure dir or `..'] </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> DIR is a directory path. Editor recommends having the current directory being the motion installation directory and not using this switch. Then it defaults to the same directory as where the configure script is which is the current directory. </td></tr>
<tr class="twikiTableEven"><th width="160" bgcolor="#6b7f93" align="left" valign="top" style="width:160;text-align:left;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <span style="color:#ffffff"> <strong> Installation directories: </strong> </span> </th><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" maxcols="0"> <span style="color:#ffffff"> <strong> </strong> </span> </th><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" maxcols="0"> <span style="color:#ffffff"> <strong> </strong> </span> </th></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --prefix=PREFIX </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> install architecture-independent files in PREFIX<br />[/usr/local] </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> The default /usr/local means that the executable binary "motion" is installed in /usr/local/bin, the manual page in /usr/local/man/man1, the document files in /usr/local/docs/motion-version, configuration file in /usr/local/etc/motion, and some examples config files in /usr/local/examples/motion-versionEditor recommends keeping this default setting.<br />If you are experimenting with many parallel versions it may be interesting to set the PREFIX to e.g. /usr/local/motion and then add /usr/local/motion/bin to your search path (or simply cd /usr/local/motion/bin before execution).<br />This way you can change version just by changing the symbolic link in /usr/local/motion as suggested earlier in this guide.<br />If you are installing the software on a machine where you have no access to the /usr/local but have write access to a home directory, then you should change this to point to a directory within your home tree.<br />Example: --prefix=$HOME </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --exec-prefix=EPREFIX </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> install architecture-dependent files in EPREFIX<br />[PREFIX] </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> If you set this it only defines an alternative installation directory for the executable binary.<br />Note: The executable binary will be placed in a directory "bin" below the directory specified by this option<br />Editor recommends leaving this as default (i.e. not setting it). </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --bindir=DIR </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> user executables [EPREFIX/bin] </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> With this option you can control exactly in which directory the executable binary is installed. The previous option automatically adds the bin directory. Here you are in fill control. </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --sbindir=DIR </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> System admin executables [EPREFIX/sbin] </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Not used by motion. Ignore it. </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --libexecdir=DIR </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> program executables [EPREFIX/libexec] </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Not used by motion. Ignore it. </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --datadir=DIR </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> read-only architecture-independent data [PREFIX/share] </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Not used by motion. Ignore it. </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --sysconfdir=DIR </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> read-only single-machine data [PREFIX/etc] </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> This is where motion both installs the default configuration file and also where it later searches for it.<br />Motion searches for the configuration file "motion.conf" in the following order:<br /><UL><br />1. Current directory from where motion was invoked<br />2. $HOME/.motion<br />3. The sysconfig directory set by this switch. If not defined the default is /usr/local/etc/motion<br /></UL><br />Editor recommends leaving this at default. Be careful if you run "make install" again. This will overwrite the motion.conf file that you have edited and experimented with for hours. Make sure to keep a copy in a safe place. Alternatively, copy the working file to the motion base install directory. Then make install will simply copy the same file back again. </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --sharedstatedir=DIR </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> modifiable architecture-independent data [PREFIX/com] </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Not used by motion. Ignore it. </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --localstatedir=DIR </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> modifiable single-machine data [PREFIX/var] </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Not used by motion. Ignore it. </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --libdir=DIR </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> object code libraries [EPREFIX/lib] </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Not used by motion. Ignore it. </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --includedir=DIR </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> C header files [PREFIX/include] </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Not used by motion. Ignore it. </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --oldincludedir=DIR </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> C header files for non-gcc [/usr/include] </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Not used by motion. Ignore it. </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --infodir=DIR </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> info documentation [PREFIX/info] </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Not used by motion. Ignore it. </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --mandir=DIR </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> man documentation [PREFIX/man] </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Editor recommends the default. </td></tr>
<tr class="twikiTableOdd"><th width="160" bgcolor="#6b7f93" align="left" valign="top" style="width:160;text-align:left;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <span style="color:#ffffff"> <strong> Optional Packages: </strong> </span> </th><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" maxcols="0"> <span style="color:#ffffff"> <strong> </strong> </span> </th><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" maxcols="0"> <span style="color:#ffffff"> <strong> </strong> </span> </th></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --with-ffmpeg=DIR </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Specify the path for the directory prefix in which the library and headers are installed.<br />If not specified configure will search in /usr/ and /usr/local/ </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> DIR is the directory PREFIX in which the ffmpeg shared libraries and their headers are installed.<br />If you install ffmpeg from sources and use the default directories or if ffmpeg is installed as a binary package (RPM or deb) you do not need to specify the directory prefix. Configure will find the libraries automatically. If you installed ffmpeg from sources and specified a different --prefix when building ffmpeg you must use the same value for the DIR ( --with-ffmpeg=DIR).<br />For more information on FFmpeg see the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg project home page</a>.<br />FFmpeg is a package that enables streamed video mpeg signal from your web camera to a browser.<br />Editor recommends installing ffmpeg from source and in the directory /usr/local/ffmpeg and build ffmpeg with ./configure --enable-shared.<br />This places libraries in /usr/local/lib and headers in /usr/local/include. </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --without-ffmpeg </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Do not compile with ffmpeg </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Use this if you do not want to compile with ffmpeg. If ffmpeg is not installed you do not need to specify that Motion must build without ffmpeg. </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --with-mysql-lib=DIR </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Lib directory of MySQL </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Normally, configure will scan all possible default installation paths for MySQL libs. When its fail, use this command to tell configure where MySQL libs installation root directory is. </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --with-mysql-include=DIR </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Include directory with headers for MySQL </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Normally, configure will scan all possible default installation paths for MySQL include. When its fail, use this command to tell configure where MySQL include installation directory is. This is the directory with the MySQL header files. </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --without-mysql </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Do not compile with MySQL support </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Use this if you do not want to include MySQL support in the package.<br />This can also be useful if you get compilation errors related to MySQL and you actually do not need the feature anyway. </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --with-pgsql=DIR </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Include PostgreSQL support. DIR is the PostgreSQL base install directory, defaults to /usr/local/pgsql.<br />Set DIR to "shared" to build as a dynamic library, or "shared,DIR" to build as a dynamic library and still specify DIR. </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Default is that make searches in the normal installation directories of most distributions.<br />See section later about PostgreSQL about potential problem during compilation. There is an easy workaround for it. </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --without-pgsql </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Do not compile with PostgreSQL support </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Use this if you do not want to include PostgreSQL support in the package.<br />This can also be useful if you get compilation errors related to PostgreSQL and you actually do not need the feature anyway. </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --without-v4l </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Exclude using v4l (video4linux) subsystem. Makes Motion so it only supports network cameras. </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Can be used if you do not need <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/V4L" class="twikiLink">V4L</a> support and maybe lack some of the libraries for it. </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --with-linuxthreads </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Use linuxthreads in BSD instead of native phtreads </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Only relevant for BSD. In Linux we always use this per default. </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --without-bktr </td><td bgcolor="#edf4f9" align="right" valign="top" style="vertical-align:top;"> Exclude to use bktr subsystem , that usually useful for devices as network cameras </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> ONLY used in *BSD </td></tr>
<tr class="twikiTableEven"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --with-jpeg-mmx=DIR </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Specify the prefix for the install path for jpeg-mmx for optimized jpeg handling (optional). If this is not specified motion will try to find the library /usr/lib/libjpeg-mmx.a /usr/local/lib/libjpeg-mmx.a. </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Considered experimental </td></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#edf4f9" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol"> --without-optimizecpu </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Exclude autodetecting platform and cpu type. This will disable the compilation of gcc optimizing code by platform and cpu. </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Use this if the optimization causes problems. Typically if you build on some non X386 compatible CPU. </td></tr>
<tr class="twikiTableEven"><th width="160" bgcolor="#6b7f93" align="left" valign="top" style="width:160;text-align:left;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <span style="color:#ffffff"> <strong> Developers options </strong> </span> </th><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" maxcols="0"> <span style="color:#ffffff"> <strong> </strong> </span> </th><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" maxcols="0"> <span style="color:#ffffff"> <strong> </strong> </span> </th></tr>
<tr class="twikiTableOdd"><td width="160" bgcolor="#ffffff" valign="top" style="width:160;vertical-align:top;" class="twikiFirstCol twikiLast"> --with-developer-flags </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> Add additional warning flags for the compiler. </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> This option is for developers only. It produces a flood of warnings that helps the developer to write more robust code. These warnings are normally harmless but can sometimes be a latent defect.<br />For more information about these flags, see <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/CompileWithDeveloperFlags" class="twikiLink">CompileWithDeveloperFlags</a> </td></tr>
</table>
<input type="hidden" name="etrows" value="40" />
<input class="editTableEditImageButton" type="image" src="http://www.lavrsen.dk/twiki/pub/TWiki/EditTablePlugin/edittable.gif" alt="Edit this table" /></form>
</div><!-- /editTable -->
<p />
<h2><a name="Make"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MakeInstall" class="twikiLink">Make</a> </h2>
When you run make, all the C-source files are automatically compiled and linked. Just look out for error messages.
<p />
Make uses a file called "Makefile" which is generated by the "configure" script you just ran. If you have special needs you can manually edit this file. Next time you run configure a new Makefile will be generated and your changes are lost.
<p />
<img src="http://www.lavrsen.dk/twiki/pub/TWiki/TWikiDocGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Attention!
<p />
If you have run <code>make</code> before, you should run a <code>make clean</code> before running <code>make</code> again. This cleans out all the object files that were generated the previous time you ran <code>make</code>. If you do not run <code>make clean</code> first before you rebuild Motion you may not get the additional feature included. For example: If you built Motion without ffmpeg support and then add it later - and rebuild Motion without running <code>make clean</code> first - the ffmpeg feature does not get compiled into the Motion binary.
<p />
First time you build motion run <code>./configure</code>, <code>make</code>, <code>make install</code>. If you need to build it again (to run with different configure options) run <code>./configure</code>, <code>make clean</code>, <code>make</code>, <code>make install</code>.
<p />
<h3><a name="Make_Install"></a> Make Install </h3>
<code>make install</code> simply copies all the nice files that were generated during the compilation/linking that make did.
<p />
Makes the directories (if they do not already exist)(path shown are the defaults): /usr/local/bin, usr/local/man/man1, /usr/local/etc, /usr/local/share/doc/motion-3.2.X, and /usr/local/share/doc/examples/motion-3.2.X.
<p />
Copies the following files from the base motion directory (assuming the default PREFIX /usr/local was used when running configure - otherwise adjust to the actuals you chose) <ul>
<li> Executable binary "motion" to /usr/local/bin
</li> <li> Manual page "motion.1" to /usr/local/man/man1
</li> <li> Document files "CHANGELOG, COPYING, CREDITS, INSTALL, and README to /usr/local/share/doc/motion-3.2.X
</li> <li> Example configuration files "*.conf" to /usr/local/share/doc/examples/motion-3.2.X
</li> <li> Configuration file "motion-dist.conf" to /usr/local/etc/motion
</li></ul>
Note that the any existing files are overwritten. The default config file motion-dist.conf is named like this so that you do not get your working motion.conf file overwritten when you upgrade Motion.
<p />
<h3><a name="Un_install"></a> Un-install </h3>
From the motion base installation directory you simply run <code>make uninstall</code>
<p />
And delete the base installation directory in /usr/local and any link pointing to it. If you have forgotten where you installed it or someone else did it for you, simply search for the files and directories starting with motion. If the filenames and the directories match the names described in the "Make Install" section of this document, you can safely delete them.
<p />
<h3><a name="Additional_Make_Options"></a> Additional Make Options </h3>
The make command can be run with several options. <code>make</code>, <code>make install</code> and <code>make uninstall</code> has already been described above.
<p /> <dl>
<dt> <strong>make clean</strong> </dt><dd> deletes all the binary files (object files) and the motion binary generated by make. It also deletes temporary files and any jpg files that motion has saved in the motion source directory. It is very important to always run <code>make clean</code> before you run <code>make</code> if you change the configuration (like adding features such as ffmpeg) and rebuild motion.
</dd></dl>
<p /> <dl>
<dt> <strong>make distclean</strong> </dt><dd> deletes the files: config.status, config.log, config.cache, Makefile, and motion.spec.
</dd></dl>
<p /> <dl>
<dt> <strong>make updateguide</strong> </dt><dd> fetches a fresh new copy of this guide and place it in your motion source directory. Note that the pictures are not downloaded.
</dd></dl>
<p /> <dl>
<dt> <strong>make dist</strong> </dt><dd> performs make clean, make distclean and make updateguide in one single operation.
</dd></dl>
<p />
<p />
<h2><a name="Upgrading_From_Older_Version"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/UpgradingFromOlderVersion" class="twikiLink">Upgrading From Older Version</a> </h2>
If you are upgrading from motion 3.0.X or from an older version of 3.1.X you should note that many options have been removed from version 3.1.13 and forward and many new have arrived. You still have most of the old features. The options have been changed for two reasons. New more flexible features and to simplify getting started with Motion. With 3.2.1 the changes are significant.
You should also note these major differences. <ul>
<li> The use of thread files has completely changed. Read the section "The Config Files" carefully.
</li> <li> The mask file format has changed. Read the section about "Mask File"
</li> <li> Pre_capture feature introduced in 3.1.12
</li> <li> Advanced filename feature enables very flexible filename definitions (3.1.13)
</li> <li> onffmpegclose options enables running external scripts when mpeg file is closed (3.1.13)
</li> <li> despeckle feature improves motion detection and noise immunity (3.1.13)
</li> <li> Minimum_motion_frames feature prevents short noise events from being saved (3.1.14)
</li> <li> If you use the database features you need to note that from version 3.1.15 and forward the fields have been redefined. Removed are second, minute, hour, day, month and year. Instead these six have been replaced by a real timestamp field called time_stamp. The relatively new field 'type' has been renamed to 'file_type' to avoid reserved SQL words. A new field 'text_left' has been added which stores the text given by the config option text_left. And last a field called 'camera' has been added which stores the thread number.
</li> <li> From 3.1.15 the ffmpeg feature now also supports mpeg4 and msmpeg4. The build process of Motion now use ffmpeg libraries as shared libraries. The --with-libavcodec has been replaced by a --with-ffmpeg which only needed to specify if you are installing ffmpeg from sources in a non-standard location. If you have installed ffmpeg from sources already you will need to rebuild by running (from within the ffmpeg source file root) ./configure --enable-shared followed by make and make install. If you had installed ffmpeg from a binary RPM or deb you probably don't have to do anything.
</li> <li> Rotate feature was introduced in 3.1.15
</li> <li> Berkeley mpeg feature has been removed in 3.1.18 (use ffmpeg - it is much better)
</li> <li> Incomplete prediction feature was removed in 3.1.18. (lack of interest in finishing it)
</li> <li> Smart Mask feature introduced in 3.1.18
</li> <li> output_normal can now also have the value "first" which means only save first jpg from each event (3.1.18)
</li> <li> ffmpeg-0.4.9 is now supported. Motion detection mpegs can no longer be saved as mpeg1 (ffmpeg does not support non-standard framerates in 0.4.9) (3.1.18)
</li> <li> Motion now supports most (not all) mjpeg streaming cameras (3.1.18).
</li> <li> output_normal can now have values "first" or "best". It is used when you need to present a link to an mpeg movie shown as a single jpeg image. "First" saves the first picture frame in the new event. "Best" saves the picture frame with most motion content (most changed pixels) when the event is over. "on" still saves all motion detection picture frames plus pre and post captured images. With "best" you can set jpeg_filename = "preview" and it gets the same filename as the mpeg file but with extension .jpg. Option "locate" can also take the value "preview" which makes it only draw a rectangel on the jpeg but not on the mpeg movie. (3.2.1)
</li> <li> The xmlrpc remote control interface is replaced by a much nicer http remote control interface. (3.2.1)
</li> <li> All the options that calls external programs have been made much more generic. New onxxxx options have been added. Execute, sms and mail have been replaced by the generic on_event_start. (3.2.1)
</li> <li> New setup mode makes setting all the detection options much easier.
</li> <li> netcam now also supports proxies (3.2.2) and ftp (3.2.4)
</li> <li> text on the pictures can be set to double size (3.2.2)
</li> <li> Tracking with Logitech Sphere/Orbit improved (3.2.4)
</li> <li> SQL database feature is now fully configurable so you can control which fields you have in the database.
</li> <li> Many new conversion specifiers have been added which can be used both in filenames, commands, text, and SQL database features (3.2.2-3.2.4)
</li> <li> Stepper motor tracking feature extended to also include a Y axis (3.2.5)
</li> <li> ffmpeg_filename has been renamed to movie_filename to prepare for alternative implementation to mpeg files made with ffmpeg (3.2.5)
</li> <li> New feature: ffmpeg_deinterlace which can de-interlace using the ffmpeg libs (3.2.5)
</li> <li> New feature: minimum_frame_time which enables Motion to run at frame rates below 2. minimum_gap feature was removed since this was useless and the new minimum_frame_time feature replaces it with much better function. (3.2.7)
</li> <li> New feature: process_id_file which writes a PID file when started and removes it when stopped (3.2.7)
</li> <li> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/V4L2" class="twikiLink">V4L2</a> support with many new supported palettes : <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/V4L2" class="twikiLink">V4L2</a>_PIX_FMT_SBGGR8, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/V4L2" class="twikiLink">V4L2</a>_PIX_FMT_SN9C10X, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/V4L2" class="twikiLink">V4L2</a>_PIX_FMT_JPEG, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/V4L2" class="twikiLink">V4L2</a>_PIX_FMT_UYVY (3.2.8)
</li> <li> ffmpeg_video_codec allow swf (3.2.8)
</li> <li> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/V4L2" class="twikiLink">V4L2</a> fix support for : <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/V4L2" class="twikiLink">V4L2</a>_PIX_FMT_MJPEG (3.2.9)
</li> <li> ffmpeg_video_codec allow flv and ffv1(3.2.9)
</li></ul>
<p />
<p />
The table below shows the new options in the left column, and obsolete options in the right column. If the there are options on both sides in a row it means that the options in the left column replaced the options in the right column.
<p />
<a name="edittable1"></a>
<div class="editTable"><form name="edittable1" action="http://www.lavrsen.dk/twiki/bin/viewauth/Motion/UpgradingFromOlderVersion#edittable1" method="post">
<input type="hidden" name="ettablenr" value="1" />
<input type="hidden" name="etedit" value="on" />
<table style="border-width:1px;" cellspacing="0" cellpadding="0" class="twikiTable" border="1"><tr class="twikiTableEven"><th width="50%" bgcolor="#6b7f93" align="center" valign="top" style="width:50%;text-align:center;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=0;table=6;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">New Options</a> </th><th width="50%" bgcolor="#6b7f93" align="center" valign="top" style="width:50%;text-align:center;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=1;table=6;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Obsolete Options</a> </th></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> text_left (3.1.13)<br />text_right (3.1.13)<br />text_changes (3.1.13) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> drawtext_user (3.1.13)<br />drawtext_shots (3.1.13)<br />drawtext_changes (3.1.13) </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> jpeg_filename (3.1.13)<br />ffmpeg_filename (3.1.13)<br />snapshot_filename (3.1.13)<br />timelapse_filename (3.1.13)<br />predict_filename (3.1.13)<br />(predict_filename removed in 3.1.18)<br /> </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> oldlayout (3.1.13)<br />snapshots_overwrite (3.1.13) </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> snapshot_interval (3.1.13) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> snapshots (3.1.13) </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> realmotion (3.1.13) </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> despeckle (3.1.13) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> pre_capture (3.1.12) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> ffmpeg_timelapse (v. 3.1.14) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> ffmpeg_timelaps (renamed v 3.1.14) </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> ffmpeg_timelapse_mode (3.1.14) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> sql_log_image (3.1.14)<br />sql_log_snapshot (3.1.14)<br />sql_log_mpeg (3.1.14)<br />sql_log_timelapse (3.1.14)<br />sql_log_prediction (3.1.14) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> minimum_motion_frames (3.1.14) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> rotate (3.1.15) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> ffmpeg_variable_bitrate (3.1.15)<br />ffmpeg_video_codec (3.1.15) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> berkeley_single_directory (3.1.18)<br />mpeg_encode (3.1.18)<br />mpeg_encode_bin (3.1.18)<br />adjust_rate off (3.1.18)<br />jpg_cleanup (3.1.18) </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> predict_filename (3.1.18)<br />predict_enable (3.1.18)<br />predict_threshold (3.1.18)<br />predict_description (3.1.18)<br />sql_log_prediction (3.1.18) </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> brightness (3.1.18)<br />contrast (3.1.18)<br />saturation (3.1.18)<br />hue (3.1.18) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> smart_mask_speed (3.1.18) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> output_normal<br />valid values are now "on", "off", "first" (3.1.18) and "best" (3.2.1)<br /> </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> setup_mode (3.2.1) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> always_changes (3.2.1) </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> locate<br />valid values are now "on", "off", "preview" (3.2.1) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> jpeg_filename<br />Besides normal path names the value "preview" has speciel meaning together with output_normal = "best" (3.2.1) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> control_html_output (3.2.1) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> on_event_start (3.2.1)<br /> </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> execute (3.2.1)<br />sms (3.2.1)<br />mail (3.2.1) </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> on_event_end (3.2.1)<br /> </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> on_motion_detected (3.2.1)<br /> </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> on_picture_save (3.2.1)<br /> </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> onsave (3.2.1) </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> on_movie_start (3.2.1)<br />on_movie_end (3.2.1)<br /> </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> onmpeg (3.2.1)<br />onffmpegclose (introduced 3.1.13)(renamed to on_movie_end 3.2.1)<br /> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> netcam_proxy (3.2.2) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> text_double (3.2.2) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> webcam_motion<br />Feature has been heavily improved so it is actually usefull now (3.2.2). </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> netcam_url<br />Now also supports fetching single frame jpeg pictures via ftp using ftp:// syntax (3.2.4) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> track_step_angle_x (3.2.4)<br />track_step_angle_y (3.2.4)<br />Add better configuration of auto tracking with a Logitech Sphere/Orbit camera.<br /> </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> track_move_wait (3.2.4)<br />track_auto (3.2.4)<br />Adds better configuration of auto tracking feature </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> sql_query (3.2.4)<br />Adds full flexibility of defining fields when using the SQL database features. </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> track_maxy (3.2.5)<br />track_motory (3.2.5) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> movie_filename (3.2.5) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> ffmpeg_filename (3.2.5) </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> ffmpeg_deinterlace (3.2.5) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> minimum_frame_time (3.2.7) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> minimum_gap (3.2.7) </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> process_id_file (3.2.7) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> ffmpeg_video_codec allow swf (3.2.8) </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableEven"><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol"> ffmpeg_video_codec allow flv and ffv1 (3.2.9) </td><td width="50%" bgcolor="#edf4f9" valign="top" style="width:50%;vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiFirstCol twikiLast"> </td><td width="50%" bgcolor="#ffffff" valign="top" style="width:50%;vertical-align:top;" class="twikiLast"> night_compensate (3.2.10)<br />low_cpu (3.2.10) </td></tr>
</table>
<input type="hidden" name="etrows" value="42" />
<input class="editTableEditImageButton" type="image" src="http://www.lavrsen.dk/twiki/pub/TWiki/EditTablePlugin/edittable.gif" alt="Edit this table" /></form>
</div><!-- /editTable -->
<p />
<h2><a name="Running_Motion"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/RunningMotionConfigFiles" class="twikiLink">Running Motion</a> </h2>
<p />
<h3><a name="Important_Definitions"></a> Important Definitions </h3>
Motion is invoked from the command line. It has no GUI. Everything is controlled from config files. From version 3.2 the command line is only used to define location of config file and a few special runtime modes (setup and non-daemon).
<p />
A few important definitions. <ul>
<li> A snapshot is a picture taken at regular intervals independently of any movement in the picture.
</li> <li> A "motion" image/mpeg shows the pixels that have actually changed during the last frames. These pictures are not very useful for normal presentation to the public but they are quite useful for testing and tuning and making mask files as you can see exactly where motion sees something moving. Motion is shown in greytones. If labelling is enabled the largest area is marked as blue. Smart mask is shown in read.
</li> <li> A "normal" image is the real image taken by the camera with text overlayed.
</li></ul>
<p />
<a name="ConfigFiles"></a>
<h3><a name="The_Config_Files"></a> The Config Files </h3>
<p />
If Motion was invoked with command line option <code>-c pathname</code> Motion will expect the config file to be as specified. When you specify the config file on the command line with -c you can call it anything.
<p />
If you do not specify -c or the filename you give Motion does not exist, Motion will search for the configuration file called 'motion.conf' in the following order:
<p /> <ol>
<li> Current directory from where motion was invoked
</li> <li> Then in a directory called '.motion' in the current users home directory (shell environment variable $HOME). E.g. /home/goofy/.motion/motion.conf
</li> <li> The directory defined by the --sysconfdir=DIR when running .configure during installation of Motion<br />(If this option was not defined the default is /usr/local/etc/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 />
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 />
The configuration file needs to be renamed from motion-dist.conf to motion.conf. The original file is called motion-dist.conf so that your perfectly working motion.conf file does not accidentally get overwritten when you re-install or upgrade to a newer version of Motion.
<p />
If you have more than one camera you should not try and invoke Motion more times. Motion is made to work with more than one camera in a very elegant way and the way to do it is to create a number of thread config files. Motion will then create an extra tread of itself for each camera. If you only have one camera you only need the motion.conf file. The minute you have two or more cameras you must have <strong>one thread config file per camera</strong> besides the motion.conf file.
<p />
So if you have for example two cameras you need motion.conf <strong>and two</strong> thread config files. Total of <strong>3</strong> config files.
<p />
An option that is common to all cameras can be placed in motion.conf. (You can also put all parameters in the thread files but that makes a lot of editing when you change a common thing).
<p />
An option that is unique to a camera must be defined in each thread file.
<p />
<em>It is often seen that people copy the entire motion.conf into the thread config files and change a few options. This works but it not recommended because it is more difficult to maintain and overview. Keep all the common options in motion.conf and the few unique only in the thread config files</em>
<p />
The first camera is defined in the first thread file called from motion.conf. The 2nd camera is defined in the 2nd thread file called from motion.conf etc.
<p />
Any option defined in motion.conf will be used for all cameras except for the cameras in which the same option is defined in a thread config file.
<p />
Motion reads its configuration parameters in the following sequence. If the same parameter exists more than one place <strong>the last one read wins</strong>. <ol>
<li> Motion reads the configuration file motion.conf from the beginning of the file going down line by line.
</li> <li> If the option "thread" is defined in motion.conf, the thread configuration file(s) is/(are) read.
</li> <li> Motion continues reading the rest of the motion.conf file. Any options from here will overrule the same option previously defines in a thread config file.
</li> <li> Motion reads the command line option again overruling any previously defined options.
</li></ol>
So always call the thread config files in the end of the motion.conf file. If you define options in motion.conf AFTER the thread file calls, the same options in the thread files will never be used. So always put the thread file call at the end of motion.conf.
<p />
Nearly all config options can be unique for a specific camera and placed in a thread config file. There are a few options that must be in motion.conf and cannot be in a thread config file: <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionControlAuthentication" class="twikiLink">control_authentication</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionControlHtmlOutput" class="twikiLink">control_html_output</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionControlLocalhost" class="twikiLink">control_localhost</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionControlPort" class="twikiLink">control_port</a>, <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionDaemon" class="twikiLink">daemon</a>, and <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionThread" class="twikiLink">thread</a>.
<p />
If motion is built without specific features such as ffmpeg, mysql etc it will ignore the options that belongs to these features. You do not have to remove them or comment them out.
<p />
If you run the http control command <a href="http://host:port/0/config/writeyes" rel="nofollow" target="_top">http://host:port/0/config/writeyes</a>, motion will overwrite motion.conf and all the thread.conf files by autogenerated config files neatly formatted and only with the features included that Motion was built with. If you later re-build Motion with more features or upgrade to a new version, you can use your old config files, run the motion.conf.write command, and you will have new config files with the new options included all set to their default values. This makes upgrading very easy to do.
<p />
<p />
<h2><a name="Command_Line_Options"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/CommandLineOptions" class="twikiLink">Command Line Options</a> </h2>
<p />
<img src="http://www.lavrsen.dk/twiki/pub/TWiki/TWikiDocGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> In Motion 3.2.1 and forward most command line options have been removed and replaced them by an option to specify location to motion.conf and a few options related to setting up motion. There are now only few command line options left and they are basically all new.
<p />
SYNOPSIS
<pre>
motion [ -hns ] [ -c config file path]
</pre>
<p />
<a name="edittable1"></a>
<div class="editTable"><form name="edittable1" action="http://www.lavrsen.dk/twiki/bin/viewauth/Motion/CommandLineOptions#edittable1" method="post">
<input type="hidden" name="ettablenr" value="1" />
<input type="hidden" name="etedit" value="on" />
<table style="border-width:1px;" cellspacing="0" cellpadding="0" class="twikiTable" border="1"><tr class="twikiTableEven"><th width="150" bgcolor="#6b7f93" align="left" valign="top" style="width:150;text-align:left;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=0;table=7;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Option</a> </th><th width="250" bgcolor="#6b7f93" align="left" valign="top" style="width:250;text-align:left;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=1;table=7;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Description</a> </th><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=2;table=7;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Editors comment</a> </th></tr>
<tr class="twikiTableOdd"><td width="150" bgcolor="#ffffff" valign="top" style="width:150;vertical-align:top;" class="twikiFirstCol"> -n </td><td width="250" bgcolor="#ffffff" valign="top" style="width:250;vertical-align:top;"> Run in non-daemon mode. </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Instead of running Motion in the background Motion runs in the terminal window writing messages when things happen. If you have problems getting Motion to start or work, run Motion in this mode to get more messages that can help you solve the problem. </td></tr>
<tr class="twikiTableEven"><td width="150" bgcolor="#edf4f9" valign="top" style="width:150;vertical-align:top;" class="twikiFirstCol"> -s </td><td width="250" bgcolor="#edf4f9" valign="top" style="width:250;vertical-align:top;"> Run in setup mode. </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Also forces non-daemon mode </td></tr>
<tr class="twikiTableOdd"><td width="150" bgcolor="#ffffff" valign="top" style="width:150;vertical-align:top;" class="twikiFirstCol"> -c config file path </td><td width="250" bgcolor="#ffffff" valign="top" style="width:250;vertical-align:top;"> Full path and filename of config file. </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> E.g. /home/kurt/motion.conf. Default is /usr/local/etc/motion unless specified differently when building Motion. Many RPMs and debian packages will most likely use /etc or /etc/motion as default </td></tr>
<tr class="twikiTableEven"><td width="150" bgcolor="#edf4f9" valign="top" style="width:150;vertical-align:top;" class="twikiFirstCol"> -h </td><td width="250" bgcolor="#edf4f9" valign="top" style="width:250;vertical-align:top;"> Show help screen. </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td width="150" bgcolor="#ffffff" valign="top" style="width:150;vertical-align:top;" class="twikiFirstCol"> -d level </td><td width="250" bgcolor="#ffffff" valign="top" style="width:250;vertical-align:top;"> Debugging mode </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> This mode is used for developers to enable debug messages. Normal users will not need to use this mode unless a developer request to get additional information in the attempt to resolve a bug. Mainly the netcam code has debugging features. The level defines how much debugging info you get. A high number displays all debugging. </td></tr>
<tr class="twikiTableEven"><td width="150" bgcolor="#edf4f9" valign="top" style="width:150;vertical-align:top;" class="twikiFirstCol twikiLast"> -p process_id_file </td><td width="250" bgcolor="#edf4f9" valign="top" style="width:250;vertical-align:top;" class="twikiLast"> Full path of process ID file </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiLast"> Full path and filename of process id file (PID file). This is optional. If none is given as command line option or in motion.conf (process_id_file) Motion will not create a PID file. </td></tr>
</table>
<input type="hidden" name="etrows" value="7" />
<input class="editTableEditImageButton" type="image" src="http://www.lavrsen.dk/twiki/pub/TWiki/EditTablePlugin/edittable.gif" alt="Edit this table" /></form>
</div><!-- /editTable -->
<p />
<p />
<h2><a name="Config_File_Options"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigFileOptions" class="twikiLink">Config File Options</a> </h2>
These are the options that can be used in the config file.
<p />
All number values are integer numbers (no decimals allowed). Boolean options can be on or off.
<p />
Some configuration options are only used if Motion is built on a system that has the matching software libraries installed (MySQL, PostgreSQL and FFMPEG).
<p />
MySQL <ul>
<li> mysql_db, mysql_host, mysql_user, mysql_password
</li></ul>
<p />
PostgreSQL <ul>
<li> pgsql_db, pgsql_host, pgsql_user, pgsql_password, pgsql_port
</li></ul>
<p />
FFMPEG (libavcodec) <ul>
<li> ffmpeg_cap_new, ffmpeg_cap_motion, ffmpeg_filename, ffmpeg_timelapse, ffmpeg_timelapse_mode, ffmpeg_bps, ffmpeg_variable_bitrate, ffmpeg_video_codec
</li></ul>
<p />
<h3><a name="Options_in_Alphabetical_Order"></a><a name="Options_in_Alphabetical_Order_"></a> Options in Alphabetical Order. </h3>
<p />
The table below lists all the Motion options in alphabetical order. Click on the option name to see a longer description of each.
<table style="border-width:1px;" cellspacing="0" cellpadding="0" class="twikiTable" border="1"><tr class="twikiTableEven"><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=0;table=8;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Option</a> </th><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=1;table=8;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Range/Values<br />Default</a> </th><th bgcolor="#6b7f93" align="left" valign="top" style="text-align:left;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=2;table=8;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Description</a> </th></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionAutoBrightness" class="twikiLink">auto_brightness</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Let motion regulate the brightness of a video device. Only recommended for cameras without auto brightness </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionBrightness" class="twikiLink">brightness</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 255<br />Default: 0 (disabled) </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The brightness level for the video device. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionContrast" class="twikiLink">contrast</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 255<br />Default: 0 (disabled) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> The contrast level for the video device. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionControlAuthentication" class="twikiLink">control_authentication</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4096 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> To protect HTTP Control by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication. This option must be placed in motion.conf and not in a thread config file. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionControlHtmlOutput" class="twikiLink">control_html_output</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: on </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Enable HTML in the answer sent back to a browser connecting to the control_port. This option must be placed in motion.conf and not in a thread config file. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionControlLocalhost" class="twikiLink">control_localhost</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: on </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Limits the http (html) control to the localhost. This option must be placed in motion.conf and not in a thread config file. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionControlPort" class="twikiLink">control_port</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 65535<br />Default: 0 (disabled) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Sets the port number for the http (html using browser) based remote control. This option must be placed in motion.conf and not in a thread config file. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionDaemon" class="twikiLink">daemon</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Start in daemon (background) mode and release terminal. This option must be placed in motion.conf and not in a thread config file. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionDespeckle" class="twikiLink">despeckle</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: EedDl<br />Default: Not defined </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Despeckle motion image using combinations of (E/e)rode or (D/d)ilate. And ending with optional (l)abeling. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFfmpegBps" class="twikiLink">ffmpeg_bps</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 9999999<br />Default: 400000 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Bitrate of mpegs produced by ffmpeg. Bitrate is bits per second. Default: 400000 (400kbps). Higher value mans better quality and larger files. Option requires that ffmpeg libraries are installed. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFfmpegCapMotion" class="twikiLink">ffmpeg_cap_motion</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Use ffmpeg libraries to encode motion type mpeg movies where you only see the pixels that changes. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFfmpegCapNew" class="twikiLink">ffmpeg_cap_new</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Use ffmpeg libraries to encode mpeg movies in realtime. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFfmpegDeinterlace" class="twikiLink">ffmpeg_deinterlace</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Use ffmpeg to deinterlace video. Necessary if you use an analog camera and see horizontal combing on moving objects in video or pictures. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFfmpegFilename" class="twikiLink">ffmpeg_filename (now called movie_filename)</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This option was renamed to movie_filename in 3.2.5 to enable better integration of alternative movie libraries to the current ffmpeg solution. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFfmpegTimelapse" class="twikiLink">ffmpeg_timelapse</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 2147483647<br />Default: 0 (disabled) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Create a timelapse movie saving a picture frame at the interval in seconds set by this parameter. Set it to 0 if not used. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFfmpegTimelapseMode" class="twikiLink">ffmpeg_timelapse_mode</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: hourly, daily, weekly-sunday, weekly-monday, monthly, manual<br />Default: daily </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The file rollover mode of the timelapse video. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFfmpegVariableBitrate" class="twikiLink">ffmpeg_variable_bitrate</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0, 2 - 31<br />Default: 0 (disabled) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Enables and defines variable bitrate for the ffmpeg encoder. ffmpeg_bps is ignored if variable bitrate is enabled. Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps, or the range 2 - 31 where 2 means best quality and 31 is worst. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFfmpegVideoCodec" class="twikiLink">ffmpeg_video_codec</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: mpeg1 (ffmpeg-0.4.8 only), mpeg4, msmpeg4, swf, flv, ffv1<br />Default: mpeg4 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Codec to be used by ffmpeg for the video compression. Timelapse mpegs are always made in mpeg1 format independent from this option. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFramerate" class="twikiLink">framerate</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 2 - 100<br />Default: 100 (no limit) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Maximum number of frames to be captured from the camera per second. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFrequency" class="twikiLink">frequency</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 999999<br />Default: 0 (Not set) </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The frequency to set the tuner to (kHz). Valid range: per tuner spec, default: 0 (Don't set it) </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionGap" class="twikiLink">gap</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 2147483647<br />Default: 60 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Gap is the seconds of no motion detection that triggers the end of an event. An event is defined as a series of motion images taken within a short timeframe. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionHeight" class="twikiLink">height </a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Device Dependent<br />Default: 288 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The height of each frame in pixels. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionHue" class="twikiLink">hue</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 255<br />Default: 0 (disabled) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> The hue level for the video device. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionInput" class="twikiLink">input </a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 7, 8 = disabled<br />Default: 8 (disabled) </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Input channel to use expressed as an integer number starting from 0. Should normally be set to 1 for video/TV cards, and 8 for USB cameras. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionJpegFilename" class="twikiLink">jpeg_filename</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S-%q </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> File path for motion triggered images (jpeg or ppm) relative to target_dir. Value 'preview' makes a jpeg filename with the same name body as the associated saved mpeg movie file. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionLightswitch" class="twikiLink">lightswitch </a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 100<br />Default: 0 (disabled) </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Ignore sudden massive light intensity changes given as a percentage of the picture area that changed intensity. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionLocate" class="twikiLink">locate</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off, preview<br />Default: off </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Locate and draw a box around the moving object. Value 'preview' makes Motion only draw a box on a saved preview jpeg image and not on the saved mpeg movie. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionLowCpu" class="twikiLink">low_cpu</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 100<br />Default: 0 (disabled) </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> When this option is not zero motion will be in a low cpu mode while not detecting motion. In low cpu mode Motion reduces the framerate to the value given for this option. Value zero means disabled. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionMaskFile" class="twikiLink">mask_file</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> PGM file to use as a sensitivity mask. This picture MUST have the same width and height as the frames being captured and be in binary format. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionMaxMpegTime" class="twikiLink">max_mpeg_time</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 (infinite) - 2147483647<br />Default: 3600 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The maximum length of an mpeg movie in seconds. Set this to zero for unlimited length. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionMinimumFrameTime" class="twikiLink">minimum_frame_time</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 2147483647<br />Default: 0 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Minimum time in seconds between the capturing picture frames from the camera. Default: 0 = disabled - the capture rate is given by the camera framerate. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionMinimumGap" class="twikiLink">minimum_gap</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 2147483647<br />Default: 0 (no minimum) </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The minimum time between two shots in seconds. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionMinimumMotionFrames" class="twikiLink">minimum_motion_frames</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 1 - 1000s<br />Default: 1 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Picture frames must contain motion at least the specified number of frames in a row before they are detected as true motion. At the default of 1, all motion is detected. Valid range is 1 to thousands, but it is recommended to keep it within 1-5. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionMotionVideoPipe" class="twikiLink">motion_video_pipe</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The video4linux video loopback input device for motion images. If a particular pipe is to be used then use the device filename of this pipe, if a dash '-' is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe. Default: not set </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionMovieFilename" class="twikiLink">movie_filename</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This was previously called ffmpeg_filename. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionMysqlDb" class="twikiLink">mysql_db</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Name of the MySQL database. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionMysqlHost" class="twikiLink">mysql_host</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: localhost </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> IP address or domain name for the MySQL server. Use "localhost" if motion and MySQL runs on the same server. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionMysqlPassword" class="twikiLink">mysql_password</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The MySQL password. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionMysqlUser" class="twikiLink">mysql_user</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> The MySQL user name. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionNetcamProxy" class="twikiLink">netcam_proxy</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> URL to use for a netcam proxy server, if required. The syntax is <a href="http://myproxy:portnumber" rel="nofollow" target="_top">http://myproxy:portnumber</a> </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionNetcamUrl" class="twikiLink">netcam_url</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Specify an url to a downloadable jpeg file or raw mjpeg stream to use as input device. Such as an AXIS 2100 network camera. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionNetcamUserpass" class="twikiLink">netcam_userpass</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> For network cameras protected by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionNightCompensate" class="twikiLink">night_compensate</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> When this option is set the noise threshold will be lowered if the picture is dark. This will improve the sensitivity in dark places. However it might also increase the number of false alarms since most cameras also increase light sensitivity with their AGC (Automatic Gain Control) and this will increase noise. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionNoiseLevel" class="twikiLink">noise_level</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 1 - 255<br />Default: 32 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The noise level is used as a threshold for distinguishing between noise and motion. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionNoiseTune" class="twikiLink">noise_tune</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: on </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Activates the automatic tuning of noise level. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionNorm" class="twikiLink">norm</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour)<br />Default: 0 (PAL) </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Select the norm of the video device. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL) </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionOnEventEnd" class="twikiLink">on_event_end</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Command to be executed when an event ends after a period of no motion. The period of no motion is defined by option gap. You can use <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConversionSpecifiers" class="twikiLink">Conversion Specifiers</a> and spaces as part of the command. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionOnEventStart" class="twikiLink">on_event_start</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Command to be executed when an event starts. An event starts at first motion detected after a period of no motion defined by gap. You can use <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConversionSpecifiers" class="twikiLink">ConversionSpecifiers</a> and spaces as part of the command. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionOnMotionDetected" class="twikiLink">on_motion_detected</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Command to be executed when a motion frame is detected. You can use <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConversionSpecifiers" class="twikiLink">Conversion Specifiers</a> and spaces as part of the command. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionOnMovieEnd" class="twikiLink">on_movie_end</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Command to be executed when an ffmpeg movie is closed at the end of an event. You can use <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConversionSpecifiers" class="twikiLink">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionOnMovieStart" class="twikiLink">on_movie_start</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Command to be executed when an mpeg movie is created. You can use <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConversionSpecifiers" class="twikiLink">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionOnPictureSave" class="twikiLink">on_picture_save</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Command to be executed when an image is saved. You can use <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConversionSpecifiers" class="twikiLink">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionOutputAll" class="twikiLink">output_all</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Picture are saved continuously as if motion was detected all the time. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionOutputMotion" class="twikiLink">output_motion</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Output pictures with only the moving object. This feature generates the special motion type movies where you only see the pixels that changes as a graytone image. If labelling is enabled you see the largest area in blue. Smartmask is shown in red. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionOutputNormal" class="twikiLink">output_normal</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off, first, best<br />Default: on </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Normal image is an image that is stored when motion is detected. It is the same image that was taken by the camera. I.e. not a motion image like defined by output_motion. Default is that normal images are stored. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionPgsqlDb" class="twikiLink">pgsql_db</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Name of the PostgreSQL database. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionPgsqlHost" class="twikiLink">pgsql_host</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: localhost </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> IP address or domain name for the PostgreSQL server. Use "localhost" if motion and PostgreSQL runs on the same server. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionPgsqlPassword" class="twikiLink">pgsql_password</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The PostgreSQL password. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionPgsqlPort" class="twikiLink">pgsql_port</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 65535<br />Default: 5432 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> The PostgreSQL server port number. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionPgsqlUser" class="twikiLink">pgsql_user</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The PostgreSQL user name. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionPostCapture" class="twikiLink">post_capture</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 2147483647 <br />Default: 0 (disabled) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Specifies the number of frames to be captured after motion has been detected. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionPpm" class="twikiLink">ppm</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Output ppm images instead of jpeg. This uses less CPU time, but causes a LOT of hard disk I/O, and it is generally slower than jpeg. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionPreCapture" class="twikiLink">pre_capture</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 100s<br />Default: 0 (disabled) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Specifies the number of previous frames to be outputted at motion detection. Recommended range: 0 to 5, default=0. Do not use large values! Large values will cause Motion to skip video frames and cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionProcessIdFile" class="twikiLink">process_id_file</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> File to store the process ID, also called pid file. Recommended value when used: /var/run/motion.pid </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionQuality" class="twikiLink">quality</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 1 - 100<br />Default: 75 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> The quality for the jpeg images in percent. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionQuiet" class="twikiLink">quiet</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Be quiet, don't output beeps when detecting motion. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionRotate" class="twikiLink">rotate</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0, 90, 180, 270<br />Default: 0 (not rotated) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Rotate image the given number of degrees. The rotation affects all saved images as well as mpeg movies. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionRoundrobinFrames" class="twikiLink">roundrobin_frames</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 1 - 2147483647<br />Default: 1 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Specifies the number of frames to capture before switching inputs, this way also slow switching (e.g. every second) is possible. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionRoundrobinSkip" class="twikiLink">roundrobin_skip</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 1 - 2147483647<br />Default: 1 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Specifies the number of frames to skip after a switch. (1 if you are feeling lucky, 2 if you want to be safe). </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionSaturation" class="twikiLink">saturation</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 255<br />Default: 0 (disabled) </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The colour saturation level for the video device. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionSetupMode" class="twikiLink">setup_mode</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Run Motion in setup mode. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionSmartMaskSpeed" class="twikiLink">smart_mask_speed</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 10<br />Default: 0 (disabled) </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Slugginess of the smart mask. Default is 0 = DISABLED. 1 is slow, 10 is fast. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionSnapshotFilename" class="twikiLink">snapshot_filename</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S-snapshot </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> File path for snapshots (jpeg or ppm) relative to target_dir. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionSnapshotInterval" class="twikiLink">snapshot_interval</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 2147483647<br />Default: 0 (disabled) </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Make automated snapshots every 'snapshot_interval' seconds. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionSqlLogImage" class="twikiLink">sql_log_image</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: on </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Log to the database when creating motion triggered image file. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionSqlLogMpeg" class="twikiLink">sql_log_mpeg</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Log to the database when creating motion triggered mpeg file. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionSqlLogSnapshot" class="twikiLink">sql_log_snapshot</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: on </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Log to the database when creating a snapshot image file. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionSqlLogTimelapse" class="twikiLink">sql_log_timelapse</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Log to the database when creating timelapse mpeg file </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionSqlQuery" class="twikiLink">sql_query</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C') </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> SQL query string that is sent to the database. The values for each field are given by using <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConversionSpecifiers" class="twikiLink">convertion specifiers</a> </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionSwitchfilter" class="twikiLink">switchfilter</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Turns the switch filter on or off. The filter can distinguish between most switching noise and real motion. With this you can even set roundrobin_skip to 1 without generating much false detection. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTargetDir" class="twikiLink">target_dir</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined = current working directory </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Target directory for picture and movie files. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTextChanges" class="twikiLink">text_changes</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Turns the text showing changed pixels on/off. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTextDouble" class="twikiLink">text_double</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Draw characters at twice normal size on images. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTextEvent" class="twikiLink">text_event</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: %Y%m%d%H%M%S </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> This option defines the value of the speciel event conversion specifier %C. You can use any conversion specifier in this option except %C. Date and time values are from the timestamp of the first image in the current event. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTextLeft" class="twikiLink">text_left</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> User defined text overlayed on each in the lower left corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # < > \ , . : - + _ \n and <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConversionSpecifiers" class="twikiLink">conversion specifiers</a> (codes starting by a %). </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTextRight" class="twikiLink">text_right</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: %Y-%m-%d\n%T </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> User defined text overlayed on each in the lower right corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # < > , . : - + _ \n and <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConversionSpecifiers" class="twikiLink">conversion specifiers</a> (codes starting by a %). Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionThread" class="twikiLink">thread</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Specifies full path and filename for a thread config file. Each camera needs a thread config file containing the options that are unique to the camera. If you only have one camera you do not need thread config files. If you have two or more cameras you need one thread config file for each camera in addition to motion.conf. This option must be placed in motion.conf and not in a thread config file. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionThreshold" class="twikiLink">threshold</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 1 - 2147483647<br />Default: 1500 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Threshold for declaring motion. The threshold is the number of changed pixels counted after noise filtering, masking, despeckle, and labelling. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionThresholdTune" class="twikiLink">threshold_tune</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Activates the automatic tuning of threshold level. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTimelapseFilename" class="twikiLink">timelapse_filename</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: %v-%Y%m%d-timelapse </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> File path for timelapse mpegs relative to target_dir (ffmpeg only). </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackAuto" class="twikiLink">track_auto</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Enable auto tracking </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackIomojoId" class="twikiLink">track_iomojo_id</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 2147483647<br />Default: 0 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Use this option if you have an iomojo smilecam connected to the serial port instead of a general stepper motor controller. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackMaxx" class="twikiLink">track_maxx</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 2147483647<br />Default: 0 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> The maximum position for servo x. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackMaxy" class="twikiLink">track_maxy</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 2147483647<br />Default: 0 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The maximum position for servo y. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackMotorx" class="twikiLink">track_motorx</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: -1 - 2147483647<br />Default: -1 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> The motor number that is used for controlling the x-axis. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackMotory" class="twikiLink">track_motory</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: -1 - 2147483647<br />Default: -1 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The motor number that is used for controlling the y-axis. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackMoveWait" class="twikiLink">track_move_wait</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 2147483647<br />Default: 10 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Delay during which tracking is disabled after auto tracking has moved the camera. Delay is defined as number of picture frames. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackPort" class="twikiLink">track_port</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> This is the device name of the serial port to which the stepper motor interface is connected. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackSpeed" class="twikiLink">track_speed</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 255<br />Default: 255 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Speed to set the motor to. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackStepAngleX" class="twikiLink">track_step_angle_x</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0-90<br />Default: 10 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Angle in degrees the camera moves per step on the X-axis with auto tracking. Currently only used with pwc type cameras. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackStepAngleY" class="twikiLink">track_step_angle_y</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0-40<br />Default: 10 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Angle in degrees the camera moves per step on the Y-axis with auto tracking. Currently only used with pwc type cameras. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackStepsize" class="twikiLink">track_stepsize</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 0 - 255<br />Default: 40 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Number of steps to make. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTrackType" class="twikiLink">track_type</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 (none), 1 (stepper), 2 (iomojo), 3 (pwc), 4 (generic), 5 (uvcvideo)<br />Default: 0 (None) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Type of tracker. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionTunerdevice" class="twikiLink">tunerdevice</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: /dev/tuner0 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The tuner device used for controlling the tuner in a tuner card. This option is only used when Motion is compiled for <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/FreeBSD" class="twikiLink">FreeBSD</a>. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionVideoPipe" class="twikiLink">video_pipe</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: Not defined </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> The video4linux video loopback input device for normal images. If a particular pipe is to be used then use the device filename of this pipe. If a dash '-' is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionVideodevice" class="twikiLink">videodevice</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: Max 4095 characters<br />Default: /dev/video0 (<a href="http://www.lavrsen.dk/twiki/bin/view/Motion/FreeBSD" class="twikiLink">FreeBSD</a>: /dev/bktr0) </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> The video device to be used for capturing. Default for Linux is /dev/video0. for <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/FreeBSD" class="twikiLink">FreeBSD</a> the default is /dev/bktr0. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionWebcamLimit" class="twikiLink">webcam_limit</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 2147483647<br />Default: 0 (unlimited) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Limit the number of frames to number frames. After 'webcam_limit' number of frames the connection will be closed by motion. The value 0 means unlimited. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionWebcamLocalhost" class="twikiLink">webcam_localhost</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: on </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Limits the access to the webcam to the localhost. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionWebcamMaxrate" class="twikiLink">webcam_maxrate</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 1 - 100<br />Default: 1 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Limit the framerate of the webcam in frames per second. Default is 1. Set the value to 100 for practically unlimited. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionWebcamMotion" class="twikiLink">webcam_motion</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: on, off<br />Default: off </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> If set to 'on' Motion sends slows down the webcam stream to 1 picture per second when no motion is detected. When motion is detected the stream runs as defined by webcam_maxrate. When 'off' the webcam stream always runs as defined by webcam_maxrate. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionWebcamPort" class="twikiLink">webcam_port</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> Values: 0 - 65535<br />Default: 0 (disabled) </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> TCP port on which motion will listen for incoming connects with its webcam server. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionWebcamQuality" class="twikiLink">webcam_quality</a> </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Values: 1 - 100<br />Default: 50 </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> Quality setting in percent for the mjpeg picture frames transferred over the webcam connection. Keep it low to restrict needed bandwidth. </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol twikiLast"> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionWidth" class="twikiLink">width</a> </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> Values: Device Dependent<br />Default: 352 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> The width in pixels of each frame. Valid range is camera dependent. </td></tr>
</table>
<p />
<p />
<h2><a name="Signals_sent_with_e_g_kill_comma"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/SignalsKill" class="twikiLink">Signals (sent with e.g. kill command)</a> </h2>
A signal can be sent from the command line by typing e.g. <code>kill -s SIGHUP pid</code>, where the last parameter is the process ID which you get by typing <code>ps -ef ¦ grep motion</code>. The PID is the first on the list which is the parent process for the threads.
Motion responds to the following signals:
<p />
<table style="border-width:1px;" cellspacing="0" cellpadding="0" class="twikiTable" border="1"><tr class="twikiTableEven"><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" class="twikiFirstCol" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=0;table=9;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Signal</a> </th><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=1;table=9;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Description</a> </th><th bgcolor="#6b7f93" align="center" valign="top" style="text-align:center;vertical-align:top;" maxcols="0"> <a rel="nofollow" href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument&amp;sortcol=2;table=9;up=0#sorted_table" style="color:#ffffff" title="Sort by this column">Editors comment</a> </th></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol"> SIGHUP </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> The config file will be reread. </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;"> This is a very useful signal when you experiment with settings in the config file. </td></tr>
<tr class="twikiTableEven"><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;" class="twikiFirstCol"> SIGTERM </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> If needed motion will create an mpeg file of the last event and exit </td><td bgcolor="#edf4f9" valign="top" style="vertical-align:top;"> </td></tr>
<tr class="twikiTableOdd"><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiFirstCol twikiLast"> SIGUSR1 </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> Motion will create an mpeg file of the current event. </td><td bgcolor="#ffffff" valign="top" style="vertical-align:top;" class="twikiLast"> </td></tr>
</table>
<p />
<p />
<h2><a name="Error_Logging"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ErrorLogging" class="twikiLink">Error Logging</a> </h2>
Motion reports errors to the console when it runs in non-daemon mode. And it outputs even more information when run in setup mode.
<p />
Error logging has been implemented so that errors during daemon (background) mode are logged in the syslog.
<p />
The syslog is in most Linux systems the file <code>/var/log/messages</code> (e.g. RedHat/Fedora) or <code>/var/log/syslog</code> and <code>/var/log/user.log</code> (e.g. Debian).
<p />
<p />
<h1><a name="Motion_Guide_Basic_Features"></a> Motion Guide - Basic Features </h1>
<p />
<h2><a name="Capture_Device_Options_The_Basic"></a> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/CaptureDeviceOptions" class="twikiLink">Capture Device Options - The Basic Setup</a> </h2>
Before you can start using motion you need to know some basics about your camera.
Either you have a camera connected directly to your computer. In this case it is a video4linux type of camera. Or you connect to a network camera using a normal web URL.
<p />
<h2><a name="video4linux_V4L_devices"></a> video4linux (<a href="http://www.lavrsen.dk/twiki/bin/view/Motion/V4L" class="twikiLink">V4L</a>) devices </h2>
You need to install your camera with the right driver. It is out of scope of this document to tell you how to do this and it depends on which type of camera.
<p />
Once installed the camera(s) will have the device names /dev/video0, /dev/video1, /dev/video2...
<p />
FreeBSD has a different naming of devices. When you build Motion for FreeBSD the default device name is /dev/bktr0. Under FreeBSD a TV card has a special device for controlling the tuner (e.g. /dev/tuner0). The option tunerdevice is only valid when Motion is built and running under FreeBSD. For Linux do not include this option in the config file (remove or comment out).
<p />
<strong>USB cameras</strong> take a lot of bandwidth. A USB camera connected to a USB 1.1 port or hub consumes all the bandwidth. Even with a small framesize and low framerate you should not expect to have more than one camera per USB 1.1 controller. If you need more than 1 USB camera add extra USB PCI cards to your computer. There exists cards that have 4 inputs each with their own controller and with full bandwidth. Many 4-input cards only have 1 controller. USB cameras do not have the feature of selecting input channels. <em>To disable the input selection the option <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionInput" class="twikiLink">input</a> must be set to the value 8 for USB cameras.</em>
<p />
<strong>Composite video cards</strong> are normally made with a chip called BT878 (older cards have a BT848). They all use the Linux driver called 'bttv'.
<p />
There are cards with more then one video input but still only one BT878 chip. They have a video multiplexer which input is selected with the config option <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionInput" class="twikiLink">input</a>. Input channel numbers start at 0 (which is why the value 8 and not 0 disables input selection). There are video capture cards available with 4 or 8 inputs but only one chip. They present themselves as one single video device and you select input using the 'input' option. If you define e.g. 4 thread config files with the same videodevice name but different input numbers Motion automatically goes into round robin mode. See the <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideOneLargeDocument#RoundRobin" class="twikiCurrentTopicLink twikiAnchorLink">round robin</a> section for more information. Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3. Other have TV=0, composite video 1= 1, composite video = 2, S-VHS = 3. For video capture cards input 1 is normally the composite video input.
<p />
Some capture cards are specially made for surveillance with for example 4 inputs. Others have a TV tuner, a composite input (phono socket) and perhaps also a S-VHS input. For all these cards the inputs are numbered. The numbering varies from card to card so the easiest is to experiment for 5 minutes with a program that can show the videostream. Use a program such as Camstream or xawtv to experiment with the values.
<p />
If you use the TV tuner input you also need to set the frequency of the TV channel using the option <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFrequency" class="twikiLink">frequency</a>. Otherwise set 'frequency' to 0.
<p />
Finally you need to set the TV norm. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default is 0 (PAL). If your camera is a PAL black and white you may get a better result with norm=3 (PAL no colour).
<p />
If the <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionNetcamUrl" class="twikiLink">netcam_url</a> option is defined all the video4linux options are ignored so make sure the netcam_url option is commented out if you do not need it.
<p />
<strong>These are the parameters used for video4linux devices</strong>
<p />
<p />
<h3><a name="auto_brightness"></a> auto_brightness </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionAutoBrightness" class="twikiLink">Option Topic</a>
</li></ul>
<p />
Let motion regulate the brightness of a video device. Only recommended for cameras without auto brightness
<p />
Motion will try to adjust the brightness of the video device if the images captured are too dark or too light. This option will be most useful for video devices like web cams, which sometimes don't have such an option in hardware.
<p />
The auto_brightness feature will adjust the brightness of the device up or down until the value defined by the option <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionBrightness" class="twikiLink">brightness</a> is reached (1 = dark, 255 = bright). If <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionBrightness" class="twikiLink">brightness</a> is zero auto_brightness will try to adjust to the average brightness level 128.
<p />
You need to know if the camera supports auto brightness. Most cameras have auto everything. If your video device already does this for you this option might cause oscillations. If you do not know assume that it has and do not use the Motion auto brightness feature. At least not to start with.
<p />
<p />
<h3><a name="brightness"></a> brightness </h3> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionBrightness" class="twikiLink">Option Topic</a>
</li></ul>
<p />
The brightness level for the video device.
<p />
Value 0 means that Motion does not set the brightness value but leaves it unchanged.
<p />
If this setting is used in conjunction with the <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionAutoBrightness" class="twikiLink">auto_brightness</a> feature then this setting is the average brightness level in the range 1 (dark) to 255 (bright) that the auto_brightness feature will try to achieve by adjusting the device brightness up and down.
<p />
<p />
<h3><a name="contrast"></a> contrast </h3> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionContrast" class="twikiLink">Option Topic</a>
</li></ul>
<p />
The contrast level for the video device.
<p />
Disabled (Value 0) means that Motion does not set the contrast value.
<p />
<p />
<h3><a name="framerate"></a> framerate </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 2 - 100
</li> <li> Default: 100 (no limit)
</li> <li> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFramerate" class="twikiLink">Option Topic</a>
</li></ul>
<p />
Maximum number of frames to be captured from the camera per second.
<p />
The faster you fetch pictures from the camera the more CPU load you get and the more pictures get included when Motion is detected.
<p />
Motion will stop storing pictures if the framerate is set to less than 2.
<p />
Set this parameter to the maximum number of images per second that you want to store either as images or as mpeg films.
<p />
To set intervals longer than one second use the 'minimum_gap' option instead.
<p />
<p />
<h3><a name="frequency"></a> frequency </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: 0 - 999999
</li> <li> Default: 0 (Not set)
</li> <li> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionFrequency" class="twikiLink">Option Topic</a>
</li></ul>
<p />
The frequency to set the tuner to (kHz). Valid range: per tuner spec, default: 0 (Don't set it)
<p />
This option is only relevant if you have a TV tuner card where you can select the tuner frequency. Your tuner card must support this feature.
<p />
<p />
<h3><a name="height"></a> height </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: Device Dependent
</li> <li> Default: 288
</li> <li> <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/ConfigOptionHeight" class="twikiLink">Option Topic</a>
</li></ul>
<p />
The height of each frame in pixels.
<p />
The height of the image in pixels. Motion does not scale so should be set to the actual size of the v4l device. In case of a net camera motion sets the height to the height of the first image read.
<p />
Motion actually set the size of the image coming from the video4linux device.
<p />
Your camera or capture/TV card will not support any picture size. You must know which frame size (width and height) the camera supports. If you do not know start with width 320 and height 240 which most cameras and capture cards supports.
<p />
For some device drivers like pwc (driver for Philips USB cameras) setting the size to a non-standard value makes the driver create an image of the nearest smaller size and create a gray band around the image to fit the size given by motion. Note that it is the driver and not motion that generates the gray band. Motion will try to detect motion in the entire image including the gray band.
<p />
Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Thís is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16.
<p />