node-red-contrib-hik-media-buffer 1.1.53 → 1.1.54
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/hik-media-buffer.js +4 -27
- package/package.json +1 -1
package/hik-media-buffer.js
CHANGED
|
@@ -122,6 +122,7 @@ module.exports = function(RED) {
|
|
|
122
122
|
const referenceTime = new Date();
|
|
123
123
|
const timestamp = Math.floor(referenceTime.getTime() / 1000);
|
|
124
124
|
|
|
125
|
+
// Ripristinato toHikDate identico a prima (con la Z / UTC che andava)
|
|
125
126
|
const startTime = toHikDate(new Date(referenceTime.getTime() - (20 * 1000)));
|
|
126
127
|
const endTime = toHikDate(new Date(referenceTime.getTime() + (20 * 1000)));
|
|
127
128
|
node.warn(`[STEP 2] Finestra temporale impostata: ${startTime} -> ${endTime}`);
|
|
@@ -169,33 +170,9 @@ module.exports = function(RED) {
|
|
|
169
170
|
for (let t of tracks) {
|
|
170
171
|
node.warn(`[STEP 4] Elaborazione traccia ${t.label} (ID: ${t.id})`);
|
|
171
172
|
|
|
172
|
-
//
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
` <searchID>LAST_EVENT</searchID>\n` +
|
|
176
|
-
` <trackIDList>\n` +
|
|
177
|
-
` <trackID>${t.id}</trackID>\n` +
|
|
178
|
-
` </trackIDList>\n` +
|
|
179
|
-
` <timeSpanList>\n` +
|
|
180
|
-
` <timeSpan>\n` +
|
|
181
|
-
` <startTime>${startTime}</startTime>\n` +
|
|
182
|
-
` <endTime>${endTime}</endTime>\n` +
|
|
183
|
-
` </timeSpan>\n` +
|
|
184
|
-
` </timeSpanList>\n`;
|
|
185
|
-
|
|
186
|
-
// Inseriamo il contentTypeList SOLO per la foto, per la ricerca video standard dell'NVR va rimosso!
|
|
187
|
-
if (t.isFoto) {
|
|
188
|
-
searchXml += ` <contentTypeList>\n` +
|
|
189
|
-
` <contentType>metadata</contentType>\n` +
|
|
190
|
-
` </contentTypeList>\n`;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
searchXml += ` <maxResults>30</maxResults>\n` +
|
|
194
|
-
` <searchResultPostion>0</searchResultPostion>\n` +
|
|
195
|
-
` <metadataList>\n` +
|
|
196
|
-
` <metadataDescriptor>recordType.meta.hikvision.com/${eventoNVR}</metadataDescriptor>\n` +
|
|
197
|
-
` </metadataList>\n` +
|
|
198
|
-
`</CMSearchDescription>`;
|
|
173
|
+
// RIPRISTINATO: XML identico riga per riga a quello vecchio della telecamera,
|
|
174
|
+
// ma usando la stringa di metadato corretta dell'NVR (recordType.meta.hikvision.com)
|
|
175
|
+
const searchXml = `<?xml version="1.0" encoding="utf-8"?><CMSearchDescription><searchID>LAST_EVENT</searchID><trackIDList><trackID>${t.id}</trackID></trackIDList><timeSpanList><timeSpan><startTime>${startTime}</startTime><endTime>${endTime}</endTime></timeSpan></timeSpanList><maxResults>100</maxResults><metadataList><metadataDescriptor>recordType.meta.hikvision.com/${eventoNVR}</metadataDescriptor></metadataList></CMSearchDescription>`;
|
|
199
176
|
|
|
200
177
|
node.warn(`[STEP 4.1] Invio POST /search per traccia ${t.id}. XML inviato:\n${searchXml}`);
|
|
201
178
|
|