Skip to content

Commit

Permalink
Version 1.4. Details in /releases/release_1.4.md (#43)
Browse files Browse the repository at this point in the history
Version 1.4. Details in /releases/release_1.4.md
  • Loading branch information
tropicoo authored Apr 29, 2022
1 parent f2e6a6f commit a7108c0
Show file tree
Hide file tree
Showing 81 changed files with 2,867 additions and 2,017 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-alpine
FROM python:3.10-alpine

RUN apk add --no-cache \
ffmpeg \
Expand Down
62 changes: 43 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Hikvision Telegram Camera Bot
Telegram Bot which sends snapshots from your Hikvision cameras.

Version: 1.3. [Release details](releases/release_1.3.md).
Version: 1.4. [Release details](releases/release_1.4.md).

## Features
1. Send full/resized snapshots on request
Expand Down Expand Up @@ -41,8 +41,8 @@ Configuration files are stored in JSON format and can be found in `configs` dire
1. Put the obtained `api_id` and `api_hash` strings to same keys
2. Put the obtained bot API token string to `token` key
3. [Find](https://stackoverflow.com/a/32777943) your Telegram user id
and put it to `allowed_user_ids` list as integer value. Multiple ids can
be used, just separate them with a comma
and put it to `chat_users`, `alert_users` and `startup_message_users` lists as
integer value. Multiple ids can be used, just separate them with a comma.
4. Hikvision camera settings are placed inside the `camera_list` section. Template
comes with two cameras

Expand All @@ -64,7 +64,15 @@ Configuration files are stored in JSON format and can be found in `configs` dire
"api_hash": "1a1a1a1a1a1a1a1a",
"lang_code": "en",
"token": "1b1b1b1b1b1b1b1b",
"allowed_user_ids": [
"chat_users": [
1010101010,
2020202020
],
"alert_users": [
1010101010,
2020202020
],
"startup_message_users": [
1010101010,
2020202020
]
Expand All @@ -75,6 +83,7 @@ Configuration files are stored in JSON format and can be found in `configs` dire
"hidden": false,
"description": "Kitchen",
"hashtag": "kitchen",
"group": "Default group",
"api": {
"host": "http://192.168.1.1",
"auth": {
Expand All @@ -83,30 +92,45 @@ Configuration files are stored in JSON format and can be found in `configs` dire
},
"stream_timeout": 10
},
"alert": {
"delay": 15,
"video_gif": {
"enabled": true,
"rtsp_port": 554,
"video_gif": {
"on_demand": {
"channel": 101,
"record_time": 10,
"rewind_time": 10,
"tmp_storage": "/tmp",
"loglevel": "error",
"rtsp_transport_type": "tcp"
},
"on_alert": {
"channel": 101,
"record_time": 10,
"rewind_time": 10,
"rewind": true,
"tmp_storage": "/tmp",
"loglevel": "error",
"rtsp_transport_type": "tcp"
}
},
"alert": {
"delay": 15,
"motion_detection": {
"enabled": true,
"enabled": false,
"sendpic": true,
"fullpic": true
"fullpic": false,
"send_videogif": true
},
"line_crossing_detection": {
"enabled": true,
"enabled": false,
"sendpic": true,
"fullpic": true
"fullpic": false,
"send_videogif": true
},
"intrusion_detection": {
"enabled": true,
"enabled": false,
"sendpic": true,
"fullpic": true
"fullpic": false,
"send_videogif": true
}
},
"livestream": {
Expand All @@ -121,7 +145,7 @@ Configuration files are stored in JSON format and can be found in `configs` dire
"encoding_template": "direct.kitchen_telegram"
},
"srs": {
"enabled": true,
"enabled": false,
"livestream_template": "tpl_kitchen",
"encoding_template": "direct.kitchen_srs"
},
Expand Down Expand Up @@ -408,7 +432,7 @@ Where:
"x264": {
"kitchen": {
"null_audio": false,
"loglevel": "quiet",
"loglevel": "error",
"vcodec": "libx264",
"acodec": "aac",
"format": "flv",
Expand All @@ -430,7 +454,7 @@ Where:
},
"basement": {
"null_audio": false,
"loglevel": "quiet",
"loglevel": "error",
"vcodec": "libx264",
"acodec": "aac",
"format": "flv",
Expand Down Expand Up @@ -500,15 +524,15 @@ Where:
"direct": {
"kitchen": {
"null_audio": false,
"loglevel": "quiet",
"loglevel": "error",
"vcodec": "copy",
"acodec": "aac",
"format": "flv",
"rtsp_transport_type": "tcp"
},
"basement": {
"null_audio": false,
"loglevel": "quiet",
"loglevel": "error",
"vcodec": "copy",
"acodec": "aac",
"format": "flv",
Expand Down
86 changes: 63 additions & 23 deletions configs/config-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
"api_hash": "1a1a1a1a1a1a1a1a",
"lang_code": "en",
"token": "1b1b1b1b1b1b1b1b",
"allowed_user_ids": [
"chat_users": [
1010101010,
2020202020
],
"alert_users": [
1010101010,
2020202020
],
"startup_message_users": [
1010101010,
2020202020
]
Expand All @@ -15,6 +23,7 @@
"hidden": false,
"description": "Kitchen",
"hashtag": "kitchen",
"group": "Default group",
"api": {
"host": "http://192.168.1.1",
"auth": {
Expand All @@ -23,30 +32,45 @@
},
"stream_timeout": 10
},
"alert": {
"delay": 15,
"video_gif": {
"enabled": true,
"rtsp_port": 554,
"video_gif": {
"on_demand": {
"channel": 101,
"record_time": 10,
"rewind_time": 10,
"tmp_storage": "/tmp",
"loglevel": "error",
"rtsp_transport_type": "tcp"
},
"on_alert": {
"channel": 101,
"record_time": 10,
"rewind_time": 10,
"rewind": true,
"tmp_storage": "/tmp",
"loglevel": "error",
"rtsp_transport_type": "tcp"
}
},
"alert": {
"delay": 15,
"motion_detection": {
"enabled": true,
"enabled": false,
"sendpic": true,
"fullpic": true
"fullpic": false,
"send_videogif": true
},
"line_crossing_detection": {
"enabled": true,
"enabled": false,
"sendpic": true,
"fullpic": true
"fullpic": false,
"send_videogif": true
},
"intrusion_detection": {
"enabled": true,
"enabled": false,
"sendpic": true,
"fullpic": true
"fullpic": false,
"send_videogif": true
}
},
"livestream": {
Expand All @@ -61,7 +85,7 @@
"encoding_template": "direct.kitchen_telegram"
},
"srs": {
"enabled": true,
"enabled": false,
"livestream_template": "tpl_kitchen",
"encoding_template": "direct.kitchen_srs"
},
Expand Down Expand Up @@ -102,6 +126,7 @@
"hidden": false,
"description": "Basement",
"hashtag": "basement",
"group": "Default group",
"api": {
"host": "http://192.168.1.2",
"auth": {
Expand All @@ -110,30 +135,45 @@
},
"stream_timeout": 10
},
"alert": {
"delay": 15,
"video_gif": {
"enabled": true,
"rtsp_port": 554,
"video_gif": {
"on_demand": {
"channel": 101,
"record_time": 10,
"rewind_time": 10,
"tmp_storage": "/tmp",
"loglevel": "error",
"rtsp_transport_type": "tcp"
},
"on_alert": {
"channel": 101,
"record_time": 10,
"rewind_time": 10,
"rewind": false,
"tmp_storage": "/tmp",
"loglevel": "error",
"rtsp_transport_type": "tcp"
}
},
"alert": {
"delay": 15,
"motion_detection": {
"enabled": true,
"enabled": false,
"sendpic": true,
"fullpic": true
"fullpic": false,
"send_videogif": true
},
"line_crossing_detection": {
"enabled": true,
"enabled": false,
"sendpic": true,
"fullpic": true
"fullpic": false,
"send_videogif": true
},
"intrusion_detection": {
"enabled": true,
"enabled": false,
"sendpic": true,
"fullpic": true
"fullpic": false,
"send_videogif": true
}
},
"livestream": {
Expand All @@ -148,7 +188,7 @@
"encoding_template": "direct.basement_telegram"
},
"srs": {
"enabled": true,
"enabled": false,
"livestream_template": "tpl_basement",
"encoding_template": "direct.basement_srs"
},
Expand Down
4 changes: 2 additions & 2 deletions configs/encoding_templates-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"x264": {
"kitchen": {
"null_audio": false,
"loglevel": "quiet",
"loglevel": "error",
"vcodec": "libx264",
"acodec": "aac",
"asample_rate": -1,
Expand All @@ -117,7 +117,7 @@
},
"basement": {
"null_audio": false,
"loglevel": "quiet",
"loglevel": "error",
"vcodec": "libx264",
"acodec": "aac",
"asample_rate": -1,
Expand Down
8 changes: 7 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
context: .
dockerfile: Dockerfile
volumes:
# First path is real local storage path. Change to your preferred path.
- "/data/dvr:/data/dvr"
restart: unless-stopped
depends_on:
Expand All @@ -21,9 +22,14 @@ services:
build:
context: .
dockerfile: srs_prod/Dockerfile
tmpfs:
# Store HLS .ts files in RAM. Depending on 'hls_fragment' and 'hls_window' default size '128M' might be increased.
# Check usage inside the container with 'df -h'.
- /srs/trunk/objs/nginx/html/hls:mode=770,size=128M
command: >
bash -c "./objs/srs -c conf/hik-docker.conf"
ports:
# SRS RTMP port. If you comment this out, you won't be able to connect with video player like VLC.
- "1935:1935"
- "1985:1985"
# SRS WebUI port. Also serves HLS stream; same warning as for previous port mapping.
- "8080:8080"
Loading

0 comments on commit a7108c0

Please sign in to comment.