forked from Motion-Project/motion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.c
3313 lines (3117 loc) · 101 KB
/
conf.c
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
/*
**
** conf.c
**
** I originally wrote conf.c as part of the drpoxy package
** thanks to Matthew Pratt and others for their additions.
**
** Copyright 1999 Jeroen Vreeken (pe1rxq@chello.nl)
**
** This software is licensed under the terms of the GNU General
** Public License (GPL). Please see the file COPYING for details.
**
**
*/
/**
* How to add a config option :
*
* 1. think twice, there are settings enough
*
* 2. add a field to 'struct config' (conf.h) and 'struct config conf'
*
* 4. add a entry to the config_params array below, if your
* option should be configurable by the config file.
*/
#include <dirent.h>
#include <string.h>
#include "translate.h"
#include "motion.h"
#define EXTENSION ".conf"
#define stripnewline(x) {if ((x)[strlen(x)-1]=='\n') (x)[strlen(x) - 1] = 0; }
struct config conf_template = {
/* Overall system configuration parameters */
/* daemon is directly cast into the cnt context rather than conf */
.setup_mode = FALSE,
.pid_file = NULL,
.log_file = NULL,
.log_level = LEVEL_DEFAULT+10,
.log_type = NULL,
.quiet = TRUE,
.native_language = TRUE,
.camera_name = NULL,
.camera_id = 0,
.camera_dir = NULL,
.target_dir = NULL,
/* Capture device configuration parameters */
.video_device = DEF_VIDEO_DEVICE,
.vid_control_params = NULL,
.v4l2_palette = DEF_PALETTE,
.input = DEF_INPUT,
.norm = 0,
.frequency = 0,
.auto_brightness = 0,
.tuner_device = NULL,
.roundrobin_frames = 1,
.roundrobin_skip = 1,
.roundrobin_switchfilter = FALSE,
.netcam_url = NULL,
.netcam_highres= NULL,
.netcam_userpass = NULL,
.netcam_keepalive = "off",
.netcam_proxy = NULL,
.netcam_tolerant_check = FALSE,
.netcam_use_tcp = TRUE,
.mmalcam_name = NULL,
.mmalcam_control_params = NULL,
/* Image processing configuration parameters */
.width = DEF_WIDTH,
.height = DEF_HEIGHT,
.framerate = DEF_MAXFRAMERATE,
.minimum_frame_time = 0,
.rotate = 0,
.flip_axis = "none",
.locate_motion_mode = "off",
.locate_motion_style = "box",
.text_left = NULL,
.text_right = DEF_TIMESTAMP,
.text_changes = FALSE,
.text_scale = 1,
.text_event = DEF_EVENTSTAMP,
/* Motion detection configuration parameters */
.emulate_motion = FALSE,
.threshold = DEF_CHANGES,
.threshold_maximum = 0,
.threshold_tune = FALSE,
.noise_level = DEF_NOISELEVEL,
.noise_tune = TRUE,
.despeckle_filter = NULL,
.area_detect = NULL,
.mask_file = NULL,
.mask_privacy = NULL,
.smart_mask_speed = 0,
.lightswitch_percent = 0,
.lightswitch_frames = 5,
.minimum_motion_frames = 1,
.event_gap = DEF_EVENT_GAP,
.pre_capture = 0,
.post_capture = 0,
/* Script execution configuration parameters */
.on_event_start = NULL,
.on_event_end = NULL,
.on_picture_save = NULL,
.on_motion_detected = NULL,
.on_area_detected = NULL,
.on_movie_start = NULL,
.on_movie_end = NULL,
.on_camera_lost = NULL,
.on_camera_found = NULL,
/* Picture output configuration parameters */
.picture_output = "off",
.picture_output_motion = FALSE,
.picture_type = "jpeg",
.picture_quality = 75,
.picture_exif = NULL,
.picture_filename = DEF_IMAGEPATH,
/* Snapshot configuration parameters */
.snapshot_interval = 0,
.snapshot_filename = DEF_SNAPPATH,
/* Movie output configuration parameters */
.movie_output = TRUE,
.movie_output_motion = FALSE,
.movie_max_time = 120,
.movie_bps = 400000,
.movie_quality = 60,
.movie_codec = "mkv",
.movie_duplicate_frames = FALSE,
.movie_passthrough = FALSE,
.movie_filename = DEF_MOVIEPATH,
.movie_extpipe_use = FALSE,
.movie_extpipe = NULL,
/* Timelapse movie configuration parameters */
.timelapse_interval = 0,
.timelapse_mode = DEF_TIMELAPSE_MODE,
.timelapse_fps = 30,
.timelapse_codec = "mpg",
.timelapse_filename = DEF_TIMEPATH,
/* Loopback device configuration parameters */
.video_pipe = NULL,
.video_pipe_motion = NULL,
/* Webcontrol configuration parameters */
.webcontrol_port = 0,
.webcontrol_ipv6 = FALSE,
.webcontrol_localhost = TRUE,
.webcontrol_parms = 0,
.webcontrol_interface = 0,
.webcontrol_auth_method = 0,
.webcontrol_authentication = NULL,
.webcontrol_tls = FALSE,
.webcontrol_cert = NULL,
.webcontrol_key = NULL,
.webcontrol_cors_header = NULL,
/* Live stream configuration parameters */
.stream_port = 0,
.stream_localhost = TRUE,
.stream_auth_method = 0,
.stream_authentication = NULL,
.stream_tls = FALSE,
.stream_cors_header = NULL,
.stream_preview_scale = 25,
.stream_preview_newline = FALSE,
.stream_preview_method = 0,
.stream_quality = 50,
.stream_grey = FALSE,
.stream_motion = FALSE,
.stream_maxrate = 1,
.stream_limit = 0,
/* Database and SQL configuration parameters */
.database_type = NULL,
.database_dbname = NULL,
.database_host = "localhost",
.database_port = 0,
.database_user = NULL,
.database_password = NULL,
.database_busy_timeout = 0,
.sql_log_picture = FALSE,
.sql_log_snapshot = FALSE,
.sql_log_movie = FALSE,
.sql_log_timelapse = FALSE,
.sql_query_start = NULL,
.sql_query_stop = NULL,
.sql_query = NULL
};
/* Forward Declares */
static void malloc_strings(struct context *);
static struct context **copy_bool(struct context **, const char *, int);
static struct context **copy_int(struct context **, const char *, int);
static struct context **config_camera(struct context **cnt, const char *str, int val);
static struct context **copy_vid_ctrl(struct context **, const char *, int);
static struct context **copy_text_double(struct context **, const char *, int);
static struct context **copy_html_output(struct context **, const char *, int);
static const char *print_bool(struct context **, char **, int, unsigned int);
static const char *print_int(struct context **, char **, int, unsigned int);
static const char *print_string(struct context **, char **, int, unsigned int);
static const char *print_camera(struct context **, char **, int, unsigned int);
static void usage(void);
static void config_parms_intl(void);
/* Pointer magic to determine relative addresses of variables to a
struct context pointer */
#define CNT_OFFSET(varname) ((long)&((struct context *)NULL)->varname)
#define CONF_OFFSET(varname) ((long)&((struct context *)NULL)->conf.varname)
#define TRACK_OFFSET(varname) ((long)&((struct context *)NULL)->track.varname)
/* The sequence of these within here determines how they are presented to user
* Note daemon goes directly to cnt context rather than conf.
* Descriptions are limited to one line and few to no references to values since
* the motion_guide.html is our single source of documentation and historically
* these descriptions were not updated with revisions.
*/
config_param config_params[] = {
{
"daemon",
"############################################################\n"
"# System control configuration parameters\n"
"############################################################\n\n"
"# Start in daemon (background) mode and release terminal.",
1,
CNT_OFFSET(daemon),
copy_bool,
print_bool,
WEBUI_LEVEL_ADVANCED
},
{
"setup_mode",
"# Start in Setup-Mode, daemon disabled.",
0,
CONF_OFFSET(setup_mode),
copy_bool,
print_bool,
WEBUI_LEVEL_ADVANCED
},
{
"pid_file",
"# File to store the process ID.",
1,
CONF_OFFSET(pid_file),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"log_file",
"# File to write logs messages into. If not defined stderr and syslog is used.",
1,
CONF_OFFSET(log_file),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"log_level",
"# Level of log messages [1..9] (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL).",
1,
CONF_OFFSET(log_level),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"log_type",
"# Filter to log messages by type (COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL).",
1,
CONF_OFFSET(log_type),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"quiet",
"# Do not sound beeps when detecting motion",
0,
CONF_OFFSET(quiet),
copy_bool,
print_bool,
WEBUI_LEVEL_LIMITED
},
{
"native_language",
"# Native language support.",
1,
CONF_OFFSET(native_language),
copy_bool,
print_bool,
WEBUI_LEVEL_LIMITED
},
{
"camera_name",
"# User defined name for the camera.",
0,
CONF_OFFSET(camera_name),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"camera_id",
"# Numeric identifier for the camera.",
0,
CONF_OFFSET(camera_id),
copy_int,
print_int,
WEBUI_LEVEL_ADVANCED
},
/* camera and camera_dir must be last in this list */
{
"target_dir",
"# Target directory for pictures, snapshots and movies",
0,
CONF_OFFSET(target_dir),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"videodevice",
"# Video device (e.g. /dev/video0) to be used for capturing.",
0,
CONF_OFFSET(video_device),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"vid_control_params",
"# Parameters to control video device. See motion_guide.html",
0,
CONF_OFFSET(vid_control_params),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"v4l2_palette",
"# Preferred color palette to be used for the video device",
0,
CONF_OFFSET(v4l2_palette),
copy_int,
print_int,
WEBUI_LEVEL_ADVANCED
},
{
"input",
"# The input number to be used on the video device.",
0,
CONF_OFFSET(input),
copy_int,
print_int,
WEBUI_LEVEL_ADVANCED
},
{
"norm",
"# The video norm to use for video capture and TV tuner cards.",
0,
CONF_OFFSET(norm),
copy_int,
print_int,
WEBUI_LEVEL_ADVANCED
},
{
"frequency",
"# The frequency to set the tuner to (kHz) for TV tuner cards",
0,
CONF_OFFSET(frequency),
copy_int,
print_int,
WEBUI_LEVEL_ADVANCED
},
{
"auto_brightness",
"# The Motion method to use to change the brightness/exposure on video device.",
0,
CONF_OFFSET(auto_brightness),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"tunerdevice",
"# Device name (e.g. /dev/tuner0) to be used for capturing when using tuner as source",
0,
CONF_OFFSET(tuner_device),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"roundrobin_frames",
"# Number of frames to capture in each roundrobin step",
0,
CONF_OFFSET(roundrobin_frames),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"roundrobin_skip",
"# Number of frames to skip before each roundrobin step",
0,
CONF_OFFSET(roundrobin_skip),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"roundrobin_switchfilter",
"# Try to filter out noise generated by roundrobin",
0,
CONF_OFFSET(roundrobin_switchfilter),
copy_bool,
print_bool,
WEBUI_LEVEL_LIMITED
},
{
"netcam_url",
"# The full URL of the network camera stream.",
0,
CONF_OFFSET(netcam_url),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"netcam_highres",
"# Optional high resolution URL for rtsp/rtmp cameras only.",
0,
CONF_OFFSET(netcam_highres),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"netcam_userpass",
"# Username and password for network camera. Syntax username:password",
0,
CONF_OFFSET(netcam_userpass),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"netcam_keepalive",
"# The method for keep-alive of network socket for mjpeg streams.",
0,
CONF_OFFSET(netcam_keepalive),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"netcam_proxy",
"# The URL to use for a netcam proxy server.",
0,
CONF_OFFSET(netcam_proxy),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"netcam_tolerant_check",
"# Use less strict jpeg checks for network cameras.",
0,
CONF_OFFSET(netcam_tolerant_check),
copy_bool,
print_bool,
WEBUI_LEVEL_ADVANCED
},
{
"netcam_use_tcp",
"# Use TCP transport for RTSP/RTMP connections to camera.",
1,
CONF_OFFSET(netcam_use_tcp),
copy_bool,
print_bool,
WEBUI_LEVEL_ADVANCED
},
{
"mmalcam_name",
"# Name of mmal camera (e.g. vc.ril.camera for pi camera).",
0,
CONF_OFFSET(mmalcam_name),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"mmalcam_control_params",
"# Camera control parameters (see raspivid/raspistill tool documentation)",
0,
CONF_OFFSET(mmalcam_control_params),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"width",
"############################################################\n"
"# Image Processing configuration parameters\n"
"############################################################\n\n"
"# Image width in pixels.",
0,
CONF_OFFSET(width),
copy_int,
print_int,
WEBUI_LEVEL_ADVANCED
},
{
"height",
"# Image height in pixels.",
0,
CONF_OFFSET(height),
copy_int,
print_int,
WEBUI_LEVEL_ADVANCED
},
{
"framerate",
"# Maximum number of frames to be captured per second.",
0,
CONF_OFFSET(framerate),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"minimum_frame_time",
"# Minimum time in seconds between capturing picture frames from the camera.",
0,
CONF_OFFSET(minimum_frame_time),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"rotate",
"# Number of degrees to rotate image.",
0,
CONF_OFFSET(rotate),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"flip_axis",
"# Flip image over a given axis",
0,
CONF_OFFSET(flip_axis),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"locate_motion_mode",
"# Draw a locate box around the moving object.",
0,
CONF_OFFSET(locate_motion_mode),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"locate_motion_style",
"# Set the look and style of the locate box.",
0,
CONF_OFFSET(locate_motion_style),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"text_left",
"# Text to be overlayed in the lower left corner of images",
0,
CONF_OFFSET(text_left),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"text_right",
"# Text to be overlayed in the lower right corner of images.",
0,
CONF_OFFSET(text_right),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"text_changes",
"# Overlay number of changed pixels in upper right corner of images.",
0,
CONF_OFFSET(text_changes),
copy_bool,
print_bool,
WEBUI_LEVEL_LIMITED
},
{
"text_scale",
"# Scale factor for text overlayed on images.",
0,
CONF_OFFSET(text_scale),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"text_event",
"# The special event conversion specifier %C",
0,
CONF_OFFSET(text_event),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"emulate_motion",
"############################################################\n"
"# Motion detection configuration parameters\n"
"############################################################\n\n"
"# Always save pictures and movies even if there was no motion.",
0,
CONF_OFFSET(emulate_motion),
copy_bool,
print_bool,
WEBUI_LEVEL_LIMITED
},
{
"threshold",
"# Threshold for number of changed pixels that triggers motion.",
0,
CONF_OFFSET(threshold),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"threshold_maximum",
"# The maximum threshold for number of changed pixels that triggers motion.",
0,
CONF_OFFSET(threshold_maximum),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"threshold_tune",
"# Enable tuning of the threshold down if possible.",
0,
CONF_OFFSET(threshold_tune),
copy_bool,
print_bool,
WEBUI_LEVEL_LIMITED
},
{
"noise_level",
"# Noise threshold for the motion detection.",
0,
CONF_OFFSET(noise_level),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"noise_tune",
"# Automatically tune the noise threshold",
0,
CONF_OFFSET(noise_tune),
copy_bool,
print_bool,
WEBUI_LEVEL_LIMITED
},
{
"despeckle_filter",
"# Despeckle the image using (E/e)rode or (D/d)ilate or (l)abel.",
0,
CONF_OFFSET(despeckle_filter),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"area_detect",
"# Area number used to trigger the on_area_detected script.",
0,
CONF_OFFSET(area_detect),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"mask_file",
"# Full path and file name for motion detection mask PGM file.",
0,
CONF_OFFSET(mask_file),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"mask_privacy",
"# Full path and file name for privacy mask PGM file.",
0,
CONF_OFFSET(mask_privacy),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"smart_mask_speed",
"# The value defining how slow or fast the smart motion mask created and used.",
0,
CONF_OFFSET(smart_mask_speed),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"lightswitch_percent",
"# Percentage of image that triggers a lightswitch detected.",
0,
CONF_OFFSET(lightswitch_percent),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"lightswitch_frames",
"# When lightswitch is detected, ignore this many frames",
0,
CONF_OFFSET(lightswitch_frames),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"minimum_motion_frames",
"# Number of images that must contain motion to trigger an event.",
0,
CONF_OFFSET(minimum_motion_frames),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"event_gap",
"# Gap in seconds of no motion detected that triggers the end of an event.",
0,
CONF_OFFSET(event_gap),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"pre_capture",
"# The number of pre-captured (buffered) pictures from before motion.",
0,
CONF_OFFSET(pre_capture),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"post_capture",
"# Number of frames to capture after motion is no longer detected.",
0,
CONF_OFFSET(post_capture),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"on_event_start",
"############################################################\n"
"# Script execution configuration parameters\n"
"############################################################\n\n"
"# Command to be executed when an event starts.",
0,
CONF_OFFSET(on_event_start),
copy_string,
print_string,
WEBUI_LEVEL_RESTRICTED
},
{
"on_event_end",
"# Command to be executed when an event ends.",
0,
CONF_OFFSET(on_event_end),
copy_string,
print_string,
WEBUI_LEVEL_RESTRICTED
},
{
"on_picture_save",
"# Command to be executed when a picture is saved.",
0,
CONF_OFFSET(on_picture_save),
copy_string,
print_string,
WEBUI_LEVEL_RESTRICTED
},
{
"on_area_detected",
"# Command to be executed when motion in a predefined area is detected",
0,
CONF_OFFSET(on_area_detected),
copy_string,
print_string,
WEBUI_LEVEL_RESTRICTED
},
{
"on_motion_detected",
"# Command to be executed when motion is detected",
0,
CONF_OFFSET(on_motion_detected),
copy_string,
print_string,
WEBUI_LEVEL_RESTRICTED
},
{
"on_movie_start",
"# Command to be executed when a movie file is created.",
0,
CONF_OFFSET(on_movie_start),
copy_string,
print_string,
WEBUI_LEVEL_RESTRICTED
},
{
"on_movie_end",
"# Command to be executed when a movie file is closed.",
0,
CONF_OFFSET(on_movie_end),
copy_string,
print_string,
WEBUI_LEVEL_RESTRICTED
},
{
"on_camera_lost",
"# Command to be executed when a camera can't be opened or if it is lost",
0,
CONF_OFFSET(on_camera_lost),
copy_string,
print_string,
WEBUI_LEVEL_RESTRICTED
},
{
"on_camera_found",
"# Command to be executed when a camera that was lost has been found.",
0,
CONF_OFFSET(on_camera_found),
copy_string,
print_string,
WEBUI_LEVEL_RESTRICTED
},
{
"picture_output",
"############################################################\n"
"# Picture output configuration parameters\n"
"############################################################\n\n"
"# Output pictures when motion is detected",
0,
CONF_OFFSET(picture_output),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"picture_output_motion",
"# Output pictures with only the pixels moving object (ghost images)",
0,
CONF_OFFSET(picture_output_motion),
copy_bool,
print_bool,
WEBUI_LEVEL_LIMITED
},
{
"picture_type",
"# Format for the output pictures.",
0,
CONF_OFFSET(picture_type),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"picture_quality",
"# The quality (in percent) to be used in the picture compression",
0,
CONF_OFFSET(picture_quality),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"picture_exif",
"# Text to include in a JPEG EXIF comment",
0,
CONF_OFFSET(picture_exif),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"picture_filename",
"# File name(without extension) for pictures relative to target directory",
0,
CONF_OFFSET(picture_filename),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"snapshot_interval",
"############################################################\n"
"# Snapshot output configuration parameters\n"
"############################################################\n\n"
"# Make automated snapshot every N seconds",
0,
CONF_OFFSET(snapshot_interval),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"snapshot_filename",
"# File name(without extension) for snapshots relative to target directory",
0,
CONF_OFFSET(snapshot_filename),
copy_string,
print_string,
WEBUI_LEVEL_LIMITED
},
{
"movie_output",
"############################################################\n"
"# Movie output configuration parameters\n"
"############################################################\n\n"
"# Create movies of motion events.",
0,
CONF_OFFSET(movie_output),
copy_bool,
print_bool,
WEBUI_LEVEL_LIMITED
},
{
"movie_output_motion",
"# Create movies of moving pixels of motion events.",
0,
CONF_OFFSET(movie_output_motion),
copy_bool,
print_bool,
WEBUI_LEVEL_LIMITED
},
{
"movie_max_time",
"# Maximum length of movie in seconds.",
0,
CONF_OFFSET(movie_max_time),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"movie_bps",
"# The fixed bitrate to be used by the movie encoder. Ignore quality setting",
0,
CONF_OFFSET(movie_bps),
copy_int,
print_int,
WEBUI_LEVEL_LIMITED
},
{
"movie_quality",
"# The encoding quality of the movie. (0=use bitrate. 1=worst quality, 100=best)",
0,
CONF_OFFSET(movie_quality),
copy_int,