Skip to content

Commit

Permalink
amcrest: fix object detector types
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Mar 27, 2024
1 parent de645df commit dce76b5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plugins/amcrest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/amcrest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/amcrest",
"version": "0.0.136",
"version": "0.0.137",
"description": "Amcrest Plugin for Scrypted",
"author": "Scrypted",
"license": "Apache",
Expand Down
17 changes: 15 additions & 2 deletions plugins/amcrest/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ffmpegLogInitialOutput } from '@scrypted/common/src/media-helpers';
import { readLength } from "@scrypted/common/src/read-stream";
import sdk, { Camera, DeviceCreatorSettings, DeviceInformation, FFmpegInput, Intercom, Lock, MediaObject, MediaStreamOptions, ObjectsDetected, Reboot, RequestPictureOptions, RequestRecordingStreamOptions, ResponseMediaStreamOptions, ScryptedDeviceType, ScryptedInterface, ScryptedMimeTypes, Setting, VideoCameraConfiguration, VideoRecorder } from "@scrypted/sdk";
import sdk, { Camera, DeviceCreatorSettings, DeviceInformation, FFmpegInput, Intercom, Lock, MediaObject, MediaStreamOptions, ObjectDetectionTypes, ObjectDetector, ObjectsDetected, Reboot, RequestPictureOptions, RequestRecordingStreamOptions, ResponseMediaStreamOptions, ScryptedDeviceType, ScryptedInterface, ScryptedMimeTypes, Setting, VideoCameraConfiguration, VideoRecorder } from "@scrypted/sdk";
import child_process, { ChildProcess } from 'child_process';
import { PassThrough, Readable, Stream } from "stream";
import { OnvifIntercom } from "../../onvif/src/onvif-intercom";
Expand All @@ -22,7 +22,7 @@ function findValue(blob: string, prefix: string, key: string) {
return parts[1];
}

class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration, Camera, Intercom, Lock, VideoRecorder, Reboot {
class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration, Camera, Intercom, Lock, VideoRecorder, Reboot, ObjectDetector {
eventStream: Stream;
cp: ChildProcess;
client: AmcrestCameraClient;
Expand Down Expand Up @@ -260,6 +260,19 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
return events;
}

async getDetectionInput(detectionId: string, eventId?: any): Promise<MediaObject> {
return;
}

async getObjectTypes(): Promise<ObjectDetectionTypes> {
return {
classes: [
'person',
'car',
],
}
}

async getOtherSettings(): Promise<Setting[]> {
const ret = await super.getOtherSettings();
ret.push(
Expand Down

0 comments on commit dce76b5

Please sign in to comment.