diff --git a/sdk/package-lock.json b/sdk/package-lock.json index 7baba1eaf..dfa2e558d 100644 --- a/sdk/package-lock.json +++ b/sdk/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/sdk", - "version": "0.3.50", + "version": "0.3.51", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/sdk", - "version": "0.3.50", + "version": "0.3.51", "license": "ISC", "dependencies": { "@babel/preset-typescript": "^7.24.7", diff --git a/sdk/package.json b/sdk/package.json index d489ecc41..4eee03472 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/sdk", - "version": "0.3.50", + "version": "0.3.51", "description": "", "main": "dist/src/index.js", "exports": { diff --git a/sdk/types/package-lock.json b/sdk/types/package-lock.json index 2e0ae9600..cdf5c900e 100644 --- a/sdk/types/package-lock.json +++ b/sdk/types/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/types", - "version": "0.3.46", + "version": "0.3.47", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/types", - "version": "0.3.46", + "version": "0.3.47", "license": "ISC", "devDependencies": { "@types/node": "^22.1.0", diff --git a/sdk/types/package.json b/sdk/types/package.json index bbd56a646..372b656ac 100644 --- a/sdk/types/package.json +++ b/sdk/types/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/types", - "version": "0.3.46", + "version": "0.3.47", "description": "", "main": "dist/index.js", "author": "", diff --git a/sdk/types/scrypted_python/scrypted_sdk/types.py b/sdk/types/scrypted_python/scrypted_sdk/types.py index 4d3f1979b..ad76fe99b 100644 --- a/sdk/types/scrypted_python/scrypted_sdk/types.py +++ b/sdk/types/scrypted_python/scrypted_sdk/types.py @@ -358,11 +358,11 @@ class RequestVideoStreamOptions(TypedDict): fps: float h264Info: H264Info height: float - idrIntervalMillis: float # Key Frame interval in milliseconds. keyframeInterval: float # Key Frame interval in frames. maxBitrate: float minBitrate: float profile: str + quality: float width: float class ScryptedDeviceAccessControl(TypedDict): @@ -378,6 +378,29 @@ class VideoResource(TypedDict): thumbnail: Resource video: Resource +class VideoStreamConfiguration(TypedDict): + + bitrate: float + bitrateControl: Any | Any + bitrateControls: list[str] + bitrateRange: tuple[float, float] + codec: str + codecs: list[str] + fps: float + fpsRange: tuple[float, float] + h264Info: H264Info + height: float + keyframeInterval: float # Key Frame interval in frames. + keyframeIntervalRange: tuple[float, float] + maxBitrate: float + minBitrate: float + profile: str + profiles: list[str] + quality: float + qualityRange: tuple[float, float] + resolutions: list[tuple[float, float]] + width: float + class VideoStreamOptions(TypedDict): bitrate: float @@ -386,11 +409,11 @@ class VideoStreamOptions(TypedDict): fps: float h264Info: H264Info height: float - idrIntervalMillis: float # Key Frame interval in milliseconds. keyframeInterval: float # Key Frame interval in frames. maxBitrate: float minBitrate: float profile: str + quality: float width: float class ImageFormat(TypedDict): @@ -596,6 +619,11 @@ class MediaStatus(TypedDict): metadata: Any position: float +class MediaStreamConfiguration(TypedDict): + + audio: AudioStreamOptions + video: VideoStreamConfiguration + class MediaStreamOptions(TypedDict): """Options passed to VideoCamera.getVideoStream to request specific media formats. The audio/video properties may be omitted to indicate no audio/video is available when calling getVideoStreamOptions or no audio/video is requested when calling getVideoStream.""" @@ -1525,7 +1553,7 @@ class VideoCamera: class VideoCameraConfiguration: - async def setVideoStreamOptions(self, options: MediaStreamOptions) -> None: + async def setVideoStreamOptions(self, options: MediaStreamOptions) -> MediaStreamConfiguration: pass diff --git a/sdk/types/src/types.input.ts b/sdk/types/src/types.input.ts index e310fcee6..28158cd19 100644 --- a/sdk/types/src/types.input.ts +++ b/sdk/types/src/types.input.ts @@ -453,10 +453,8 @@ export interface VideoStreamOptions { minBitrate?: number; maxBitrate?: number; fps?: number; - /** - * Key Frame interval in milliseconds. - */ - idrIntervalMillis?: number; + // what the heck is this? + quality?: number; /** * Key Frame interval in frames. */ @@ -670,8 +668,153 @@ export interface VideoCamera { getVideoStreamOptions(): Promise; } +// { +// "qualityRange": { +// "min": 0, +// "max": 5 +// }, +// "H264": { +// "resolutionsAvailable": [ +// { +// "width": 1280, +// "height": 720 +// }, +// { +// "width": 1920, +// "height": 1080 +// }, +// { +// "width": 2688, +// "height": 1520 +// }, +// { +// "width": 3072, +// "height": 1728 +// }, +// { +// "width": 3840, +// "height": 2160 +// } +// ], +// "govLengthRange": { +// "min": 1, +// "max": 400 +// }, +// "frameRateRange": { +// "min": 1, +// "max": 30 +// }, +// "encodingIntervalRange": { +// "min": 1, +// "max": 1 +// }, +// "H264ProfilesSupported": [ +// "Baseline", +// "Main", +// "High" +// ] +// }, +// "extension": { +// "H264": { +// "resolutionsAvailable": [ +// { +// "width": 1280, +// "height": 720 +// }, +// { +// "width": 1920, +// "height": 1080 +// }, +// { +// "width": 2688, +// "height": 1520 +// }, +// { +// "width": 3072, +// "height": 1728 +// }, +// { +// "width": 3840, +// "height": 2160 +// } +// ], +// "govLengthRange": { +// "min": 1, +// "max": 400 +// }, +// "frameRateRange": { +// "min": 1, +// "max": 30 +// }, +// "encodingIntervalRange": { +// "min": 1, +// "max": 1 +// }, +// "H264ProfilesSupported": [ +// "Baseline", +// "Main", +// "High" +// ], +// "bitrateRange": { +// "min": 32, +// "max": 16384 +// } +// } +// } +// } +export interface VideoStreamConfiguration extends VideoStreamOptions { + resolutions?: [number, number][]; + fpsRange?: [number, number]; + keyframeIntervalRange?: [number, number]; + bitrateRange?: [number, number]; + qualityRange?: [number, number]; + profiles?: string[]; + bitrateControls?: string[]; + codecs?: string[]; +} + +// audio streams seem more restrictive around what can be configured. +// { +// "options": [ +// { +// "encoding": "G711", +// "bitrateList": { +// "items": 64 +// }, +// "sampleRateList": { +// "items": 8 +// } +// }, +// { +// "encoding": "G726", +// "bitrateList": { +// "items": 16 +// }, +// "sampleRateList": { +// "items": 8 +// } +// } +// ] +// } + +export interface AudioStreamEncoding { + codec: string; + birates: number[]; + sampleRates: number[]; +} + +export interface AudioStreamConfiguration extends AudioStreamOptions { + encodings?: AudioStreamEncoding[]; +} + +export interface MediaStreamConfiguration { + video?: VideoStreamConfiguration; + audio?: AudioStreamOptions; +} + +// this is really just a mapping around onvif. export interface VideoCameraConfiguration { - setVideoStreamOptions(options: MediaStreamOptions): Promise; + setVideoStreamOptions(options: MediaStreamOptions): Promise; } export interface RequestRecordingStreamOptions extends RequestMediaStreamOptions {