@camera.ui/camera-ui-pamdiff 0.0.5 → 0.0.7
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/dist/camera.d.ts +12 -10
- package/dist/camera.js +163 -105
- package/dist/camera.js.map +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +15 -31
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +10 -9
- package/dist/index.js +24 -29
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -6
- package/dist/types.js +1 -2
- package/dist/types.js.map +1 -1
- package/package.json +21 -18
- package/types/pipe2pam.d.ts +2 -0
- package/dist/contract.d.ts +0 -2
- package/dist/contract.js +0 -8
- package/dist/contract.js.map +0 -1
- package/dist/videoanalysis.d.ts +0 -25
- package/dist/videoanalysis.js +0 -223
- package/dist/videoanalysis.js.map +0 -1
- package/example-config.json +0 -1
package/dist/camera.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { CameraDevice } from '@camera.ui/types';
|
|
3
|
-
import type { PamDiff } from '.';
|
|
1
|
+
import type { CameraDevice, PluginAPI, PluginLogger } from '@camera.ui/types';
|
|
4
2
|
export declare class CameraVideoanalysis {
|
|
5
|
-
|
|
6
|
-
private platform;
|
|
3
|
+
private api;
|
|
7
4
|
private logger;
|
|
8
5
|
private cameraDevice;
|
|
9
|
-
private
|
|
10
|
-
|
|
6
|
+
private cameraStorage;
|
|
7
|
+
private killed;
|
|
8
|
+
private videoanalysisSession?;
|
|
9
|
+
constructor(api: PluginAPI, cameraDevice: CameraDevice, logger: PluginLogger);
|
|
11
10
|
start(): Promise<void>;
|
|
12
|
-
kill
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
stop(kill?: boolean): void;
|
|
12
|
+
private restart;
|
|
13
|
+
private reset;
|
|
14
|
+
private startVideoanalysis;
|
|
15
|
+
private reconfigure;
|
|
16
|
+
private createCameraStorage;
|
|
15
17
|
}
|
package/dist/camera.js
CHANGED
|
@@ -1,122 +1,180 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
class CameraVideoanalysis {
|
|
7
|
-
|
|
8
|
-
platform;
|
|
1
|
+
import PamDiff from 'pam-diff';
|
|
2
|
+
import P2P from 'pipe2pam';
|
|
3
|
+
import { PassThrough } from 'stream';
|
|
4
|
+
import { DEFAULT_DIFFERENCE, DEFAULT_PERCENTAGE } from './constants.js';
|
|
5
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
6
|
+
export class CameraVideoanalysis {
|
|
7
|
+
api;
|
|
9
8
|
logger;
|
|
10
9
|
cameraDevice;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
cameraStorage;
|
|
11
|
+
killed = false;
|
|
12
|
+
videoanalysisSession;
|
|
13
|
+
constructor(api, cameraDevice, logger) {
|
|
14
|
+
this.api = api;
|
|
15
|
+
this.logger = logger;
|
|
15
16
|
this.cameraDevice = cameraDevice;
|
|
17
|
+
this.cameraStorage = this.createCameraStorage();
|
|
18
|
+
this.cameraDevice.onConnected.subscribe(async (connected) => {
|
|
19
|
+
if (connected) {
|
|
20
|
+
this.start();
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this.stop(true);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
16
26
|
}
|
|
17
27
|
async start() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
try {
|
|
29
|
+
this.logger.log(this.cameraDevice.name, 'Starting videoanalysis');
|
|
30
|
+
this.videoanalysisSession = await this.startVideoanalysis();
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
this.logger.error(this.cameraDevice.name, 'An error occured during starting videoanalysis!', error);
|
|
34
|
+
this.restart();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
stop(kill) {
|
|
38
|
+
this.killed = kill || false;
|
|
39
|
+
if (this.videoanalysisSession) {
|
|
40
|
+
this.logger.log(this.cameraDevice.name, 'Stopping videoanalysis session');
|
|
41
|
+
this.videoanalysisSession.kill();
|
|
42
|
+
this.videoanalysisSession = undefined;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async restart() {
|
|
46
|
+
this.logger.log(this.cameraDevice.name, 'Restarting videoanalysis...');
|
|
47
|
+
this.stop();
|
|
48
|
+
await sleep(5000);
|
|
49
|
+
if (!this.killed) {
|
|
50
|
+
await this.start();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
reset() {
|
|
54
|
+
this.videoanalysisSession?.kill();
|
|
55
|
+
this.videoanalysisSession = undefined;
|
|
56
|
+
}
|
|
57
|
+
async startVideoanalysis() {
|
|
58
|
+
this.reset();
|
|
59
|
+
let isActive = true;
|
|
60
|
+
const blobs = [];
|
|
61
|
+
const difference = await this.cameraStorage.getValue('difference');
|
|
62
|
+
const percent = await this.cameraStorage.getValue('percentage');
|
|
63
|
+
this.logger.debug(this.cameraDevice.name, 'Videoanalysis configuration:', { difference, percent });
|
|
64
|
+
const pt = new PassThrough();
|
|
65
|
+
const p2p = new P2P();
|
|
66
|
+
const pamDiff = new PamDiff({
|
|
67
|
+
difference,
|
|
68
|
+
percent,
|
|
69
|
+
response: 'blobs',
|
|
31
70
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
71
|
+
pt.pipe(p2p).pipe(pamDiff);
|
|
72
|
+
const kill = () => {
|
|
73
|
+
isActive = false;
|
|
74
|
+
pt.end();
|
|
75
|
+
p2p.end();
|
|
76
|
+
pamDiff.end();
|
|
77
|
+
};
|
|
78
|
+
pamDiff.on('diff', (data) => {
|
|
79
|
+
for (const trigger of data.trigger) {
|
|
80
|
+
if (trigger.blobs) {
|
|
81
|
+
blobs.push(...trigger.blobs);
|
|
82
|
+
}
|
|
40
83
|
}
|
|
41
|
-
await this.videoanalysisObj?.stream.restart();
|
|
42
|
-
await this.cameraStorage.setValue('analyzedStream', analyzedStream);
|
|
43
|
-
await this.cameraStorage.changeSchema('analyzedStream', {
|
|
44
|
-
enum: this.cameraDevice.sources.filter((source) => source.roles.includes('detect')).map((source) => source.name),
|
|
45
|
-
});
|
|
46
84
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
85
|
+
let zeroDetections = 0;
|
|
86
|
+
for await (const frame of this.cameraDevice.getFrames()) {
|
|
87
|
+
if (!isActive) {
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
const { image, info } = await frame.toBuffer({ format: { to: 'gray' } });
|
|
91
|
+
const header = ['P7', `WIDTH ${info.width}`, `HEIGHT ${info.height}`, 'DEPTH 1', 'MAXVAL 255', 'TUPLTYPE GRAYSCALE', 'ENDHDR'].join('\n') + '\n';
|
|
92
|
+
pt.write(Buffer.from(header));
|
|
93
|
+
pt.write(image);
|
|
94
|
+
await sleep(1);
|
|
95
|
+
const detections = [];
|
|
96
|
+
while (blobs.length > 1) {
|
|
97
|
+
const blob = blobs.shift();
|
|
98
|
+
if (blob) {
|
|
99
|
+
detections.push({
|
|
100
|
+
label: 'motion',
|
|
101
|
+
confidence: 1,
|
|
102
|
+
boundingBox: [blob.minX, blob.minY, blob.maxX, blob.maxY],
|
|
103
|
+
inputWidth: info.width,
|
|
104
|
+
inputHeight: info.height,
|
|
105
|
+
origWidth: frame.metadata.width,
|
|
106
|
+
origHeight: frame.metadata.height,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (!detections.length) {
|
|
111
|
+
zeroDetections++;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
zeroDetections = 0;
|
|
115
|
+
}
|
|
116
|
+
if (zeroDetections > 10) {
|
|
117
|
+
zeroDetections = 0;
|
|
118
|
+
await this.cameraDevice.updateState('motion', { detections }, frame);
|
|
119
|
+
}
|
|
120
|
+
else if (!zeroDetections) {
|
|
121
|
+
await this.cameraDevice.updateState('motion', { detections }, frame);
|
|
122
|
+
}
|
|
50
123
|
}
|
|
124
|
+
return {
|
|
125
|
+
isActive() {
|
|
126
|
+
return isActive;
|
|
127
|
+
},
|
|
128
|
+
kill,
|
|
129
|
+
pamDiff,
|
|
130
|
+
p2p,
|
|
131
|
+
};
|
|
51
132
|
}
|
|
52
|
-
async
|
|
53
|
-
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const cameraSource = this.cameraDevice.sources.find((s) => s.name === newSource);
|
|
62
|
-
if (cameraSource) {
|
|
63
|
-
const analyzedStream = new videoanalysis_1.VideoanalysisService(this.cameraDevice, this.cameraStorage, cameraSource, this.logger);
|
|
64
|
-
await analyzedStream.start();
|
|
65
|
-
this.videoanalysisObj = { name: newSource, stream: analyzedStream };
|
|
133
|
+
async reconfigure({ difference, percentage }) {
|
|
134
|
+
this.logger.log(this.cameraDevice.name, 'Reconfiguring videoanalysis...');
|
|
135
|
+
if (this.videoanalysisSession) {
|
|
136
|
+
this.cameraDevice.updateState('motion', { detections: [] }).catch();
|
|
137
|
+
percentage = percentage || this.videoanalysisSession.pamDiff.percent;
|
|
138
|
+
difference = difference || this.videoanalysisSession.pamDiff.difference;
|
|
139
|
+
this.logger.log(this.cameraDevice.name, `New configuration: ${percentage}% / ${difference}`);
|
|
140
|
+
this.videoanalysisSession.pamDiff.setPercent(percentage);
|
|
141
|
+
this.videoanalysisSession.pamDiff.setDifference(difference);
|
|
66
142
|
}
|
|
67
|
-
await this.reconfigureSources();
|
|
68
143
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
for (const source of analyzedStreamsSchema.enum) {
|
|
74
|
-
await this.cameraStorage.removeSchema(source);
|
|
75
|
-
}
|
|
144
|
+
createCameraStorage() {
|
|
145
|
+
let cameraStorage = this.api.storageController.getCameraStorage(this.cameraDevice.id);
|
|
146
|
+
if (cameraStorage) {
|
|
147
|
+
return cameraStorage;
|
|
76
148
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
difference: {
|
|
90
|
-
type: 'number',
|
|
91
|
-
key: 'difference',
|
|
92
|
-
title: 'Motion Difference',
|
|
93
|
-
description: 'The color difference required to trigger motion on a pixel',
|
|
94
|
-
defaultValue: constants_1.DEFAULT_DIFFERENCE,
|
|
95
|
-
minimum: 1,
|
|
96
|
-
maximum: 255,
|
|
97
|
-
store: true,
|
|
98
|
-
onSet: (newValue) => {
|
|
99
|
-
this.videoanalysisObj?.stream.reconfigure({ difference: newValue });
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
percentage: {
|
|
103
|
-
type: 'number',
|
|
104
|
-
key: 'percentage',
|
|
105
|
-
title: 'Motion Percent',
|
|
106
|
-
description: 'The percentage of pixels required to trigger motion',
|
|
107
|
-
defaultValue: constants_1.DEFAULT_PERCENTAGE,
|
|
108
|
-
minimum: 0,
|
|
109
|
-
maximum: 100,
|
|
110
|
-
store: true,
|
|
111
|
-
onSet: (newValue) => {
|
|
112
|
-
this.videoanalysisObj?.stream.reconfigure({ percentage: newValue });
|
|
113
|
-
},
|
|
114
|
-
},
|
|
149
|
+
cameraStorage = this.api.storageController.createCameraStorage(this, this.cameraDevice.id, {
|
|
150
|
+
difference: {
|
|
151
|
+
type: 'number',
|
|
152
|
+
key: 'difference',
|
|
153
|
+
title: 'Motion Difference',
|
|
154
|
+
description: 'The color difference required to trigger motion on a pixel',
|
|
155
|
+
defaultValue: DEFAULT_DIFFERENCE,
|
|
156
|
+
minimum: 1,
|
|
157
|
+
maximum: 255,
|
|
158
|
+
store: true,
|
|
159
|
+
onSet: async (newValue) => {
|
|
160
|
+
this.reconfigure({ difference: newValue });
|
|
115
161
|
},
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
162
|
+
},
|
|
163
|
+
percentage: {
|
|
164
|
+
type: 'number',
|
|
165
|
+
key: 'percentage',
|
|
166
|
+
title: 'Motion Percent',
|
|
167
|
+
description: 'The percentage of pixels required to trigger motion',
|
|
168
|
+
defaultValue: DEFAULT_PERCENTAGE,
|
|
169
|
+
minimum: 0,
|
|
170
|
+
maximum: 100,
|
|
171
|
+
store: true,
|
|
172
|
+
onSet: async (newValue) => {
|
|
173
|
+
this.reconfigure({ percentage: newValue });
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
return cameraStorage;
|
|
119
178
|
}
|
|
120
179
|
}
|
|
121
|
-
exports.CameraVideoanalysis = CameraVideoanalysis;
|
|
122
180
|
//# sourceMappingURL=camera.js.map
|
package/dist/camera.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.js","sourceRoot":"","sources":["../src/camera.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"camera.js","sourceRoot":"","sources":["../src/camera.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAKxE,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAE/F,MAAM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ACjB,KAAK,EAAE,mBAAmB;gBAC1B,WAAW,EAAE,4DAA4D;gBACzE,YAAY,EAAE,kBAAkB;gBAChC,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,GAAG;gBACZ,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,KAAK,EAAE,QAAgB,EAAE,EAAE;oBAChC,IAAI,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;gBAC7C,CAAC;aACF;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,GAAG,EAAE,YAAY;gBACjB,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EAAE,qDAAqD;gBAClE,YAAY,EAAE,kBAAkB;gBAChC,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,GAAG;gBACZ,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,KAAK,EAAE,QAAgB,EAAE,EAAE;oBAChC,IAAI,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;gBAC7C,CAAC;aACF;SACF,CAAC,CAAC;QAEH,OAAO,aAAa,CAAC;IACvB,CAAC;CACF"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DetectionZone } from '@camera.ui/types';
|
|
2
2
|
export declare const DEFAULT_PERCENTAGE = 2;
|
|
3
3
|
export declare const DEFAULT_DIFFERENCE = 9;
|
|
4
4
|
export declare const FFMPEG_MODE = "rgb24";
|
|
5
5
|
export declare const FFMPEG_RESOLUTION = "640:360";
|
|
6
6
|
export declare const FFMPEG_FPS = "2";
|
|
7
|
-
export declare const DEFAULT_ZONE:
|
|
7
|
+
export declare const DEFAULT_ZONE: DetectionZone[];
|
package/dist/constants.js
CHANGED
|
@@ -1,37 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.FFMPEG_RESOLUTION = '640:360';
|
|
8
|
-
exports.FFMPEG_FPS = '2';
|
|
9
|
-
exports.DEFAULT_ZONE = [
|
|
1
|
+
export const DEFAULT_PERCENTAGE = 2;
|
|
2
|
+
export const DEFAULT_DIFFERENCE = 9;
|
|
3
|
+
export const FFMPEG_MODE = 'rgb24'; // gray, rgba, rgb24
|
|
4
|
+
export const FFMPEG_RESOLUTION = '640:360';
|
|
5
|
+
export const FFMPEG_FPS = '2';
|
|
6
|
+
export const DEFAULT_ZONE = [
|
|
10
7
|
{
|
|
11
8
|
name: 'default',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
_id: '1',
|
|
18
|
-
points: [0, 100],
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
_id: '2',
|
|
22
|
-
points: [0, 0],
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
_id: '3',
|
|
26
|
-
points: [100, 0],
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
_id: '4',
|
|
30
|
-
points: [100, 100],
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
9
|
+
points: [
|
|
10
|
+
[0, 100],
|
|
11
|
+
[0, 0],
|
|
12
|
+
[100, 0],
|
|
13
|
+
[100, 100],
|
|
34
14
|
],
|
|
15
|
+
type: 'intersect',
|
|
16
|
+
filter: 'include',
|
|
17
|
+
classes: [],
|
|
18
|
+
isPrivacyMask: false,
|
|
35
19
|
},
|
|
36
20
|
];
|
|
37
21
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAEpC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAEpC,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,oBAAoB;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE3C,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAC;AAE9B,MAAM,CAAC,MAAM,YAAY,GAAoB;IAC3C;QACE,IAAI,EAAE,SAAS;QACf,MAAM,EAAE;YACN,CAAC,CAAC,EAAE,GAAG,CAAC;YACR,CAAC,CAAC,EAAE,CAAC,CAAC;YACN,CAAC,GAAG,EAAE,CAAC,CAAC;YACR,CAAC,GAAG,EAAE,GAAG,CAAC;SACX;QACD,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,EAAE;QACX,aAAa,EAAE,KAAK;KACrB;CACF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { BasePlugin } from '@camera.ui/types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare class PamDiff extends BasePlugin {
|
|
1
|
+
import type { BasePlugin, CameraDevice, FormSubmitResponse, PluginAPI, PluginLogger } from '@camera.ui/types';
|
|
2
|
+
export default class PamDiff implements BasePlugin {
|
|
3
|
+
private cameras;
|
|
6
4
|
private analyzedCameras;
|
|
7
|
-
|
|
5
|
+
logger: PluginLogger;
|
|
6
|
+
api: PluginAPI;
|
|
7
|
+
constructor(log: PluginLogger, api: PluginAPI);
|
|
8
|
+
configureCameras(cameras: CameraDevice[]): void;
|
|
9
|
+
onFormSubmit(actionId: string, payload: any): Promise<FormSubmitResponse | void>;
|
|
8
10
|
private start;
|
|
9
11
|
private stop;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
removeCamera(cameraId: string): Promise<void>;
|
|
12
|
+
private configureCamera;
|
|
13
|
+
private removeCamera;
|
|
13
14
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const types_1 = require("@camera.ui/types");
|
|
5
|
-
const contract_1 = require("./contract");
|
|
6
|
-
const camera_1 = require("./camera");
|
|
7
|
-
exports.default = (api) => api.registerPlugin(PamDiff, contract_1.pluginContract);
|
|
8
|
-
class PamDiff extends types_1.BasePlugin {
|
|
1
|
+
import { CameraVideoanalysis } from './camera.js';
|
|
2
|
+
export default class PamDiff {
|
|
3
|
+
cameras = new Map();
|
|
9
4
|
analyzedCameras = new Map();
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
logger;
|
|
6
|
+
api;
|
|
7
|
+
constructor(log, api) {
|
|
8
|
+
this.logger = log;
|
|
9
|
+
this.api = api;
|
|
12
10
|
this.api.on('finishLaunching', this.start.bind(this));
|
|
13
11
|
this.api.on('shutdown', this.stop.bind(this));
|
|
14
12
|
}
|
|
13
|
+
configureCameras(cameras) {
|
|
14
|
+
for (const camera of cameras) {
|
|
15
|
+
this.configureCamera(camera);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
+
async onFormSubmit(actionId, payload) { }
|
|
15
20
|
async start() {
|
|
16
|
-
this.api.deviceManager.
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
this.api.deviceManager.listen('cameraDeselected', async (cameraId) => {
|
|
20
|
-
await this.removeCamera(cameraId);
|
|
21
|
+
this.api.deviceManager.on('cameraSelected', (cameraDevice) => {
|
|
22
|
+
this.configureCamera(cameraDevice);
|
|
21
23
|
});
|
|
22
|
-
this.api.deviceManager.
|
|
24
|
+
this.api.deviceManager.on('cameraDeselected', async (cameraId) => {
|
|
23
25
|
await this.removeCamera(cameraId);
|
|
24
26
|
});
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
stop() {
|
|
27
29
|
for (const [cameraId, analyzedCamera] of this.analyzedCameras) {
|
|
28
|
-
|
|
30
|
+
analyzedCamera.stop();
|
|
29
31
|
this.analyzedCameras.delete(cameraId);
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
|
-
|
|
33
|
-
for (const camera of cameras) {
|
|
34
|
-
await this.configureCamera(camera);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async configureCamera(cameraDevice) {
|
|
34
|
+
configureCamera(cameraDevice) {
|
|
38
35
|
this.logger.log('Configuring Camera:', cameraDevice.name);
|
|
39
|
-
const cameraPrebuffer = new
|
|
40
|
-
await cameraPrebuffer.start();
|
|
36
|
+
const cameraPrebuffer = new CameraVideoanalysis(this.api, cameraDevice, this.logger);
|
|
41
37
|
this.cameras.set(cameraDevice.id, cameraDevice);
|
|
42
38
|
this.analyzedCameras.set(cameraDevice.id, cameraPrebuffer);
|
|
43
39
|
}
|
|
@@ -45,12 +41,11 @@ class PamDiff extends types_1.BasePlugin {
|
|
|
45
41
|
const cameraDevice = this.cameras.get(cameraId);
|
|
46
42
|
if (cameraDevice) {
|
|
47
43
|
this.logger.log('Removing Camera:', cameraDevice.name);
|
|
48
|
-
|
|
44
|
+
this.analyzedCameras.get(cameraId)?.stop(true);
|
|
49
45
|
this.analyzedCameras.delete(cameraId);
|
|
50
46
|
this.cameras.delete(cameraId);
|
|
51
|
-
this.
|
|
47
|
+
this.api.storageController.removeCameraStorage(cameraId);
|
|
52
48
|
}
|
|
53
49
|
}
|
|
54
50
|
}
|
|
55
|
-
exports.PamDiff = PamDiff;
|
|
56
51
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIlD,MAAM,CAAC,OAAO,OAAO,OAAO;IAClB,O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AAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAEO,eAAe,CAAC,YAA0B;QAChD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;QAE1D,MAAM,eAAe,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAErF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;QAChD,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;IAC7D,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,QAAgB;QACzC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAEhD,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,kBAAkB,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;YAEvD,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/C,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACtC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9B,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;CACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
/// <reference path="../types/pam-diff.d.ts" />
|
|
2
|
-
/// <reference path="../types/pipe2pam.d.ts" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
|
-
import type { ChildProcess } from 'child_process';
|
|
5
|
-
import type P2P from 'pipe2pam';
|
|
6
1
|
import type PamDiff from 'pam-diff';
|
|
2
|
+
import type P2P from 'pipe2pam';
|
|
7
3
|
export interface VideoanalysisSession {
|
|
8
4
|
isActive(): boolean;
|
|
9
5
|
kill: (reason?: string) => void;
|
|
10
|
-
cp: ChildProcess;
|
|
11
6
|
pamDiff: PamDiff;
|
|
12
7
|
p2p: P2P;
|
|
13
8
|
}
|
package/dist/types.js
CHANGED
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAsBA,kDAAkD"}
|
package/package.json
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Pam Diff",
|
|
3
3
|
"name": "@camera.ui/camera-ui-pamdiff",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"description": "camera.ui pam diff plugin",
|
|
6
6
|
"author": "seydx (https://github.com/seydx/camera.ui)",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
|
+
"type": "module",
|
|
8
9
|
"scripts": {
|
|
9
10
|
"build": "rimraf dist && tsc",
|
|
10
11
|
"format": "prettier --write 'src/' --ignore-unknown --no-error-on-unmatched-pattern",
|
|
11
12
|
"lint": "eslint --fix --ext .js,.ts .",
|
|
12
13
|
"update": "updates --update ./",
|
|
13
14
|
"install-updates": "npm i --save",
|
|
14
|
-
"prepublishOnly": "npm run lint && npm run format && npm run build"
|
|
15
|
+
"prepublishOnly": "npm i --package-lock-only && npm run lint && npm run format && npm run build"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
|
-
"@camera.ui/types": "^0.0.22",
|
|
18
|
-
"node-addon-api": "^7.1.0",
|
|
19
18
|
"pam-diff": "^1.2.1",
|
|
20
|
-
"pipe2pam": "^0.7.1"
|
|
21
|
-
"pixel-change": "^1.1.0"
|
|
19
|
+
"pipe2pam": "^0.7.1"
|
|
22
20
|
},
|
|
23
21
|
"devDependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
26
|
-
"@types/
|
|
27
|
-
"@
|
|
28
|
-
"@typescript-eslint/
|
|
22
|
+
"@camera.ui/types": "^0.0.53",
|
|
23
|
+
"@rushstack/eslint-patch": "^1.10.4",
|
|
24
|
+
"@types/node": "^22.1.0",
|
|
25
|
+
"@types/ws": "^8.5.12",
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
|
27
|
+
"@typescript-eslint/parser": "^8.0.1",
|
|
29
28
|
"concurrently": "^8.2.2",
|
|
30
|
-
"eslint": "
|
|
29
|
+
"eslint": "8.57.0",
|
|
31
30
|
"eslint-config-prettier": "^9.1.0",
|
|
32
|
-
"eslint-plugin-prettier": "^5.1
|
|
33
|
-
"prettier": "^3.
|
|
34
|
-
"rimraf": "^
|
|
35
|
-
"typescript": "^5.
|
|
36
|
-
"updates": "^
|
|
31
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
32
|
+
"prettier": "^3.3.3",
|
|
33
|
+
"rimraf": "^6.0.1",
|
|
34
|
+
"typescript": "^5.5.4",
|
|
35
|
+
"updates": "^16.3.7"
|
|
37
36
|
},
|
|
38
37
|
"bugs": {
|
|
39
38
|
"url": "https://github.com/seydx/camera.ui/issues"
|
|
40
39
|
},
|
|
41
40
|
"engines": {
|
|
42
|
-
"camera.ui": ">=
|
|
41
|
+
"camera.ui": ">=0.0.1",
|
|
43
42
|
"node": ">=18.12.0"
|
|
44
43
|
},
|
|
45
44
|
"homepage": "https://github.com/seydx/camera.ui#readme",
|
|
@@ -54,5 +53,9 @@
|
|
|
54
53
|
"repository": {
|
|
55
54
|
"type": "git",
|
|
56
55
|
"url": "git+https://github.com/seydx/camera.ui.git"
|
|
56
|
+
},
|
|
57
|
+
"camera.ui": {
|
|
58
|
+
"extension": "motionDetection",
|
|
59
|
+
"dependencies": []
|
|
57
60
|
}
|
|
58
61
|
}
|
package/types/pipe2pam.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ declare module 'pipe2pam' {
|
|
|
5
5
|
pool?: number;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
9
|
interface Pipe2PamHeaders {
|
|
9
10
|
width: number;
|
|
10
11
|
height: number;
|
|
@@ -13,6 +14,7 @@ declare module 'pipe2pam' {
|
|
|
13
14
|
tupltype: string;
|
|
14
15
|
}
|
|
15
16
|
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
18
|
interface Pipe2PamData {
|
|
17
19
|
width: number;
|
|
18
20
|
height: number;
|
package/dist/contract.d.ts
DELETED
package/dist/contract.js
DELETED
package/dist/contract.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAmB;IAC5C,UAAU,EAAE,8BAA8B;IAC1C,SAAS,EAAE,iBAAiB;CAC7B,CAAC"}
|
package/dist/videoanalysis.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { PluginLogger, CameraDevice, CameraInput, CameraStorage } from '@camera.ui/types';
|
|
2
|
-
export declare class VideoanalysisService {
|
|
3
|
-
private cameraDevice;
|
|
4
|
-
private cameraStorage;
|
|
5
|
-
private logger;
|
|
6
|
-
private source;
|
|
7
|
-
private killed;
|
|
8
|
-
private stopped;
|
|
9
|
-
private ffmpegPath;
|
|
10
|
-
private videoanalysisSession?;
|
|
11
|
-
private watchdog?;
|
|
12
|
-
constructor(cameraDevice: CameraDevice, cameraStorage: CameraStorage, source: CameraInput, logger: PluginLogger);
|
|
13
|
-
start(): Promise<void>;
|
|
14
|
-
stop(kill?: boolean): Promise<void>;
|
|
15
|
-
kill(): Promise<void>;
|
|
16
|
-
restart(): Promise<void>;
|
|
17
|
-
reconfigure({ difference, percentage }: {
|
|
18
|
-
difference?: number;
|
|
19
|
-
percentage?: number;
|
|
20
|
-
}): Promise<void>;
|
|
21
|
-
private startVideoanalysis;
|
|
22
|
-
private reset;
|
|
23
|
-
private getCameraRegions;
|
|
24
|
-
private getLogPrefix;
|
|
25
|
-
}
|
package/dist/videoanalysis.js
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.VideoanalysisService = void 0;
|
|
7
|
-
const pipe2pam_1 = __importDefault(require("pipe2pam"));
|
|
8
|
-
const pam_diff_1 = __importDefault(require("pam-diff"));
|
|
9
|
-
const child_process_1 = require("child_process");
|
|
10
|
-
const constants_1 = require("./constants");
|
|
11
|
-
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
12
|
-
class VideoanalysisService {
|
|
13
|
-
cameraDevice;
|
|
14
|
-
cameraStorage;
|
|
15
|
-
logger;
|
|
16
|
-
source;
|
|
17
|
-
killed = false;
|
|
18
|
-
stopped = false;
|
|
19
|
-
ffmpegPath;
|
|
20
|
-
videoanalysisSession;
|
|
21
|
-
watchdog;
|
|
22
|
-
constructor(cameraDevice, cameraStorage, source, logger) {
|
|
23
|
-
this.cameraDevice = cameraDevice;
|
|
24
|
-
this.cameraStorage = cameraStorage;
|
|
25
|
-
this.logger = logger;
|
|
26
|
-
this.ffmpegPath = process.env.CAMERA_UI_FFMPEG_BINARY;
|
|
27
|
-
this.source = source;
|
|
28
|
-
this.cameraDevice.onPropertyChange('motionZones').subscribe(async () => {
|
|
29
|
-
this.logger.log(this.getLogPrefix(), 'Updating videoanalysis regions', this.cameraDevice.motionZones);
|
|
30
|
-
this.videoanalysisSession?.pamDiff.setRegions(this.getCameraRegions());
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
async start() {
|
|
34
|
-
try {
|
|
35
|
-
this.stopped = false;
|
|
36
|
-
this.logger.log(this.getLogPrefix(), 'Starting videoanalysis');
|
|
37
|
-
this.videoanalysisSession = await this.startVideoanalysis();
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
this.reset();
|
|
41
|
-
this.logger.error(this.getLogPrefix(), 'An error occured during starting videoanalysis!', error);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
async stop(kill) {
|
|
45
|
-
this.stopped = kill || false;
|
|
46
|
-
this.logger.log(this.getLogPrefix(), 'Stopping videoanalysis session');
|
|
47
|
-
this.reset();
|
|
48
|
-
}
|
|
49
|
-
async kill() {
|
|
50
|
-
this.killed = true;
|
|
51
|
-
await this.stop(true);
|
|
52
|
-
}
|
|
53
|
-
async restart() {
|
|
54
|
-
this.logger.log(this.getLogPrefix(), 'Restarting videoanalysis session in 5s...');
|
|
55
|
-
this.stop(true);
|
|
56
|
-
await sleep(5000);
|
|
57
|
-
if (!this.killed) {
|
|
58
|
-
await this.start();
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
this.logger.log(this.getLogPrefix(), 'Videoanalysis restart aborted, plugin is killed!');
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
async reconfigure({ difference, percentage }) {
|
|
65
|
-
this.logger.log(this.getLogPrefix(), 'Reconfiguring videoanalysis...');
|
|
66
|
-
if (this.videoanalysisSession) {
|
|
67
|
-
percentage = percentage || this.videoanalysisSession.pamDiff.percent;
|
|
68
|
-
difference = difference || this.videoanalysisSession.pamDiff.difference;
|
|
69
|
-
this.logger.log(this.getLogPrefix(), `New configuration: ${percentage}% / ${difference}`);
|
|
70
|
-
this.videoanalysisSession.pamDiff.setPercent(percentage);
|
|
71
|
-
this.videoanalysisSession.pamDiff.setDifference(difference);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
async startVideoanalysis() {
|
|
75
|
-
if (this.videoanalysisSession) {
|
|
76
|
-
return this.videoanalysisSession;
|
|
77
|
-
}
|
|
78
|
-
let errors = [];
|
|
79
|
-
let motionTimeout;
|
|
80
|
-
let ffmpegTimeout;
|
|
81
|
-
let isActive = true;
|
|
82
|
-
const ffmpegArguments = [
|
|
83
|
-
'-hide_banner',
|
|
84
|
-
'-v',
|
|
85
|
-
'error',
|
|
86
|
-
//'-hwaccel',
|
|
87
|
-
//'auto',
|
|
88
|
-
'-fflags',
|
|
89
|
-
'nobuffer',
|
|
90
|
-
'-flags',
|
|
91
|
-
'low_delay',
|
|
92
|
-
'-timeout',
|
|
93
|
-
'5000000',
|
|
94
|
-
'-user_agent',
|
|
95
|
-
'camera.ui/pamdiff',
|
|
96
|
-
'-fflags',
|
|
97
|
-
'+genpts',
|
|
98
|
-
'-rtsp_transport',
|
|
99
|
-
'tcp',
|
|
100
|
-
'-i',
|
|
101
|
-
this.source.urls.rtsp.single,
|
|
102
|
-
'-an',
|
|
103
|
-
'-vcodec',
|
|
104
|
-
'pam',
|
|
105
|
-
'-pix_fmt',
|
|
106
|
-
constants_1.FFMPEG_MODE,
|
|
107
|
-
'-f',
|
|
108
|
-
'image2pipe',
|
|
109
|
-
'-vf',
|
|
110
|
-
`fps=${constants_1.FFMPEG_FPS},scale=${constants_1.FFMPEG_RESOLUTION}`,
|
|
111
|
-
'pipe:1',
|
|
112
|
-
];
|
|
113
|
-
const difference = await this.cameraStorage.getValue(`${this.source.name}.difference`);
|
|
114
|
-
const percent = await this.cameraStorage.getValue(`${this.source.name}.percentage`);
|
|
115
|
-
const regions = this.getCameraRegions();
|
|
116
|
-
this.logger.debug(this.getLogPrefix(), `Videoanalysis command: ${this.ffmpegPath} ${ffmpegArguments.join(' ')}`);
|
|
117
|
-
this.logger.debug(this.getLogPrefix(), 'Videoanalysis configuration: ', JSON.stringify({ difference, percent, regions }));
|
|
118
|
-
const p2p = new pipe2pam_1.default();
|
|
119
|
-
const pamDiff = new pam_diff_1.default({
|
|
120
|
-
difference,
|
|
121
|
-
percent,
|
|
122
|
-
regions,
|
|
123
|
-
response: 'blobs',
|
|
124
|
-
});
|
|
125
|
-
const kill = () => {
|
|
126
|
-
errors = [];
|
|
127
|
-
isActive = false;
|
|
128
|
-
cp?.kill('SIGKILL');
|
|
129
|
-
clearTimeout(ffmpegTimeout);
|
|
130
|
-
};
|
|
131
|
-
const restartWatchdog = () => {
|
|
132
|
-
clearTimeout(this.watchdog);
|
|
133
|
-
this.watchdog = setTimeout(() => {
|
|
134
|
-
this.logger.error(this.getLogPrefix(), 'Videoanalysis session timed out!');
|
|
135
|
-
kill();
|
|
136
|
-
}, 30000);
|
|
137
|
-
};
|
|
138
|
-
const resetTimeout = () => {
|
|
139
|
-
clearTimeout(motionTimeout);
|
|
140
|
-
motionTimeout = setTimeout(() => {
|
|
141
|
-
this.cameraDevice.updateState('motion', { state: false }).catch();
|
|
142
|
-
}, 30000);
|
|
143
|
-
};
|
|
144
|
-
pamDiff.on('diff', (data) => {
|
|
145
|
-
const motionEvent = data.trigger.map((zone) => {
|
|
146
|
-
return {
|
|
147
|
-
name: zone.name,
|
|
148
|
-
percentage: zone.percent,
|
|
149
|
-
blobs: zone.blobs,
|
|
150
|
-
};
|
|
151
|
-
});
|
|
152
|
-
this.logger.log(this.getLogPrefix(), 'Motion detected!', JSON.stringify(motionEvent, null, 2));
|
|
153
|
-
this.cameraDevice.updateState('motion', { state: true }).catch();
|
|
154
|
-
resetTimeout();
|
|
155
|
-
});
|
|
156
|
-
pamDiff.on('data', () => {
|
|
157
|
-
restartWatchdog();
|
|
158
|
-
isActive = true;
|
|
159
|
-
});
|
|
160
|
-
const cp = (0, child_process_1.spawn)(this.ffmpegPath, ffmpegArguments, {
|
|
161
|
-
env: process.env,
|
|
162
|
-
});
|
|
163
|
-
cp.stdout?.pipe(p2p).pipe(pamDiff);
|
|
164
|
-
cp.stderr?.on('data', (data) => {
|
|
165
|
-
data
|
|
166
|
-
.toString()
|
|
167
|
-
.split('\n')
|
|
168
|
-
.forEach((line) => {
|
|
169
|
-
if (line && line !== '')
|
|
170
|
-
errors.push(line);
|
|
171
|
-
});
|
|
172
|
-
errors = errors.slice(-3);
|
|
173
|
-
});
|
|
174
|
-
cp.on('exit', (code, signal) => {
|
|
175
|
-
if (code === 1) {
|
|
176
|
-
errors.unshift(`FFMPEG videoanalysis process exited with error! (${signal})`);
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
cp.on('close', () => {
|
|
180
|
-
if (errors.includes('FFMPEG videoanalysis process exited with error!')) {
|
|
181
|
-
errors.forEach((error) => this.logger.error(this.getLogPrefix(), error));
|
|
182
|
-
}
|
|
183
|
-
this.logger.warn(this.getLogPrefix(), 'FFMPEG videoanalysis process closed');
|
|
184
|
-
kill();
|
|
185
|
-
setTimeout(() => {
|
|
186
|
-
if (!this.stopped && !this.killed) {
|
|
187
|
-
this.restart();
|
|
188
|
-
}
|
|
189
|
-
}, 1500);
|
|
190
|
-
});
|
|
191
|
-
restartWatchdog();
|
|
192
|
-
return {
|
|
193
|
-
isActive() {
|
|
194
|
-
return isActive;
|
|
195
|
-
},
|
|
196
|
-
kill,
|
|
197
|
-
cp,
|
|
198
|
-
pamDiff,
|
|
199
|
-
p2p,
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
reset() {
|
|
203
|
-
this.logger.debug(this.getLogPrefix(), 'Resetting videoanalysis');
|
|
204
|
-
this.videoanalysisSession?.kill();
|
|
205
|
-
this.videoanalysisSession = undefined;
|
|
206
|
-
clearTimeout(this.watchdog);
|
|
207
|
-
this.watchdog = undefined;
|
|
208
|
-
}
|
|
209
|
-
getCameraRegions() {
|
|
210
|
-
const cameraZones = this.cameraDevice.motionZones.length ? this.cameraDevice.motionZones : constants_1.DEFAULT_ZONE;
|
|
211
|
-
return cameraZones.map((zone) => {
|
|
212
|
-
return {
|
|
213
|
-
name: zone.name,
|
|
214
|
-
polygon: zone.regions.flatMap((region) => region.coords.map((coord) => ({ x: coord.points[0], y: coord.points[1] }))),
|
|
215
|
-
};
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
getLogPrefix() {
|
|
219
|
-
return `${this.cameraDevice.name} (${this.source.name}):`;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
exports.VideoanalysisService = VideoanalysisService;
|
|
223
|
-
//# sourceMappingURL=videoanalysis.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"videoanalysis.js","sourceRoot":"","sources":["../src/videoanalysis.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA2B;AAC3B,wDAA+B;AAC/B,iDAAyD;AAEzD,2CAAuF;AAKvF,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAE/F,MAAa,oBAAoB;IACvB,YAAY,CAAe;IAC3B,aAAa,CAAgB;IAC7B,MAAM,CAAe;IACrB,MAAM,CAAc;IAEpB,MAAM,GAAG,KAAK,CAAC;IACf,OAAO,GAAG,KAAK,CAAC;IAChB,UAAU,CAAS;IAEnB,oBAAoB,CAAwB;IAC5C,QAAQ,CAAkB;IAElC,YAAY,YAA0B,EAAE,aAA4B,EAAE,MAAmB,EAAE,MAAoB;QAC7G,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAwB,CAAC;QACvD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;YACrE,IAAI,CAAC,M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