node-red-contrib-hik-media-buffer 1.2.9 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -22
- package/hik-download.html +25 -1
- package/hik-media-buffer.html +27 -8
- package/hik-media-buffer.js +7 -1
- package/hik-snapshot.html +2 -1
- package/img/hik-download-configuration.png +0 -0
- package/img/hik-download-node.png +0 -0
- package/img/hik-media-buffer-configuration.png +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,43 +2,60 @@
|
|
|
2
2
|
|
|
3
3
|
## HIK MEDIA BUFFER NODE
|
|
4
4
|
|
|
5
|
-
<img src='https://
|
|
5
|
+
<img src='https://github.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/blob/main/img/hik-media-buffer-node.png'>
|
|
6
6
|
|
|
7
7
|
The Hik Media Buffer node connects to **_NVR_** and outputs the image and the video of the event in case of alarm.</br>
|
|
8
8
|
This node only detects **_"FieldDetection"_** and **_"LineDetection"_** alarms but can also receive notification of a **_failed connection_** of the cameras or NVR.</br>
|
|
9
9
|
|
|
10
|
-
<img src='https://
|
|
10
|
+
<img src='https://github.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/blob/main/img/hik-media-buffer-configuration.png'>
|
|
11
11
|
|
|
12
12
|
To configure the node you need to enter the **_IP, user and password of the NVR_**, you can also choose the **_protocol_** and **_port_** to use.</br>
|
|
13
|
-
You must also enter, by pressing the **_"add"_** button, the **_channel and the correspective IP of the camera_**, finally you must enter the **_password of the cameras_**.</br>
|
|
14
|
-
The node name is the name of the customer.</br>
|
|
15
13
|
|
|
16
14
|
This below is an example of msg output:</br>
|
|
17
15
|
|
|
16
|
+
In case of failed connection:</br>
|
|
17
|
+
|
|
18
18
|
```javascript
|
|
19
19
|
msg = {
|
|
20
|
-
payload: object
|
|
21
|
-
tipo_messaggio: "
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
payload: object,
|
|
21
|
+
tipo_messaggio: "status" //message type
|
|
22
|
+
stato_telecamera: "online" // Status of the camera
|
|
23
|
+
nome_cliente: "test" // Node name
|
|
24
|
+
nome_telecamera: "Camera 01" // Camera name (OSD)
|
|
25
|
+
ip_telecamera: "192.168.62.131" // IP of the camera
|
|
26
|
+
channel: "1" // Channel of the camera
|
|
27
|
+
msg: "Camera ripristinata"
|
|
28
|
+
_msgid: "45fd74589048966d"
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
In case of alarm:</br>
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
msg = {
|
|
37
|
+
payload: object,
|
|
38
|
+
tipo_messaggio: "evento" //message type
|
|
39
|
+
nome_cliente: "test" // Node name
|
|
40
|
+
nome_telecamera: "Camera 01" // Camera name (OSD)
|
|
41
|
+
ip_telecamera: "192.168.62.131" // IP of the camera
|
|
42
|
+
tipo_evento: "LineDetection" // Event type
|
|
43
|
+
timestamp_epoch: 1784877525
|
|
27
44
|
stato_telecamera: "ONLINE" // Status of the camera
|
|
28
|
-
channel: "
|
|
29
|
-
foto_base64: "/9j/
|
|
30
|
-
video_base64: "
|
|
31
|
-
_msgid: "
|
|
45
|
+
channel: "1" // Channel of the camera
|
|
46
|
+
foto_base64: "/9j/2wCEAAYEBQYFBAYGBQY.." // Img in base64
|
|
47
|
+
video_base64: "AAAAHGZ0eXBpc29tAAACAG.." // Video in base64
|
|
48
|
+
_msgid: "45fd74589048966d"
|
|
32
49
|
};
|
|
33
50
|
```
|
|
34
51
|
## HIK SNAPSHOT NODE
|
|
35
52
|
|
|
36
|
-
<img src='https://
|
|
53
|
+
<img src='https://github.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/blob/main/img/hik-snapshot-node.png'>
|
|
37
54
|
|
|
38
|
-
The Hik Snapshot node connects to **_NVR_** and generates a live image for each camera when it receives **_payload = true_** as input
|
|
39
|
-
This node can also report if there are recordings
|
|
55
|
+
The Hik Snapshot node connects to **_NVR_** and generates a live image for each camera when it receives **_payload = true_** as input.
|
|
56
|
+
This node can also report, for each camera, if there are recordings of the day this node is triggered.
|
|
40
57
|
|
|
41
|
-
<img src='https://
|
|
58
|
+
<img src='https://github.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/blob/main/img/hik-snapshot-configuration.png'>
|
|
42
59
|
|
|
43
60
|
To configure the node you need to enter the **_IP, user and password of the NVR_**, you can also choose the **_protocol_** and **_port_** to use.</br>
|
|
44
61
|
You must also enter the number of the channels you want to get the snapshot of.</br>
|
|
@@ -49,7 +66,8 @@ This below is an example of msg output:</br>
|
|
|
49
66
|
```javascript
|
|
50
67
|
msg = {
|
|
51
68
|
payload: array[5], // 5 channels
|
|
52
|
-
0: object,
|
|
69
|
+
0: object,
|
|
70
|
+
name: "test" // Node name
|
|
53
71
|
channel: 1, // Channel 1 of the NVR
|
|
54
72
|
photo: buffer[18080], // Snapshot buffer
|
|
55
73
|
snapOk: true, // True if it gets the snapshot, False if not
|
|
@@ -61,6 +79,30 @@ msg = {
|
|
|
61
79
|
isRecording: true,
|
|
62
80
|
2: object,
|
|
63
81
|
3: object,
|
|
64
|
-
4: object
|
|
82
|
+
4: object
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## HIK DOWNLOAD NODE
|
|
87
|
+
|
|
88
|
+
<img src='https://raw.githubusercontent.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/main/img/hik-download-node.png'>
|
|
89
|
+
|
|
90
|
+
The Hik Download node connects to NVR and outputs the playback video when it receives "payload = true" as input.</br>
|
|
91
|
+
|
|
92
|
+
<img src='https://raw.githubusercontent.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/main/img/hik-download-configuration.png'>
|
|
93
|
+
|
|
94
|
+
To configure the node you need to enter the IP, user and password of the NVR, you can also choose the protocol and port to use.</br>
|
|
95
|
+
You must also enter the start time and the end time and the number of the channels you want to get the playback of.</br>
|
|
96
|
+
If you enter "1", you will get the playback of the first channel on the NVR, if you enter "1,3", you will get the playback of channel 1 and 3 on the NVR, if you enter "1-3", you will get the playback from channel 1 to channel 3 on the NVR</br>
|
|
97
|
+
|
|
98
|
+
This below is an example of msg output:</br>
|
|
99
|
+
|
|
100
|
+
```javascript
|
|
101
|
+
msg = {
|
|
102
|
+
payload: buffer[6058100], //Buffer of the video
|
|
103
|
+
localFilePath: "C:/download/2026-07-15/NVR_Cam2_085510.mp4", // Path of the video
|
|
104
|
+
channel: 2, // Channel of the camera
|
|
105
|
+
filename: "NVR_Cam2_085510.mp4" // Name of the file
|
|
65
106
|
};
|
|
66
|
-
```
|
|
107
|
+
```
|
|
108
|
+
|
package/hik-download.html
CHANGED
|
@@ -76,4 +76,28 @@
|
|
|
76
76
|
<option value="8800">8800</option>
|
|
77
77
|
</select>
|
|
78
78
|
</div>
|
|
79
|
-
</script>
|
|
79
|
+
</script>
|
|
80
|
+
<script type="text/markdown" data-help-name="hik-media-buffer">
|
|
81
|
+
## HIK DOWNLOAD NODE
|
|
82
|
+
|
|
83
|
+
<img src='https://raw.githubusercontent.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/main/img/hik-download-node.png'>
|
|
84
|
+
|
|
85
|
+
The Hik Download node connects to NVR and outputs the playback video when it receives "payload = true" as input.</br>
|
|
86
|
+
|
|
87
|
+
<img src='https://raw.githubusercontent.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/main/img/hik-download-configuration.png'>
|
|
88
|
+
|
|
89
|
+
To configure the node you need to enter the IP, user and password of the NVR, you can also choose the protocol and port to use.</br>
|
|
90
|
+
You must also enter the start time and the end time and the number of the channels you want to get the playback of.</br>
|
|
91
|
+
If you enter "1", you will get the playback of the first channel on the NVR, if you enter "1,3", you will get the playback of channel 1 and 3 on the NVR, if you enter "1-3", you will get the playback from channel 1 to channel 3 on the NVR</br>
|
|
92
|
+
|
|
93
|
+
This below is an example of msg output:</br>
|
|
94
|
+
|
|
95
|
+
```javascript
|
|
96
|
+
msg = {
|
|
97
|
+
payload: buffer[6058100], //Buffer of the video
|
|
98
|
+
localFilePath: "C:/download/2026-07-15/NVR_Cam2_085510.mp4", // Path of the video
|
|
99
|
+
channel: 2, // Channel of the camera
|
|
100
|
+
filename: "NVR_Cam2_085510.mp4" // Name of the file
|
|
101
|
+
};
|
|
102
|
+
```
|
|
103
|
+
</script>
|
package/hik-media-buffer.html
CHANGED
|
@@ -60,25 +60,44 @@
|
|
|
60
60
|
|
|
61
61
|
<img src='https://raw.githubusercontent.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/main/img/hik-media-buffer-node.png'>
|
|
62
62
|
|
|
63
|
-
The Hik
|
|
63
|
+
The Hik Download node connects to NVR and outputs the image and the video of the event in case of alarm.</br>
|
|
64
64
|
This node only detects "FieldDetection" and "LineDetection" alarms but can also receive notification of a failed connection of the cameras or NVR.</br>
|
|
65
65
|
|
|
66
66
|
<img src='https://raw.githubusercontent.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/main/img/hik-media-buffer-configuration.png'>
|
|
67
67
|
|
|
68
68
|
To configure the node you need to enter the IP, user and password of the NVR, you can also choose the protocol and port to use.</br>
|
|
69
|
-
You must also enter, by pressing the "add" button, the channel and the correspective IP of the camera, finally you must enter the password of the cameras.</br>
|
|
70
69
|
|
|
71
70
|
This below is an example of msg output:</br>
|
|
72
71
|
|
|
72
|
+
In case of failed connection:</br>
|
|
73
73
|
```javascript
|
|
74
74
|
msg = {
|
|
75
75
|
payload: object,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
tipo_messaggio: "status" //message type
|
|
77
|
+
stato_telecamera: "online" // Status of the camera
|
|
78
|
+
nome_cliente: "test" // Node name
|
|
79
|
+
nome_telecamera: "Camera 01" // Camera name (OSD)
|
|
80
|
+
ip_telecamera: "192.168.62.131" // IP of the camera
|
|
81
|
+
channel: "1" // Channel of the camera
|
|
82
|
+
msg: "Camera ripristinata"
|
|
83
|
+
_msgid: "45fd74589048966d"
|
|
84
|
+
};
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
In case of alarm:</br>
|
|
88
|
+
```javascript
|
|
89
|
+
msg = {
|
|
90
|
+
payload: object,
|
|
91
|
+
tipo_messaggio: "evento" //message type
|
|
92
|
+
nome_cliente: "test" // Node name
|
|
93
|
+
nome_telecamera: "Camera 01" // Camera name (OSD)
|
|
94
|
+
ip_telecamera: "192.168.62.131" // IP of the camera
|
|
95
|
+
tipo_evento: "LineDetection" // Event type
|
|
96
|
+
timestamp_epoch: 1784877525
|
|
97
|
+
stato_telecamera: "ONLINE" // Status of the camera
|
|
98
|
+
channel: "1" // Channel of the camera
|
|
99
|
+
foto_base64: "/9j/2wCEAAYEBQYFBAYGBQY.." // Img in base64
|
|
100
|
+
video_base64: "AAAAHGZ0eXBpc29tAAACAG.." // Video in base64
|
|
82
101
|
_msgid: "45fd74589048966d"
|
|
83
102
|
};
|
|
84
103
|
```
|
package/hik-media-buffer.js
CHANGED
|
@@ -160,6 +160,12 @@ module.exports = function(RED) {
|
|
|
160
160
|
let fileDaCancellare = [];
|
|
161
161
|
|
|
162
162
|
try {
|
|
163
|
+
|
|
164
|
+
let searchBehaviorType = "";
|
|
165
|
+
if (evento) {
|
|
166
|
+
searchBehaviorType = evento.toLowerCase();
|
|
167
|
+
}
|
|
168
|
+
|
|
163
169
|
// 1. 📸 SCARICAMENTO IMMAGINE E RECUPERO METADATI ORARI
|
|
164
170
|
const payloadFoto = {
|
|
165
171
|
"EventSearchDescription": {
|
|
@@ -170,7 +176,7 @@ module.exports = function(RED) {
|
|
|
170
176
|
"type": "all",
|
|
171
177
|
"channels": [parseInt(channelID)],
|
|
172
178
|
"eventType": "behavior",
|
|
173
|
-
"behavior": { "behaviorEventType":
|
|
179
|
+
"behavior": { "behaviorEventType": searchBehaviorType }
|
|
174
180
|
}
|
|
175
181
|
};
|
|
176
182
|
|
package/hik-snapshot.html
CHANGED
|
@@ -87,7 +87,8 @@ This below is an example of msg output:</br>
|
|
|
87
87
|
```javascript
|
|
88
88
|
msg = {
|
|
89
89
|
payload: array[5], // 5 channels
|
|
90
|
-
0: object,
|
|
90
|
+
0: object,
|
|
91
|
+
name: "test" // Node name
|
|
91
92
|
channel: 1, // Channel 1 of the NVR
|
|
92
93
|
photo: buffer[18080], // Snapshot buffer
|
|
93
94
|
snapOk: true, // True if it gets the snapshot, False if not
|
|
Binary file
|
|
Binary file
|
|
Binary file
|