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 CHANGED
@@ -2,43 +2,60 @@
2
2
 
3
3
  ## HIK MEDIA BUFFER NODE
4
4
 
5
- <img src='https://raw.githubusercontent.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/main/img/hik-media-buffer-node.png'>
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://raw.githubusercontent.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/main/img/hik-media-buffer-configuration.png'>
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: "evento" // Type of alarm deteced (event or status)
22
- nome_cliente: "test" // Customer name (name of the node)
23
- nome_telecamera: "Ufficio" // Camera name on hiklvision
24
- ip_telecamera: "192.168.62.9" // IP of the camera
25
- tipo_evento: "LineDetection" // Type of event deteced
26
- timestamp_epoch: 1780645403 // Timestamp of the event
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: "2" // Channel of the camera
29
- foto_base64: "/9j/2wCEAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSop..." // Buffer of the image base64
30
- video_base64: "AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAABtdtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPo..." // Buffer of the image base64
31
- _msgid: "942a8c0c56860f42"
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://raw.githubusercontent.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/main/img/hik-snapshot-node.png'>
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.</br>
39
- This node can also report if there are recordings on the day this node is triggered for each camera.
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://raw.githubusercontent.com/ALLSYSTEM-SPA/node-red-contrib-hik-media-buffer/main/img/hik-snapshot-configuration.png'>
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>
@@ -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 Media Buffer node connects to NVR and outputs the image and the video of the event in case of alarm.</br>
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
- ip: "192.168.1.100", // IP of the camera
77
- channel: "2", // Channel of the camera
78
- event: "LineDetection", // Type of event deteced
79
- videoPath: "", // Path of the video
80
- imageBuffer: buffer[12360], // Buffer of the image
81
- status: "online", // Status of the camera
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
  ```
@@ -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": "linedetection" }
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-hik-media-buffer",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "description": "Ottiene buffer video e immagine da camere Hikvision via ISAPI",
5
5
  "keywords": [
6
6
  "node-red",