You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`/alert_on_cam_*`| Enable Alert (Alarm) mode. It means it will send respective alert to your account in Telegram |
220
-
|`/alert_off_cam_*`| Disable Alert (Alarm) mode, no alerts will be sent when something detected |
219
+
|`/alert_on_cam_*`| Enable Alert (Alarm) mode. It means it will send a respective alert to your account in Telegram |
220
+
|`/alert_off_cam_*`| Disable Alert (Alarm) mode, no alerts will be sent when something is detected |
221
221
|`/yt_on_cam_*`| Enable YouTube stream |
222
222
|`/yt_off_cam_*`| Disable YouTube stream |
223
223
|`/icecast_on_cam_*`| Enable Icecast stream |
224
224
|`/icecast_off_cam_*`| Disable Icecast stream |
225
225
226
-
`*` - camera digit id, e.g. `cam_1`.
226
+
`*` - camera digit id e.g.,`cam_1`.
227
227
228
228
# Advanced Configuration
229
229
## SRS
230
-
[SRS](https://github.com/ossrs/srs/tree/4.0release) (Simple Realtime Server) is a re-stream server which takes a stream from your camera and re-streams it
231
-
to any destination without touching native camera stream multiple times.
232
-
SRS release version used in the bot is `4.0`.
230
+
[SRS](https://github.com/ossrs/srs/tree/4.0release) (Simple Realtime Server) is a re-stream server that takes a stream from your camera and re-streams it
231
+
to any destination without touching the native camera stream multiple times.
232
+
The SRS release version used in the bot is `4.0`.
233
233
234
234
SRS decreases CPU time and network load on the camera when you enable something like DVR,
235
235
YouTube Livestream or try to get Video GIF at the same time. Pictures are taken
236
236
directly from the camera stream, not from the SRS.
237
237
238
238
How it works - if you have two cameras with enabled SRS for both, there will be two
239
239
running 24/7 bot tasks taking streams from the cameras to the SRS server. Eventually, when you
240
-
request Video Gif, or it's triggered by some alert, video will be taken from SRS server.
240
+
request Video Gif, or it's triggered by some alert, the video will be taken from the SRS server.
241
241
242
-
You can also connect to SRS server with any video player like VLC and watch the stream
242
+
You can also connect to the SRS server with any video player like VLC and watch the stream
243
243
without any interruptions. URL looks like this: `rtmp://192.168.1.100/live/livestream_101_cam_2`,
244
244
where:
245
245
1. `192.168.1.100` is an IP address or a host of your server.
246
-
2. `101` is camera's configured stream channel.
247
-
3. `cam_2` is ID of your second configured camera.
246
+
2. `101` is the camera's configured stream channel.
247
+
3. `cam_2` is the ID of your second configured camera.
248
248
249
249
SRS runs in a separate docker container. SRS config and `Dockerfile` are placed
250
-
in`srs_prod` directory. Service name is `hikvision-srs-server`in`docker-compose.yml`.
250
+
inthe `srs_prod` directory. The service name is `hikvision-srs-server`in`docker-compose.yml`.
251
251
252
252
253
253
254
254
If `docker-compose.yml` is a list of forwarded and open SRS ports to the world:
255
255
```yaml
256
256
# If you don't plan to use anything from this, just comment out the whole section.
257
257
ports:
258
-
- "1935:1935"# SRS RTMP port, if you comment this out, you won't be able to connect with video player
258
+
- "1935:1935"# SRS RTMP port, if you comment this out, you won't be able to connect with the video player
259
259
- "1985:1985" # SRS API port, can be commented out since not used
260
260
- "8080:8080" # SRS WebUI port
261
261
```
262
262
263
263
## DVR
264
-
You can record your videos from the camera to a local storage mounted as volume in
264
+
You can record your videos from the camera to local storage mounted as a volume in
265
265
volumes section of `hikvision-camera-bot` service in`docker-compose.yml`.
266
266
267
267
DVR configuration is per camera in`config.json` with livestream template name from `livestream_templates.json`.
268
268
269
269
It's very simple:
270
-
1. Use `enabled` key to turn on/off this feature.
270
+
1. Use the `enabled` key to turn on/off this feature.
271
271
2. `local_storage_path` is a path inside the container to which videos will be recorded.
272
272
Don't change this default value (`/data/dvr`) since it's written in the volumes mapping section.
273
-
If you need to change it for some reason - you need to change both here and in the volumes mapping.
273
+
If you need to change it for some reason - you must change it both here and in the volumes mapping.
274
274
3. `livestream_template` has a template name located inside the `livestream_templates.json`
275
275
file with DVR stream settings:
276
276
```json
@@ -284,11 +284,11 @@ file with DVR stream settings:
284
284
}
285
285
}
286
286
```
287
-
a) `segment_time` is time in seconds when DVR record file will be split to a new one.
287
+
a) `segment_time` is the time in seconds when the DVR record file will be split into a new one.
288
288
289
289
b) `1800` seconds mean every file will have 30 minutes of video recording.
290
290
291
-
c) File is named as `cam_1_101_1800_2022-04-15_21-19-32.mp4` with cam ID, channel name, segment time, and record start datetime.
291
+
c) File is named `cam_1_101_1800_2022-04-15_21-19-32.mp4` with cam ID, channel name, segment time, and record start datetime.
292
292
293
293
4. Configuration part from the `config.json`:
294
294
```json
@@ -308,12 +308,12 @@ file with DVR stream settings:
308
308
}
309
309
}
310
310
```
311
-
Recorded files can be uploaded to Telegram group. Right now upload will work only
312
-
if `delete_after_upload` is set to `true` meaning uploaded file will be deleted
311
+
Recorded files can be uploaded to the Telegram group. Right now, the upload will work only
312
+
if `delete_after_upload` is set to `true` meaning the uploaded file will be deleted
313
313
from the local storage. You need to make sure your file size will be up to 2GB since
314
314
Telegram rejects larger ones. Just experiment with segment time.
315
315
5. Local storage (the real one, not in the container) by default is `/data/dvr` in volumes mapping (the first path string, not the last).
316
-
Change it to any location you need, e.g. to `- "D:\Videos:/data/dvr"` if you're on Windows.
316
+
Change it to any location you need e.g., `- "D:\Videos:/data/dvr"` if you're on Windows.
317
317
```yaml
318
318
volumes:
319
319
- "/data/dvr:/data/dvr"
@@ -332,22 +332,22 @@ To enable YouTube Live Stream enable it in the `youtube` key.
332
332
333
333
**Livestream templates**
334
334
335
-
To start particular livestream, user needs to set both *livestream* and
335
+
To start a particular livestream, a user needs to set both *livestream* and
336
336
*encoding* templates with stream settings and encoding type/arguments.
337
337
338
338
Encoding templates
339
339
340
-
`direct` means that video stream will not be re-encoded (transcoded) and will
340
+
`direct` means that the video stream will not be re-encoded (transcoded) and will
341
341
be sent to YouTube/Icecast servers "as is", only audio can be disabled.
342
342
343
-
`x264` or `vp9` means that video stream will be re-encoded on your machine/server
344
-
where bot is running using respective encoding codecs.
343
+
`x264` or `vp9` means that the video stream will be re-encoded on your machine/server
344
+
where the bot is running using respective encoding codecs.
345
345
346
-
User can create its own templates in file named `livestream_templates.json`
346
+
User can create their templates in a file named `livestream_templates.json`
347
347
and `encoding_templates.json`.
348
348
349
-
Default dummy template file is named `livestream_templates_template.json`
350
-
(not very funny name but anyway) which should be copied or renamed to
349
+
The default dummy template file is named `livestream_templates_template.json`
350
+
(not a very funny name but anyway) which should be copied or renamed to
351
351
`livestream_templates.json`.
352
352
353
353
Same for`encoding_templates-template.json` ->`encoding_templates.json`
@@ -411,7 +411,7 @@ Where:
411
411
412
412
| Parameter | Value | Description |
413
413
|---|---|---|
414
-
|`channel`|`101`| camera channel. 101 is main stream, 102 is substream. |
414
+
|`channel`|`101`| camera channel. 101 is the main stream, and 102 is the substream. |
415
415
|`restart_period`|`39600`| stream restart period in seconds |
416
416
|`restart_pause`|`10`| stream pause before starting on restart |
417
417
|`url`|`"rtmp://a.rtmp.youtube.com/live2"`| YouTube rtmp server |
0 commit comments