-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
constatus.cfg
1093 lines (1018 loc) · 33.8 KB
/
constatus.cfg
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
logfile = "test.log";
log-level = "info";
# This setting selects what library to use to resize/scale the video
# images (when used).
# "regular" is just resize as is.
# Use "crop" when not to scale but to crop, in that case
# resize-crop-center selects if the result should be centered.
resize-type = "regular";
resize-crop-center = true;
# how to handle failures of any kind
# note that a 'source'-object can also have a failure-handling instance.
failure-handling = {
# mode, can be either "message" or "nothing". nothing returns a black image.
mode = "message";
# jpeg-image to show on the background (optional)
bitmap = "";
# message to show when the source fails. Note that cameras that return
# some form of JPEG (e.g. MJPEG) which is corrupted may give a 'gray image'
# instead of an error.
message = "Camera down since %c";
# where to put the message
position = "center-center";
# position can be:
# - upper-left
# - upper-center
# - upper-right
# - center-left
# - center-center
# - center-right
# - lower-left
# - lower-center
# - lower-right
# - xy
# e.g.: position = 'xy:100,200'
# this is a relative position; a negative value will wrap
# - axy
# e.g.: position = 'axy:100,200'
# this is an absolute position
};
instances = ({
instance-name = "my instance name";
# optional, show in web-interface:
instance-descr = "something descriptive";
source = {
id = "1-1";
descr = "video4linux source";
type = "v4l";
device = "/dev/video0";
width = 352;
height = 288;
# If the camera supports JPEG output AND no post-processing ("filters")
# are applied nor any motion detection, then setting this to true may
# lower cpu usage.
prefer-jpeg = false;
# Enable controling of contrast/saturation/etc in the user interface.
# Note: runs a software implementation (relatively slow!) if the hardware
# has no support for it.
enable-controls = true;
# What program/script to start when the video-source fails. E.g.
# something that restarts the camera.
exec-failure = "";
# how long before a camera is considered to be off-line (in seconds)
# timeout = 2.5;
# When the video-source is unreliable, enabling the watchdog can let
# constatus try to restart it. The parameter sets after how many seconds
# to try to restart the camera. Use "-1.0" to disable this feature.
watchdog-timeout = 3.0;
# Start/stop this \"source\" depending on the demand. E.g. connections
# to ip-cameras will be stopped when no-one is viewing. Note that when
# a motion-trigger is configured, that this setting then effectively is
# a no-op.
# Note: when this is set to true, opening a view to this source may
# have (considerable) delay before anything is shown! (depending on the
# latency of the source)
# This functionality can be useful for example when using constatus as
# a portal to one or more cameras. It can then e.g. hide the real IP-
# address and/or interface streaming protocols (for example h.264 to
# mjpeg).
on-demand = false;
# libcamera is https://libcamera.org/
# type = "libcamera";
# Camera-name is e.g. "\_SB_.PC00.XHCI.RHUB.HS07-7:1.0-322e:202c".
# The libcamera package contains a program called "cam". With "cam -l"
# you get a list of cameras connected to your system.
# device = "camera name";
# When you see a lot of "camera stopped responding" etc. errors, add:
# timeout = 3.0;
# ... sometimes the rpi camera can be a tad slow.
# Using the "cam" program from libcamera, you can get a list of controls
# by invoking it with "--list-controls". They are also logged during
# start-up.
# controls = ({
# name = "contrast",
# data = "1.5";
# },
# {
# name = "brightness",
# data = "1.1";
# })
# Angle to rotate the picture with. In steps of 90 degrees.
# rotate-angle = 0;
# Retrieve a JPEG image from a specific URL, each interval/fps.
# type = "jpeg";
# url = "http://192.168.64.139/image.jpg";
# http-auth = "";
# Retrieve from PipeWire source.
# type = "pipewire";
# pw-id = ...id of the device (or -1)...;
# Check if a file in the filesystem
# type = "jpeg-file";
# path = "/home/pi/test.jpg";
# type = "rtsp";
# url = "rtsp://iprobocam.marmitek.com/mpeg4";
# Default is retrieve the rtsp stream over UDP. If you see a lot of
# garbage (or the camera does not respond at all over UDP), then you
# can switch tcp to true.
# tcp = true;
# descr = "an MJPEG source";
# type = "mjpeg";
# Use broken-mjpeg here if mjpeg doesn't work: you'll see a message "camera is down". In that case, try broken-mjpeg.
# url = "http://webcam.st-malo.com/axis-cgi/mjpg/video.cgi?resolution=352x288";
# descr = "an MPNG source";
# type = "mpng";
# url = "... some url ...";
# descr = "a plugin source";
# type = "plugin";
# source-plugin-file = "source-plugins/demo.so.0.1";
# source-plugin-parameter = "";
# descr = "source with a delay";
# type = "delay";
# # how many frames in the past. combined with max-fps this selects how many seconds in the past.
# n-frame = 12;
# # ID of the original source to delay
# delayed-source = "1-1";
# descr = "a pixelflood source";
# type = "pixelflood";
# listen-port = 5004;
# pp = "tcp-txt";
# -or-
# pp = "udp-bin";
# pixel-size = 1;
# descr = "an optionally cropped new source";
# type = "other-source";
# Which source to copy (from):
# other-id = "1-1";
# These 4 parameters are optional:
# cut-x = 100;
# cut-y = 100;
# cut-w = 400;
# cut-h = 250;
# You can also optionally rotate the image:
# rotate = 90;
# Angle can be 0, 90, 180 or 270 degrees.
# descr = "static image, for testing";
# type = "static";
# -1 is no limit
max-fps = -1.0;
# if all targets and http-servers want to use the resized picture, then
# resize it here at the source (for cpu efficiency)
# These values are number of pixels horizontal and vertical.
# This does not apply for the pixelflood source.
# -1 means: do not resize
resize-width = 640;
resize-height = 360;
# if the source is an https-URL with an invalid SSL certificate, then
# this switch lets you ignore that certificate
ignore-cert = true;
# Filters directly at the source-module apply to all consumers (like the
# http-servers, streamers, targets, etc).
filters = (
{
type = "v-mirror";
}
)
failure-handling = {
# mode, can be either "message" or "nothing". nothing returns a black image.
mode = "message";
# jpeg-image to show on the background (optional)
bitmap = "";
# message to show when the source fails
message = "Camera/video source down since %c";
# where to put the message
position = "center-center";
};
}
http-server = (
# You can have 0 or more HTTP servers. They must all listen on other
# adapter/port pairs that are also not used by other software on the
# system.
{
id = "1-2";
descr = "stream only, motion compatible";
# What IP-address/TCP port to listen on.
listen-adapter = "0.0.0.0";
listen-port = 8081;
# Set these to the filenames of the key/certificate file to enable
# enable https.
key-file = "";
certificate-file = "";
# File with a "message of the day" that will be shown on the main-
# menu page. Leave empty to omit.
motd = "";
# Path to the stylesheet.css-file in your local filesystem (e.g. not an
# URL). E.g. /usr/local/share/constatus/stylesheet.css
# This allows you to use your own stylesheet which may, for example, add
# a logo or so.
stylesheet = "stylesheet.css";
# Optional: authentication-method. Either none, file or pam.
# http-auth-method = "";
# This is required for method "file". The file is a text-file with 2
# lines: first is username, second is password.
# http-auth-file = "...";
# Use -1 for show all frames available (that would use more bandwidth).
# Value cannot be higher than the "max-fps" -setting in the source.
fps = 5.0;
# For JPEG-frames, set the quality. 100 = best, 0 = worst
quality = 75;
# For streams, maximum time (in seconds) before the connection is closed.
time-limit = -1;
# What to do if a frame is missing.
handle-failure = true;
# If you wish to resize the pictures, then you can do so with these
# parameters (-1 for disable).
resize-width = -1;
resize-height = -1;
# When enabled, then the HTTP-server will send HTTP-headers but without
# waiting for the full request. That is how motion did it at some point.
motion-compatible = true;
# When enabled, allows you to stop/start/etc services.
allow-admin = false;
# For web-access to the archive of recordings.
archive-access = false;
# Path to the recordings. Usually this is the same as the path used in
# the target(s) - see below.
snapshot-dir = "./";
# When enabled, also the sub-directories of snapshot-dir are given
# access to.
dir-with-subdirs = false;
# Each HTTP-server can have 0 or more filters.
filters = (
# The "text"-filter adds a text to the video stream.
# You can use the escapes as supported by "strftime" (see the man page).
# Other escapes:
# - $http-viewers$ number of viewers to the web server
# - $pixels-changed$ number of changed pixels as detected by the motion trigger
# - $motion$ replaced by a helpful text if any motion is detected
# - $descr$ replaced by the descr="" of the source
# - $id$ replaced by the id="" of the source
# - $fps$ is the moving average (over 5s) of the FPS of the current source
# - $exec:cmd$ invokes 'cmd' and replaces it with its output. cmd should
# output 1 line of text and stop immediately after that.
# - $file:path$ retrieves contents from file pointed to by 'path'
# - $ts$ time of frame, in microseconds since 1970
# Position can be lower/upper/center-left/center/right.
# Note that it uses an 8x8 font which, on larger resolutions is
# barebly readable. To work around that, use 'scaled-text' (see below).
{
type = "text";
text = "%c";
position = "lower-right";
},
# {
# Like "text" but with a specific font, size, RGB color and pixel-location.
# type = "scaled-text";
# text = "%c";
# Path to the font-file to use.
# The font-file in this example is from the fonts-freefont-ttf package.
# These texts have escapes. E.g. $Crrggbb$ sets the foreground color of the text
# that follows it. rrggbb are hexadecimal values. $u$ toggles underline and $i$
# toggles inverted background.
# font = "/usr/share/fonts/truetype/freefont/FreeSerif.ttf";
# Coordinate where to put the text. Use negative to use relative to the
# right/bottom.
# x = 123;
# y = 123;
# Maximum width of text (in pixels). Optional.
# w = 400;
# Size of text in pixels.
# font-size = 15;
# Draw a black box below the text.
# background = true;
# Defines the color to use. Default is white.
# r = 0;
# g = 0;
# b = 0;
# You can also set:
# rgb = "0,0,0";
# or:
# color = "yellow";
# (known colors are: red, blue, green, black, white, magenta, cyan, yellow).
# Wether to invert colors. Usefull when background color is not known on forehand.
# invert = false;
# What color to use for background (optional!). Use bg-color, bg-rgb or bg-r/bg-g/bg-b.
# Omit for no background color!
# # bg-rgb = "0,0,0";
# },
# This "filter" puts text over a video. For that it invokes the commandline
# given in "exec-what". Then the last "n-lines" are shown.
# {
# type = "exec-scroll";
# # here we follow some MQTT feed
# exec-what = "mosquitto_sub -h revspace.nl -t '#' -v";
# n-lines = 5;
# font = "/usr/share/fonts/truetype/freefont/FreeMono.ttf";
# font-size = 25;
# x = 25;
# y = 100;
# w = 1000;
# How fast to scroll horizontally, in pixels per iteration.
# horizontal = true;
# scroll-speed-h = 2;
# Defines the color to use. Default is white.
# color = "black";
# invert = false;
# }
# external filter plugin
# {
# type = "filter-plugin";
# # filename
# file = "filter-plugins/demo.so.0.1";
# # any parameter for the plugin
# par = "";
# },
# frei0r filter plugin
# {
# type = "filter-plugin-frei0r";
# file = "/usr/lib/frei0r-1/sharpness.so";
# pars = "";
# },
# horizontal mirror
# {
# type = "h-mirror";
# },
# vertical mirror
{
type = "v-mirror";
}
# Convert an image to gray scale.
# {
# type = "grayscale";
# },
# Noise-filter
# {
# type = "neighbour-noise-filter";
# },
# Boosts the contrast
# {
# type = "boost-contrast";
# },
# Place a PNG image over the recorded video
# {
# type = "overlay";
# picture = "overlay-test.png";
# x = 10;
# y = 10;
# Instead of x/y coordinates, you can also set a 'position' here:
# # position = 'upper-left';
# },
# Place an (animated) GIF or MNG image over the recorded stream
# {
# type = "gif-overlay";
# picture = "overlay-test.gif";
# x = 10;
# y = 10;
# # position = 'upper-left';
# },
# Mask of anything not in the masking bitmap (for e.g. privacy).
# selection-bitmap must a pbm file or a (black & white-) png file.
# {
# type = "apply-mask";
# selection-bitmap = "bitmap.pbm";
# When soft-mask is enabled, the masked-off parts are replaced by the average
# color of the masked part. Else, it is replaced by black.
# soft-mask = false;
# },
# Draw a box with a certain color. Can also be used for privacy masking but
# without the need of a bitmap-file.
# {
# type = "draw";
# x = 10;
# y = 10;
# w = 20;
# h = 15;
# rgb = "0,0,0";
# },
# Show only the parts that have moved.
# {
# type = "motion-only";
# # bitmap is optional, set to "" to omit
# selection-bitmap = "bitmap.pbm";
# noise-factor = 32;
# },
# Draw a box around the movements.
# {
# type = "marker";
# Red, red-invert, invert or color.
# mode = "invert";
# When mode is "color", set the red, green and blue values with this parameter:
# pixels-color = "255,255,0";
# Box, cross, circle or border.
# marker-type = "box";
# Thickness of marker.
# thick = 5;
# selection-bitmap = "bitmap.pbm";
# noise-factor = 32;
# What %% of pixels need to be changed before the marker is drawn
# pixels-changed-percentage = 1.6;
# Set to true when you want to use the "bitmap"-filter with "$motion-box$".
# remember-motion = false;
# },
# Chroma-keying ("green screen")
# {
# type = "chroma-key";
# # green will be replaced by the video-source
# # from an other instance. select that instance
# # here.
# replace-by = "some other instance";
# }
# This makes a copy of a certain part of the incoming stream. It can be pasted using
# "bitmap", see below. Copies are rememberd under the name as configured by
# "rembember-as".
# {
# type = "copy";
# remember-as = "$window$";
# x = 0;
# y = 0;
# w = 25;
# h = 20;
# }
# Put a bitmap stored elsewhere in the current stream. A "paste" function.
# E.g. "$motion-box$" from "marker" (set "remember-motion" to true in filter "marker")
# or from "copy".
# {
# type = "paste";
# which = "$motion-box$";
# x = 0;
# y = 0;
# },
# Starts an LCDPROC server which is then overlayed over the video stream.
# {
# type = "lcdproc";
# Network interface to listen on.
# listen-adapter = "0.0.0.0";
# Select a font to use. Best results with monospaced fonts.
# font = "/usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf";
# Coordinates to place the result
# x = 1;
# y = 1;
# Dimensions of the result.
# w = 1278;
# h = 718;
# "Virtual LCD panel dimensions", e.g. how many characters are visible per row.
# n-col = 40;
# n-row = 10;
# Text-color. Default is white.
# r = 0;
# g = 0;
# b = 0;
# Wether to invert colors. Usefull when background color is not known on forehand.
# invert = false;
# Switch interval. When to switch between "screens". In milliseconds.
# switch-interval = 3500;
# # 3500 = 3.5 seconds
# }
);
# Constatus can stream some meta-data to the web-interface. Currently (v4.3)
# that are "motion detected" messages and addresses of people starting to
# what a stream (or stopping to do that).
# For this it needs a websocket. With the following line you can configure
# on which port it should listen.
websocket-port = 4000;
# If Constatus is behind a proxy (like nginx or apache), the URL via which
# the websocket is reachable may be different from the one on which the
# program is running. In that case you can configure that URL here.
# websocket-url = "ws://bla:123/blip";
# The websocket interface can be useful to see immediate notifications when
# motion is detected. But the notifications of addresses of people starting
# to follow a stream may not be. If you *don't* want to see those, set this
# parameter to 'true'.
websocket-privacy = true;
},
{
id = "1-3";
descr = "admin interface";
listen-adapter = "0.0.0.0";
listen-port = 8082;
fps = 5.0;
quality = 75;
time-limit = -1;
resize-width = -1;
resize-height = -1;
motion-compatible = false;
allow-admin = true;
archive-access = true;
snapshot-dir = "./";
filters = (
{
type = "text";
text = "my webcam $http-viewers$ $pixels-changed$";
position = "upper-left";
},
{
type = "text";
text = "%c";
position = "lower-right";
}
);
}
);
# these plugins can be used to store specific meta-data in
# generated files. you can let them generate e.g. $bla$
# escapes which you then can use in the add-text filter.
#meta-plugin = (
# {
# plugin-file = "meta-plugins/gps.so.0.1";
# plugin-parameter = "localhost 2947";
# }
#)
motion-trigger = (
{
id = "1-4";
descr = "motion trigger(s)";
# If the "source" supports pan/tilt, then enabling this will make it
# pan/tilt the camera depending on the movements.
# This can be set for multiple "motion-trigger"s of one source, but
# that may not work very well of course.
pan-tilt = true;
# Remember the first picture that triggered the motion. Store this as
# a macro $...$ (see "copy" and "paste" below). Leave empty ("") to
# disable.
remember-trigger = "$trigger$";
# While motion is detected, each pixel is first converted to grayscale.
# Then the difference with the previous recording is calculated.
# If the difference is bigger than the noise-factor, then the pixel is
# counted...
noise-factor = 32;
# ..., then if the total number of pixels is >= the percentage of the
# pixels selected by pixels-changed-percentage, then motion is
# considered to be detected
min-pixels-changed-percentage = 0.6;
# unless more pixels have changed than this setting.
# E.g. for preventing a lightswitch triggering the detection.
max-pixels-changed-percentage = 80.0;
# Note that these three parameters are not used when the motion trigger
# plugin is selected.
# If the motion has stopped, how many frames to record extra. A better
# name would have been "post motion record duration".
min-duration = 15;
# How many frames to ignore all motion after the previous event has
# stopped.
mute-duration = 5;
# How many frames to record and store before the motion has started.
pre-motion-record-duration = 15;
# How many frames should have motion before recording starts.
min-n-frames = 1
# At startup, how many frames to ignore before detecting motion.
warmup-duration = 10;
# Limit the number of frames per second to process. Set to -1 to
# disable.
max-fps = -1.0;
# One can use external plugins for detecting motion.
trigger-plugin-file = "";
trigger-plugin-parameter = "";
# A pgm file to mask which parts of the video frames to analyze.
selection-bitmap = "";
# Despeckle filter.
# d = dilate (kernel size of 5, D is kernel size 9)
# e = erode (kernel size of 5, E is kernel size 9)
despeckle-filter = "dEeD";
# Zero or more filters that are applied before the frames are analyzed.
# Use filters to remove noise or despeckle etc. Using a filter that
# adds texts or whatever may give/gives false positives. It is advised
# to use e.g. neighbour-noise-filter, grayscale, average and/or boost-
# contrast. To add other effects, add them to the filter() in the e.g.
# targets-section.
filters-detection = ( );
# Programs to invoke when motion starts/stops. Leave empty ("") when not required.
exec-start = "";
exec-end = "";
# You can let a motion-trigger also listen to an other motion-trigger.
# That way multiple cameras can be triggered to all start recording when
# one gets notified.
# Leave empty to not connect!
motion-source = "some-other-instance";
# Schedule for when to detect motion. Remove to always detect.
# This example detects on wednesday between 11:00:05 and 12:00:00
# and 19 and 20 o'clock and also the whole thursday.
schedule = ( "wed,11:00:05,12:00,on",
"wed,19:00,20:00,on",
"wed,19:22:00,19:22:10,off"
"thu,00:00:00,23:59:60,on"
)
# Targets are the services that stream the frames to a disk-file or a network
# service. See the section "targets" below for an explanation.
targets = (
{
id = "1-5";
descr = "motion output";
path = "./";
prefix = "motion-all-";
quality = 75;
restart-interval = 86400;
fps = 5.0;
override-fps = -1.0;
format = "avi";
stream-writer-plugin-file = "";
stream-writer-plugin-parameter = "";
exec-start = "";
exec-cycle = "";
exec-end = "";
schedule = ( )
# %p prefix
# %Y year, %m month (number), %d day
# %H hour, %M minute, %S seconds, %u microseconds
# %q recording-number
# %t camera id, %$ camera name
# %{host} system hostname
# %[key] replace by meta-element 'key'
fmt = "%p%Y-%m-%d_%H-%M-%S.%u_%q";
filters = (
{
type = "text";
text = "my webcam $http-viewers$ $pixels-changed$";
position = "upper-left"
},
{
type = "text";
text = "%c";
position = "lower-right"
}
)
}
)
}
)
# when a "source" has also audio recording capabilities, then that can be
# monitored. when the audio reaches a certain level, it can trigger the
# video-recording (see "motion-trigger" above). audio is processed in
# samples of 0.1s
audio-trigger = {
id = "1-5";
descr = "audio trigger";
# threshold to see if what we record is noise
# or real sound. the range is 0...32767
threshold = 350;
# if this many samples had a level above the
# threshold, then the (video-)motion-trigger(s)
# will be triggered to start recording
min-n-triggers = 25;
# ids of the video-triggers to trigger (comma
# seperated)
trigger-ids = "1-4";
}
# A service that writes the video stream that is recorded
# to disk or a network service.
targets = (
# You can have 0 or more of these.
{
id = "1-6";
descr = "write everything to disk";
# Path to store the recordings in.
path = "./";
# Prefix for the filename.
prefix = "all-";
# In case of JPEG, quality of the compression. 100 is best, 1 is worst.
quality = 75;
# Split the file every restart-interval seconds.
restart-interval = 86400;
# If the source has no frame available but it was expected, this setting
# sets if it should handle the error with a message or not (see 'failure'
# definition in the source definition).
handle-failure = true;
# Limit a recording to this number of frames per second.
# You can also use "interval = ..." here (which is 1.0 / fps). Using
# interval allows you to create timelapse videos.
fps = 5.0;
# You can make files play faster by setting a value > 0 here. In this
# example constatus will record 5 frames per second but the result will
# play at 10fps and thus twice as fast.
override-fps = 10.0;
# Output format.
format = "avi";
# Can be:
# - avi: (which is MJPEG underneath - uses gstreamer)
# - gwavi: (also produces MJPEG 'avi-files' but doesn't need
# gstreamer, just libgwavi)
# - ffmpeg: use ffmpeg to compress the data. all format supported
# by ffmpeg can be used. requires the following extra parameters:
# ffmpeg-type = "flv";
# ffmpeg-parameters = "";
# ffmpeg-type would be something like "mp4", "flv", etc.
# bitrate: how many bits per second to write. Depends on the
# codec, the resolution and the fps.
# - plugin: use an external plugin to store the data
# stream-writer-plugin-file = "";
# stream-writer-plugin-parameter = "";
# - extpipe: send a YUV420 stream to a pipe
# requires an extra parameter "cmd", e.g.:
# cmd : "mencoder -demuxer rawvideo -rawvideo w=%w:h=%h:fps=%fps -ovc x264 -x264encopts preset=ultrafast -of lavf -o %f.mp4 - -fps %fps";
# - jpeg: store each frame as a seperate file
# useful for snapshots. e.g. remove fps=... and set interval=... and then set format="jpeg"
# - pipewire: send each frame to a pipewire server
# comparable to 'video-loopback'
# - vnc: VNC video stream
# requires two extra parameters:
# listen-adapter = "0.0.0.0";
# listen-port = 5901;
# - pixelflood
# requires a couple of extra parameters:
# host = "0.0.0.0";
# port = 5004;
# dimensions of the pixelflood server:
# pf-w = 128;
# pf-h = 16;
# offset in the pixelflood server:
# x-off = 128;
# y-off = 16;
# pixelflood version:
# pp = "tcp-txt" the protocol version that accepts "PX x y rrggbb\n" via a TCP socket
# pp = "udp-bin" the protocol version that accepts a binary packet via a UDP socket
# - as-a-new-source
# This exports the video-stream AFTER filters have been applied
# (and resizing has been performed) as a new source.
# requires two extra parameters:
# new-id = "some-id";
# new-descr = "this is visible in the web-interface";
# rotate picture 90 degrees?
# rot90 = false;
# - gstreamer
# Feed the video stream to a gstreamer pipeline.
# pipeline = "appsrc name=\"constatus\" ...";
# Note that Constatus pushes RGB frames into the pipeline.
# Scripts to invoke at the start, at the end or when the file is
# rotated (exec-cycle).
exec-start = "";
exec-cycle = "";
exec-end = "";
# Filters to apply. See descriptions at the http-server section.
filters = (
{
type = "text";
text = "%c";
position = "lower-right"
}
)
}
)
# Constatus can "loop back" the video data back into
# the Linux kernel so that other applications can monitor
# the same source as well (see also 'pipewire' target).
#video-loopback = {
# device to loopback to
# device = "/dev/video2";
# Select the pixel format.
# Firefox wants YUV420. Other values are RGB24 and YUYV.
# pixel-format = "YUV420";
# Limit the frame rate to this, -1.0 to disable.
# fps = 15.0;
# Any filters you want to apply before the video data
# streams into the loopback device.
# filters = (
# )
#};
}
# , {
# source = {
# id = "3-1";
# ...
# }
#
# etc
#
# }
)
# as everything in constatus, these are optional
global-http-server = (
# global web-interface
# gives access to all instances
{
id = "2-1";
descr = "global admin interface";
listen-adapter = "0.0.0.0";
listen-port = 8070;
fps = 5.0;
quality = 75;
time-limit = -1;
resize-width = -1;
resize-height = -1;
motion-compatible = false;
allow-admin = true;
archive-access = true;
snapshot-dir = "./";
key-file = "";
certificate-file = "";
# allow rest-calls to be executed
# if you want e.g. controls, then enable this
is-rest = true;
filters = (
{
type = "text";
text = "$descr$";
position = "lower-left";
},
{
type = "text";
text = "%c";
position = "upper-left";
},
{
type = "text";
text = "$motion$";
# either upper-right/left/center, center-right/left/center or lower-right/left-center,
# xy:x,y or axy:x,y
# e.g. xy:123,45
# xy: negative values are wrapped to the right/bottom
# axy: image below 0 is cropped
position = "upper-right";
}
)
},
{
id = "2-2";
descr = "rest interface";
listen-adapter = "0.0.0.0";
listen-port = 8071;
fps = 5.0;
quality = 75;
time-limit = -1;
resize-width = -1;
resize-height = -1;
motion-compatible = false;
allow-admin = true;
archive-access = true;
snapshot-dir = "./";
filters = ();
}
)
# Comment out if you don't want a history-database and no
# automatic cleaning and such. It is also used for the dashboard
# functionality.
maintenance = {
# URL of the MySQL database. Database must exist.
# User must have rights to create tables. When the tables have
# been set-up, read/write/update/delete rights are enough.
db-url = "tcp://ipaddress/nameofdatabase";
db-user = "...";
db-pass = "...";
# keep recorderd files 14 days, set to -1 to disable purge
keep-max = 14;
# Clean-up every 300 seconds, set to -1 to disable.
clean-interval = 300;
# Constatus can easily be monitored. For that it has a nagios
# 3 and 4 compatible NRPE service.
# E.g.:
# /usr/lib/nagios/plugins/check_nrpe -H localhost -4 -n -c '1-1'
# ...would check the status of a module with id "1-1".
# /usr/lib/nagios/plugins/check_nrpe -H localhost -4 -n -c '%ALL%'
# ...will check all modules in the Constatus system for problems.
# Comment out (or set to -1) to disable.
# Note that you will need the "-n" flag for check_nrpe to disable
# TLS.
nrpe-service = 5666;
# you can bind the service to a specific adapter
# nrpe-service-adapter = "::1";
}
# display using http://host:port/view-view?id=...
# This needs a global-http-server to be enabled. Also the filters to be
# applied are configured in the global-http-server.
# The html-types cannot have "targets".
#views = ({
# id = "view-1";
# type = "html-grid";
# descr = "HTML grid view";
# # number of columns of streams
# grid-width = 2;
# # number of rows of streams
# grid-height = 1;
# # use -1 for automatic
# width = 1280;
# height = 800;
# # id's of sources to display
# sources = ( { id="1-1"; }, { id="3-1"; } )
# },
# {
# id = "view-2";
# type = "source-switch";
# descr = "switching between sources";
# # use -1 for automatic
# width = 1280;
# height = 800;
# # id's of sources to display
# sources = ( { id="1-1"; }, { id="3-1"; } )
# switch-interval = 5.0;
# # this option is for source-switch only
# auto-shrink = true;
# # targets are extra. a view is visible in the
# # global http-server but source-switchers can
# # also store the stream to e.g. a file. this
# # is optional.
# targets = (
# {
# id = "view-2-1";
# descr = "view output";
# path = "./";
# prefix = "view-";
# quality = 75;
# restart-interval = 86400;
# fps = 5.0;
# override-fps = -1.0;
# format = "avi";
# filters = ( )
# }
# )
# # views of type 'source-switch' and 'all' can send
# # the result to the loopback device
# # video-loopback = {
# # device = "/dev/video2";
# # pixel-format = "YUV420";
# # fps = 15.0;
# # filters = (
# # )
# # };
# },
# {
# id = "view-3";
# type = "all";
# descr = "all sources in 1 grid";
# width = 640;