-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.ini
189 lines (172 loc) · 7.95 KB
/
app.ini
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
; vim: textwidth=85
; [video_capture] section is required and contains input device parameters:
; - filename - required input file url. Accepts the same syntax as
; https://ffmpeg.org/ffmpeg.html#Video-and-Audio-file-format-conversion
; - file_format - optional input file format. Has the same meaning as '-f' option in
; ffmpeg program https://ffmpeg.org/ffmpeg.html#Main-options
; For the list of supported devices, protocols and their options see `man
; ffmpeg-devices`, ffmpeg-formats and ffmpeg-protocols.
[video_capture]
filename = /dev/video0
file_format = v4l2
; [video_capture.demuxer_options] is optional section and contains demuxer specific
; options.
; For the list of supported webcam options run 'ffmpeg -hide_banner -f v4l2 -list_formats
; all -i /dev/videoN'
[video_capture.demuxer_options]
video_size = 1280x720
framerate = 30
input_format = mjpeg
; Example with rtsp stream:
# [video_capture]
# filename = rtsp://localhost:5000/
# [video_capture.demuxer_options]
# rtsp_transport = tcp
; [video_capture.video_decoder] is optional section with video decoder specific
; parameters.
; - hw_type - is optional string with hardware acceleration method. For the list of
; available methods see `ffmpeg -hide_banner -hwaccels` and AVHWDeviceType enum doc
; https://ffmpeg.org/doxygen/trunk/hwcontext_8h.html#acf25724be4b066a51ad86aa9214b0d34
[video_capture.video_decoder]
hw_type = vaapi
; [output_files] section is required and contains output video files settings:
; - prefix - required path to a folder where to put recorded video files with motion.
; Can be empty. In this case current working dir will be used. Date subfolder will be
; created inside the prefix folder with the ISO 8601 format "%Y-%m-%d". Output files
; will be created inside the date subfolder with a name in local format "%H.%M.%s"
; with fractional seconds + extension. For example: 2023-07-26/18.16.25.876914.mp4
; - extension - required format of generated files. Video files are recorded with
; codec specified in [output_files.video_encoder] section and AAC audio codec;
; - video_bitrate - optional bitrate of a recorded video stream. Can accept either
; numerical value or string representation as '-b:v' option in ffmpeg. See
; https://ffmpeg.org/ffmpeg.html#Options
; - audio_bitrate - optional bitrate of an output audio streams. Has the same meaning
; as '-b:a' option in ffmpeg.
[output_files]
prefix = /tmp/videos
extension = .mkv
video_bitrate = 10M
audio_bitrate = 128K
; [output_files.video_encoder] is optional section with video encoder settings.
; - codec_name - is optional string with encoder name. For the list of supported
; encoders run `ffmpeg -hide_banner -encoders`. Default is 'libx264'.
; - hw_type - is optional string with hardware acceleration method.
# Example with vaapi:
#[output_files.video_encoder]
#codec_name = h264_vaapi
#hw_type = vaapi
# Example with cuda:
# [output_files.video_encoder]
# codec_name = h264_nvenc
# hw_type = cuda
# Example with software libx264:
[output_files.video_encoder]
codec_name = libx264
; [output_files.video_encoder.private_options] is optional section with private
; options for the chosen encoder. See `man ffmpeg-codecs` and `ffmpeg -h
; encoder=h264` and `x264 -h`.
# Example options for libx264:
[output_files.video_encoder.private_options]
preset = ultrafast
tune = zerolatency
; https://support.google.com/youtube/answer/1722171?hl=en
; Max consecutive B frames
bf = 2
; GOP size
g = 15
; Closed GOP
flags = +cgop
; [logging] section is optional:
; - app_level, ffmpeg_level - optional strings. Can be one of {trace, debug,
; info, warning, error, fatal}. Defaults are info and warning respectively.
; - show_timestamp - optional bool. Default is true. Use it to hide timestamps from
; log messages.
[logging]
app_level = info
ffmpeg_level = info
show_timestamp = true
; [segmentation.background_subtractor] section is required and specifies background
; segmentation algorithm and its parameters:
; - algorithm is required. Must be one of a {KNN, MOG2}.
;
; Alternative if algorithm = MOG2:
; https://docs.opencv.org/4.5.5/de/de1/group__video__motion.html#ga2beb2dee7a073809ccec60f145b6b29c
; - history is optional positive int. Default is 500. Specifies the number of
; last frames that affect the background model.
; - var_threshold is optional positive double. Default is 16.0. Denotes
; threshold on the squared Mahalanobis distance between the pixel and the model
; to decide whether a pixel is well described by the background model.
; - detect_shadows is optional bool. Default is false. If true, the algorithm
; will detect shadows and mark them. Note that it decreases the speed a bit.
[segmentation.background_subtractor]
algorithm = MOG2
history = 500
var_threshold = 16.0
detect_shadows = false
; Alternative if algorithm is KNN:
; https://docs.opencv.org/4.5.5/de/de1/group__video__motion.html#gac9be925771f805b6fdb614ec2292006d
; - history is optional positive int. Default is 500. Specifies the number of
; last frames that affect the background model.
; - dist_2_threshold is optional positive double. Default is 400.0. Denotes the
; threshold on the squared distance between the pixel and the sample to decide
; whether a pixel is close to that sample.
; - detect_shadows has the same meaning as in MOG2.
# [segmentation.background_subtractor]
# algorithm = KNN
# history = 500
# dist_2_threshold = 400.0
# detect_shadows = false
; [segmentation] section is optional and contains various parameters affecting
; sensitivity of detection:
; - min_moving_area - optional non negative integer numer of nonzero pixels in a
; foreground mask generated by a background subtractor. Specifies minimum sensitivity
; of what to consider a motion. Default is 500;
; - delta_without_motion - optional non negative floating number of seconds to
; capture after motion is no longer detected (when current_moving area <
; min_moving_area). Use it to decrease motion sensitivity. Default is 5 s.
[segmentation]
min_moving_area = 500
delta_without_motion = 5.0
; [preprocess] section is optional.
; - convert_to_gray - optional bool. Default is false. When true converts 3-channel
; input images to 1 channel. Use it to improve speed of the background_subtractor
; algorithm.
; - resize_factor - optional positive double. If present it resizes input images by
; specified factor in each direction before passing them to the smoothing filter
; below (if any). Use it to improve speed of the background_subtractor algorithm.
[preprocess]
convert_to_gray = true
resize_factor = 0.5
; [preprocess.smoothing] section is optional. It applies smmothing filter after
; optional resizing step and immediately before appying background_subtractor to
; reduce input noise.
; - algorithm is required. It must be one of the {normalized_box, gaussian, median}
;
; Alternative if algorithm = normalized_box:
; https://docs.opencv.org/4.5.3/d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37
; This filter takes the average of all the pixels under the kernel. This is the
; simplest of three filters.
; - kernel_size is required positive int.
[preprocess.smoothing]
algorithm = normalized_box
kernel_size = 11
; Alternative if algorithm = gaussian:
; https://docs.opencv.org/4.5.3/d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1
; This filter uses Gaussian kernel.
; - kernel_size is required positive odd int.
; - sigma is optional non negative double. Denotes Gaussian kernel standard
; deviation in both X and Y directions. 0.0 is a special value which means it
; will be computed to some default value.
# [preprocess.smoothing]
# algorithm = gaussian
# kernel_size = 11
# sigma = 0
; Alternative if algorithm = median:
; https://docs.opencv.org/4.5.3/d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9
; Non-linear filter which takes the median of all the pixels under the kernel
; area and the central element is replaced with this median value. This is the
; slowest of three filters.
; - kernel_size is required odd integer greater than 2.
# [preprocess.smoothing]
# algorithm = median
# kernel_size = 11