videoanalysis: add pipeline hang logging

This commit is contained in:
Koushik Dutta
2023-07-02 08:47:10 -07:00
parent 5c7b67c973
commit cc0283ef39
3 changed files with 22 additions and 16 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/objectdetector",
"version": "0.0.152",
"version": "0.0.153",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/objectdetector",
"version": "0.0.152",
"version": "0.0.153",
"license": "Apache-2.0",
"dependencies": {
"@scrypted/common": "file:../../common",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/objectdetector",
"version": "0.0.152",
"version": "0.0.153",
"description": "Scrypted Video Analysis Plugin. Installed alongside a detection service like OpenCV or TensorFlow.",
"author": "Scrypted",
"license": "Apache-2.0",

View File

@@ -279,7 +279,7 @@ class ObjectDetectionMixin extends SettingsMixinDeviceBase<VideoCamera & Camera
}
}
getCurrrentFrameGenerator(snapshotPipeline: boolean) {
getCurrentFrameGenerator(snapshotPipeline: boolean) {
let frameGenerator: string = this.frameGenerator;
if (!this.hasMotionType && snapshotPipeline) {
frameGenerator = 'Snapshot';
@@ -356,18 +356,24 @@ class ObjectDetectionMixin extends SettingsMixinDeviceBase<VideoCamera & Camera
// ask rebroadcast to mute audio, not needed.
audio: null,
});
updatePipelineStatus('generateVideoFrames');
return await videoFrameGenerator.generateVideoFrames(stream, {
queue: 0,
fps: this.hasMotionType ? 4 : undefined,
// this seems to be unused now?
resize: this.model?.inputSize ? {
width: this.model.inputSize[0],
height: this.model.inputSize[1],
} : undefined,
// this seems to be unused now?
format: this.model?.inputFormat,
});
try {
return await videoFrameGenerator.generateVideoFrames(stream, {
queue: 0,
fps: this.hasMotionType ? 4 : undefined,
// this seems to be unused now?
resize: this.model?.inputSize ? {
width: this.model.inputSize[0],
height: this.model.inputSize[1],
} : undefined,
// this seems to be unused now?
format: this.model?.inputFormat,
});
}
finally {
updatePipelineStatus('waiting first result');
}
}
}
@@ -419,7 +425,7 @@ class ObjectDetectionMixin extends SettingsMixinDeviceBase<VideoCamera & Camera
let longObjectDetectionWarning = false;
const frameGenerator = this.getCurrrentFrameGenerator(options.snapshotPipeline);
const frameGenerator = this.getCurrentFrameGenerator(options.snapshotPipeline);
for await (const detected of
await sdk.connectRPCObject(
await this.objectDetection.generateObjectDetections(