@apocaliss92/nodelink-js 0.4.21 → 0.4.23
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/BaichuanVideoStream-NTIGPHYJ.js +7 -0
- package/dist/{DiagnosticsTools-HO3VI6D5.js → DiagnosticsTools-ILDDJZL7.js} +3 -3
- package/dist/{chunk-S2UTGNFN.js → chunk-AHY4L7JI.js} +2 -2
- package/dist/{chunk-C57QV7IL.js → chunk-GVWJGQPT.js} +5 -1
- package/dist/chunk-GVWJGQPT.js.map +1 -0
- package/dist/{chunk-EZ7WNPLB.js → chunk-P4X5OU25.js} +521 -19
- package/dist/chunk-P4X5OU25.js.map +1 -0
- package/dist/cli/rtsp-server.cjs +506 -14
- package/dist/cli/rtsp-server.cjs.map +1 -1
- package/dist/cli/rtsp-server.js +3 -3
- package/dist/index.cjs +534 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +327 -1
- package/dist/index.d.ts +343 -0
- package/dist/index.js +31 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/BaichuanVideoStream-HGPU2MZ3.js +0 -7
- package/dist/chunk-C57QV7IL.js.map +0 -1
- package/dist/chunk-EZ7WNPLB.js.map +0 -1
- /package/dist/{BaichuanVideoStream-HGPU2MZ3.js.map → BaichuanVideoStream-NTIGPHYJ.js.map} +0 -0
- /package/dist/{DiagnosticsTools-HO3VI6D5.js.map → DiagnosticsTools-ILDDJZL7.js.map} +0 -0
- /package/dist/{chunk-S2UTGNFN.js.map → chunk-AHY4L7JI.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -151,6 +151,50 @@ export declare interface AiDenoiseConfig {
|
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
/**
|
|
155
|
+
* AI-detection per-type config helpers (cmd_id 342 GET / 345 SET full).
|
|
156
|
+
*
|
|
157
|
+
* Each AI type (people, dog_cat, vehicle, face, package, ...) carries its
|
|
158
|
+
* own `<AiDetectCfg>` block:
|
|
159
|
+
*
|
|
160
|
+
* <AiDetectCfg version="1.1">
|
|
161
|
+
* <chn>0</chn>
|
|
162
|
+
* <type>people</type>
|
|
163
|
+
* <sensitivity>60</sensitivity>
|
|
164
|
+
* <stayTime>0</stayTime>
|
|
165
|
+
* <minTargetHeight>0.5</minTargetHeight>
|
|
166
|
+
* <minTargetWidth>0.5</minTargetWidth>
|
|
167
|
+
* <maxTargetHeight>0.5</maxTargetHeight>
|
|
168
|
+
* <maxTargetWidth>0.5</maxTargetWidth>
|
|
169
|
+
* <width>60</width> <height>33</height>
|
|
170
|
+
* <area>{base64 width*height bitmap}</area>
|
|
171
|
+
* </AiDetectCfg>
|
|
172
|
+
*
|
|
173
|
+
* cmd_id=343 (`SetAiAlarm`) only edits sensitivity + stayTime. The full
|
|
174
|
+
* setter is cmd_id=345 — it accepts the entire block including the area
|
|
175
|
+
* bitmap and target size thresholds. The bitmap layout is identical to
|
|
176
|
+
* the motion-detection `<valueTable>` so we reuse the motion-zone
|
|
177
|
+
* helpers for encode/decode.
|
|
178
|
+
*
|
|
179
|
+
* Target size fields are camera-side fractions in [0,1] of the frame.
|
|
180
|
+
*/
|
|
181
|
+
export declare interface AiDetectCfgZone {
|
|
182
|
+
chn: number;
|
|
183
|
+
type: string;
|
|
184
|
+
sensitivity: number;
|
|
185
|
+
stayTime: number;
|
|
186
|
+
minTargetWidth: number;
|
|
187
|
+
minTargetHeight: number;
|
|
188
|
+
maxTargetWidth: number;
|
|
189
|
+
maxTargetHeight: number;
|
|
190
|
+
/** Grid columns (width) for the `<area>` bitmap. */
|
|
191
|
+
width: number;
|
|
192
|
+
/** Grid rows (height) for the `<area>` bitmap. */
|
|
193
|
+
height: number;
|
|
194
|
+
/** Raw base64 area bitmap (use `decodeMotionScopeBitmap` to expand). */
|
|
195
|
+
area: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
154
198
|
export declare interface AIDetectionState {
|
|
155
199
|
alarm_state: number;
|
|
156
200
|
support: number;
|
|
@@ -2283,6 +2327,8 @@ export declare const BC_CMD_ID_GET_SIREN_STATUS = 547;
|
|
|
2283
2327
|
|
|
2284
2328
|
export declare const BC_CMD_ID_GET_SLEEP_STATE = 574;
|
|
2285
2329
|
|
|
2330
|
+
export declare const BC_CMD_ID_GET_SNAPSHOT = 109;
|
|
2331
|
+
|
|
2286
2332
|
export declare const BC_CMD_ID_GET_STREAM_INFO_LIST = 146;
|
|
2287
2333
|
|
|
2288
2334
|
export declare const BC_CMD_ID_GET_SUPPORT = 199;
|
|
@@ -2291,6 +2337,8 @@ export declare const BC_CMD_ID_GET_SYSTEM_GENERAL = 104;
|
|
|
2291
2337
|
|
|
2292
2338
|
export declare const BC_CMD_ID_GET_TIMELAPSE_CFG = 319;
|
|
2293
2339
|
|
|
2340
|
+
export declare const BC_CMD_ID_GET_UID = 114;
|
|
2341
|
+
|
|
2294
2342
|
export declare const BC_CMD_ID_GET_VERSION_INFO = 80;
|
|
2295
2343
|
|
|
2296
2344
|
export declare const BC_CMD_ID_GET_VIDEO_INPUT = 26;
|
|
@@ -4198,6 +4246,12 @@ export declare function decideSleepInferenceTransition(input: SleepInferenceInpu
|
|
|
4198
4246
|
*/
|
|
4199
4247
|
export declare function decideVideoclipTranscodeMode(headers: Record<string, string | string[] | undefined>, forceMode?: VideoclipTranscodeMode): VideoclipModeDecision;
|
|
4200
4248
|
|
|
4249
|
+
/**
|
|
4250
|
+
* Parse an `<AiDetectCfg>` response body (cmd_id=342) into a typed zone.
|
|
4251
|
+
* Throws if the required fields aren't present.
|
|
4252
|
+
*/
|
|
4253
|
+
export declare function decodeAiDetectCfg(xml: string): AiDetectCfgZone;
|
|
4254
|
+
|
|
4201
4255
|
export declare function decodeHeader(buf: AnyBuffer): {
|
|
4202
4256
|
header: BaichuanHeader;
|
|
4203
4257
|
headerLen: number;
|
|
@@ -4221,6 +4275,31 @@ export declare function decodeHeader(buf: AnyBuffer): {
|
|
|
4221
4275
|
*/
|
|
4222
4276
|
export declare function decodeMotionScopeBitmap(valueTable: string, columns: number, rows: number, width?: number, height?: number): MotionZoneScope;
|
|
4223
4277
|
|
|
4278
|
+
/**
|
|
4279
|
+
* Parse the full `<Shelter>` block (the cmd_id=52 response body) into a
|
|
4280
|
+
* normalized {@link PrivacyMaskZones} structure with 0..1 coordinates.
|
|
4281
|
+
*
|
|
4282
|
+
* Accepts both the trimmed `<body>...</body>` payload and the raw XML
|
|
4283
|
+
* including the `<?xml?>` declaration.
|
|
4284
|
+
*/
|
|
4285
|
+
export declare function decodePrivacyMaskZones(xml: string): PrivacyMaskZones;
|
|
4286
|
+
|
|
4287
|
+
/**
|
|
4288
|
+
* Decode a single wire coordinate into its `{pixel, canvas}` pair.
|
|
4289
|
+
* Zero values are sentinel "uninitialized" and surface as `canvas=0`.
|
|
4290
|
+
*/
|
|
4291
|
+
export declare function decodeShelterCoord(value: number): {
|
|
4292
|
+
pixel: number;
|
|
4293
|
+
canvas: number;
|
|
4294
|
+
};
|
|
4295
|
+
|
|
4296
|
+
/**
|
|
4297
|
+
* E1 Zoom default canvas (camera-observed). Used as a fallback when the
|
|
4298
|
+
* GET response carries no rectangles to extract canvas dims from. Caller
|
|
4299
|
+
* can always override via the explicit `canvas` argument.
|
|
4300
|
+
*/
|
|
4301
|
+
export declare const DEFAULT_SHELTER_CANVAS: ShelterCanvas;
|
|
4302
|
+
|
|
4224
4303
|
/**
|
|
4225
4304
|
* AES key derivation used by Reolink:
|
|
4226
4305
|
* keyString = md5_str_modern(`${nonce}-${password}`).slice(0,16)
|
|
@@ -4725,6 +4804,33 @@ export declare function encodeHeader(h: Omit<BaichuanHeader, "magic"> & {
|
|
|
4725
4804
|
*/
|
|
4726
4805
|
export declare function encodeMotionScopeBitmap(scope: MotionZoneScope): string;
|
|
4727
4806
|
|
|
4807
|
+
/**
|
|
4808
|
+
* Build the `<sensitivityInfoList>` XML fragment from the typed bands.
|
|
4809
|
+
* Bands are emitted in id-ascending order; out-of-range scalars are
|
|
4810
|
+
* clamped to the firmware-accepted ranges.
|
|
4811
|
+
*/
|
|
4812
|
+
export declare function encodeMotionSensitivityListXml(bands: MotionSensitivityBand[]): string;
|
|
4813
|
+
|
|
4814
|
+
/**
|
|
4815
|
+
* Encode a `(pixel, canvas)` pair into the camera wire value.
|
|
4816
|
+
* Negative inputs are clamped to 0; values are floored to 16-bit pixels.
|
|
4817
|
+
*/
|
|
4818
|
+
export declare function encodeShelterCoord(pixel: number, canvas: number): number;
|
|
4819
|
+
|
|
4820
|
+
/**
|
|
4821
|
+
* Build the `<shelterList>` XML fragment for the cmd_id=53 SetMask payload.
|
|
4822
|
+
* The camera always expects exactly `maxNum` `<Shelter>` entries — missing
|
|
4823
|
+
* ones get padded with disabled zero-rects, matching what the camera ships
|
|
4824
|
+
* on the read side.
|
|
4825
|
+
*/
|
|
4826
|
+
export declare function encodeShelterListXml(rects: ShelterRect[], canvas: ShelterCanvas, maxNum: number): string;
|
|
4827
|
+
|
|
4828
|
+
/**
|
|
4829
|
+
* Build the `<trackShelterList>` fragment. PTZ-tracking masks carry their
|
|
4830
|
+
* anchor preset via `pPos/tPos/zPos`; -1 marks the slot as unset.
|
|
4831
|
+
*/
|
|
4832
|
+
export declare function encodeTrackShelterListXml(rects: TrackShelterRect[], canvas: ShelterCanvas, maxNum: number): string;
|
|
4833
|
+
|
|
4728
4834
|
/**
|
|
4729
4835
|
* Reply from `getEncOptions` — the set of allowable values for `setEnc`,
|
|
4730
4836
|
* derived from `getStreamInfoList`. Use this to validate user input or
|
|
@@ -4846,6 +4952,12 @@ export declare type EventsResponse = {
|
|
|
4846
4952
|
entries: Array<ReolinkCmdResponseExt<JsonValue> | undefined>;
|
|
4847
4953
|
};
|
|
4848
4954
|
|
|
4955
|
+
/**
|
|
4956
|
+
* Extract the camera canvas dimensions from the first non-empty rectangle
|
|
4957
|
+
* in the lists. Returns `DEFAULT_SHELTER_CANVAS` if every coord is zero.
|
|
4958
|
+
*/
|
|
4959
|
+
export declare function extractCanvasFromShelterXml(xml: string): ShelterCanvas;
|
|
4960
|
+
|
|
4849
4961
|
export declare function extractH264ParamSetsFromAccessUnit(annexB: Buffer): {
|
|
4850
4962
|
sps?: Buffer;
|
|
4851
4963
|
pps?: Buffer;
|
|
@@ -5831,6 +5943,41 @@ export declare interface MotionEvent {
|
|
|
5831
5943
|
source?: "md" | "pir" | "unknown";
|
|
5832
5944
|
}
|
|
5833
5945
|
|
|
5946
|
+
/**
|
|
5947
|
+
* Motion-detection per-time-band sensitivity schedule helper.
|
|
5948
|
+
*
|
|
5949
|
+
* Reolink's GetMdAlarm response (cmd_id=46) carries an array of
|
|
5950
|
+
* `<sensitivityInfo>` entries inside `<sensitivityInfoList>`:
|
|
5951
|
+
*
|
|
5952
|
+
* <sensitivityInfoList>
|
|
5953
|
+
* <sensitivityInfo>
|
|
5954
|
+
* <id>0</id>
|
|
5955
|
+
* <sensitivity>10</sensitivity>
|
|
5956
|
+
* <beginHour>0</beginHour> <beginMinute>0</beginMinute>
|
|
5957
|
+
* <endHour>6</endHour> <endMinute>0</endMinute>
|
|
5958
|
+
* </sensitivityInfo>
|
|
5959
|
+
* ... up to 4 bands by default ...
|
|
5960
|
+
* </sensitivityInfoList>
|
|
5961
|
+
*
|
|
5962
|
+
* The camera-wide default lives in `<sensInfoNew><sensitivityDefault>`.
|
|
5963
|
+
* This helper builds the `<sensitivityInfoList>` fragment used by the
|
|
5964
|
+
* cmd_id=47 SetMdAlarm payload as part of a read-modify-write flow.
|
|
5965
|
+
*/
|
|
5966
|
+
export declare interface MotionSensitivityBand {
|
|
5967
|
+
/** 0-based band id (camera assigns 0..N-1). */
|
|
5968
|
+
id: number;
|
|
5969
|
+
/** Sensitivity for this band, 0..50 (higher = more sensitive). */
|
|
5970
|
+
sensitivity: number;
|
|
5971
|
+
/** Band start hour, 0..23. */
|
|
5972
|
+
beginHour: number;
|
|
5973
|
+
/** Band start minute, 0..59. */
|
|
5974
|
+
beginMinute: number;
|
|
5975
|
+
/** Band end hour, 0..23. */
|
|
5976
|
+
endHour: number;
|
|
5977
|
+
/** Band end minute, 0..59. */
|
|
5978
|
+
endMinute: number;
|
|
5979
|
+
}
|
|
5980
|
+
|
|
5834
5981
|
/**
|
|
5835
5982
|
* Motion-detection zone grid helpers.
|
|
5836
5983
|
*
|
|
@@ -6116,6 +6263,20 @@ export declare function parseRecordingFileName(fileName: string): ParsedRecordin
|
|
|
6116
6263
|
|
|
6117
6264
|
export declare function parseSupportXml(xml: string): SupportInfo | undefined;
|
|
6118
6265
|
|
|
6266
|
+
/**
|
|
6267
|
+
* Patch an existing cmd_id=342 GET response body, replacing only the
|
|
6268
|
+
* tags whose new value was supplied. Use this to build the cmd_id=345
|
|
6269
|
+
* SetAiDetectCfg payload (read-modify-write).
|
|
6270
|
+
*/
|
|
6271
|
+
export declare function patchAiDetectCfgXml(currentXml: string, patch: Partial<Pick<AiDetectCfgZone, "sensitivity" | "stayTime" | "minTargetWidth" | "minTargetHeight" | "maxTargetWidth" | "maxTargetHeight" | "area">>): string;
|
|
6272
|
+
|
|
6273
|
+
/**
|
|
6274
|
+
* Patch the `<sensitivityInfoList>` block inside a `<MD>` response XML
|
|
6275
|
+
* (cmd_id=46 GET) with a new schedule. Used by `setMotionAlarmFull` as
|
|
6276
|
+
* part of the read-modify-write flow.
|
|
6277
|
+
*/
|
|
6278
|
+
export declare function patchMotionSensitivityListXml(currentXml: string, bands: MotionSensitivityBand[]): string;
|
|
6279
|
+
|
|
6119
6280
|
/**
|
|
6120
6281
|
* Patch a child tag inside a named parent block. Used for nested
|
|
6121
6282
|
* structures like `<DayNight><mode>...</mode></DayNight>` where the
|
|
@@ -6123,6 +6284,19 @@ export declare function parseSupportXml(xml: string): SupportInfo | undefined;
|
|
|
6123
6284
|
*/
|
|
6124
6285
|
export declare function patchNestedTag(xml: string, parent: string, child: string, value: string | number | boolean | undefined): string;
|
|
6125
6286
|
|
|
6287
|
+
/**
|
|
6288
|
+
* Patch a `<Shelter>` block XML (cmd_id=52 response) by replacing the
|
|
6289
|
+
* `<shelterList>` / `<trackShelterList>` sub-blocks and the enable flags.
|
|
6290
|
+
* Use this to build the cmd_id=53 payload as a read-modify-write of the
|
|
6291
|
+
* camera's GET response — preserves any camera-specific extension tags.
|
|
6292
|
+
*/
|
|
6293
|
+
export declare function patchShelterXml(shelterXml: string, patch: {
|
|
6294
|
+
enable?: boolean;
|
|
6295
|
+
shelterList?: ShelterRect[];
|
|
6296
|
+
trackEnable?: boolean;
|
|
6297
|
+
trackShelterList?: TrackShelterRect[];
|
|
6298
|
+
}, canvas: ShelterCanvas, maxNum: number, maxTrackShelterNum: number): string;
|
|
6299
|
+
|
|
6126
6300
|
export declare type PipPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right" | "center" | "top-center" | "bottom-center" | "left-center" | "right-center";
|
|
6127
6301
|
|
|
6128
6302
|
/**
|
|
@@ -6171,6 +6345,16 @@ export declare type PlaybackSnapshotStreamInfo = {
|
|
|
6171
6345
|
*/
|
|
6172
6346
|
export declare function printNvrDiagnostics(diagnostics: Record<string, unknown>, logger?: Logger): void;
|
|
6173
6347
|
|
|
6348
|
+
export declare interface PrivacyMaskZones {
|
|
6349
|
+
enable: boolean;
|
|
6350
|
+
maxNum: number;
|
|
6351
|
+
shelterList: ShelterRect[];
|
|
6352
|
+
trackEnable: boolean;
|
|
6353
|
+
maxTrackShelterNum: number;
|
|
6354
|
+
trackShelterList: TrackShelterRect[];
|
|
6355
|
+
canvas: ShelterCanvas;
|
|
6356
|
+
}
|
|
6357
|
+
|
|
6174
6358
|
export declare interface PtzCommand {
|
|
6175
6359
|
action: "start" | "stop";
|
|
6176
6360
|
command: "Left" | "Right" | "Up" | "Down" | "ZoomIn" | "ZoomOut" | "FocusNear" | "FocusFar";
|
|
@@ -8187,6 +8371,22 @@ export declare class ReolinkBaichuanApi {
|
|
|
8187
8371
|
enabled?: boolean;
|
|
8188
8372
|
sensitivity?: number;
|
|
8189
8373
|
valueTable?: string;
|
|
8374
|
+
/**
|
|
8375
|
+
* Per-time-band sensitivity schedule.
|
|
8376
|
+
*
|
|
8377
|
+
* KNOWN ISSUE (verified on E1 Zoom firmware, May 2026):
|
|
8378
|
+
* the cmd_id=46 response ships TWO sensitivity blocks —
|
|
8379
|
+
* 1. `<sensitivityInfoList>` (legacy, 4 fixed time bands)
|
|
8380
|
+
* 2. `<sensInfoNew><sensInfoList>` (modern, dynamic schedule)
|
|
8381
|
+
* On this firmware, writing the legacy `<sensitivityInfoList>` is
|
|
8382
|
+
* silently ignored — the camera only reads from `sensInfoNew`. The
|
|
8383
|
+
* camera ships an empty `<sensInfoList />` so the effective sensitivity
|
|
8384
|
+
* is `<sensInfoNew><sensitivityDefault>` (use `sensitivity` above for
|
|
8385
|
+
* that). A populated `<sensInfoNew><sensInfoList>` capture is needed
|
|
8386
|
+
* to wire up the modern per-band setter. Use `sensitivity` (single
|
|
8387
|
+
* default value) until then.
|
|
8388
|
+
*/
|
|
8389
|
+
sensitivitySchedule?: MotionSensitivityBand[];
|
|
8190
8390
|
}): Promise<void>;
|
|
8191
8391
|
/**
|
|
8192
8392
|
* Set AI detection settings via Baichuan.
|
|
@@ -8199,6 +8399,37 @@ export declare class ReolinkBaichuanApi {
|
|
|
8199
8399
|
*/
|
|
8200
8400
|
setAiDetection(aiType: string, sensitivity?: number, stayTime?: number, channel?: number): Promise<void>;
|
|
8201
8401
|
setAiDetection(channel: number, aiType: string, sensitivity?: number, stayTime?: number): Promise<void>;
|
|
8402
|
+
/**
|
|
8403
|
+
* SetAiDetectionFull (cmd_id=343 — same as `setAiDetection`).
|
|
8404
|
+
*
|
|
8405
|
+
* Pcap-confirmed (May 2026, E1 Zoom): the Reolink app sends the full
|
|
8406
|
+
* `<AiDetectCfg>` block via cmd_id=343 for ALL fields — area mask,
|
|
8407
|
+
* min/maxTarget* thresholds, sensitivity, stayTime — in one round-trip.
|
|
8408
|
+
* There's no separate "full setter" command (we previously suspected
|
|
8409
|
+
* cmd_id=345 but that's used for something else not yet identified).
|
|
8410
|
+
*
|
|
8411
|
+
* Wire format note: min/maxTarget* fractions are serialized in
|
|
8412
|
+
* scientific notation with 6 decimal places (e.g. "5.000000e-01" for
|
|
8413
|
+
* 0.5). The helper {@link patchAiDetectCfgXml} handles the formatting.
|
|
8414
|
+
*
|
|
8415
|
+
* @param channel 0-based channel
|
|
8416
|
+
* @param aiType one of "people" / "vehicle" / "dog_cat" / "face" / "package"
|
|
8417
|
+
* @param patch partial edit; any omitted field is preserved as-is
|
|
8418
|
+
*/
|
|
8419
|
+
setAiDetectionFull(channel: number, aiType: string, patch: {
|
|
8420
|
+
sensitivity?: number;
|
|
8421
|
+
stayTime?: number;
|
|
8422
|
+
minTargetWidth?: number;
|
|
8423
|
+
minTargetHeight?: number;
|
|
8424
|
+
maxTargetWidth?: number;
|
|
8425
|
+
maxTargetHeight?: number;
|
|
8426
|
+
area?: string;
|
|
8427
|
+
}): Promise<void>;
|
|
8428
|
+
/**
|
|
8429
|
+
* GetAiDetectionFull (cmd_id=342). Typed version of `getAiAlarmRaw`
|
|
8430
|
+
* returning the full {@link AiDetectCfgZone} for a single AI type.
|
|
8431
|
+
*/
|
|
8432
|
+
getAiDetectionFull(channel: number, aiType: string): Promise<AiDetectCfgZone>;
|
|
8202
8433
|
/**
|
|
8203
8434
|
* Get siren/audio alarm status via Baichuan.
|
|
8204
8435
|
* cmd_id: 547 (GetAudioAlarm - push event, not a request)
|
|
@@ -8614,6 +8845,49 @@ export declare class ReolinkBaichuanApi {
|
|
|
8614
8845
|
}, options?: {
|
|
8615
8846
|
timeoutMs?: number;
|
|
8616
8847
|
}): Promise<void>;
|
|
8848
|
+
/**
|
|
8849
|
+
* GetMaskZones (cmdId=52) returning a typed structure with normalized
|
|
8850
|
+
* 0..1 rectangles instead of the raw camera fixed-point integers.
|
|
8851
|
+
*
|
|
8852
|
+
* The camera-side coord system is `(pixel << 16) | canvas_dim` where
|
|
8853
|
+
* `canvas_dim` is the firmware-specific mask canvas (E1 Zoom = 540×304).
|
|
8854
|
+
* The returned `canvas` block remembers those dims so callers can
|
|
8855
|
+
* round-trip without re-fetching.
|
|
8856
|
+
*
|
|
8857
|
+
* @see decodePrivacyMaskZones — pure helper exported for UI consumers.
|
|
8858
|
+
*/
|
|
8859
|
+
getMaskZones(channel?: number, options?: {
|
|
8860
|
+
timeoutMs?: number;
|
|
8861
|
+
}): Promise<PrivacyMaskZones>;
|
|
8862
|
+
/**
|
|
8863
|
+
* SetMaskZones (cmdId=53, read-modify-write of cmdId=52).
|
|
8864
|
+
*
|
|
8865
|
+
* Edits the rectangular shelter list and/or PTZ-tracking shelter list
|
|
8866
|
+
* in one call. Coordinates are normalized 0..1 of the camera mask
|
|
8867
|
+
* canvas — the lib re-fetches the current Shelter block, extracts the
|
|
8868
|
+
* canvas dims from the wire (low-16 of any non-zero coord), and
|
|
8869
|
+
* denormalizes back to the camera's pixel × canvas encoding.
|
|
8870
|
+
*
|
|
8871
|
+
* Pass `enable`/`trackEnable` to toggle the master enable flags without
|
|
8872
|
+
* touching the rectangle data. Pass `shelterList`/`trackShelterList` to
|
|
8873
|
+
* replace the corresponding list — missing slots are padded with
|
|
8874
|
+
* disabled zero-rects matching the camera's idle pattern.
|
|
8875
|
+
*
|
|
8876
|
+
* @param channel 0-based channel
|
|
8877
|
+
* @param patch partial edit; any omitted field is preserved as-is
|
|
8878
|
+
* @param options.canvas override the auto-detected mask canvas (only
|
|
8879
|
+
* needed when the GET response has no non-zero coords to extract from)
|
|
8880
|
+
* @param options.timeoutMs custom request timeout
|
|
8881
|
+
*/
|
|
8882
|
+
setMaskZones(channel: number, patch: {
|
|
8883
|
+
enable?: boolean;
|
|
8884
|
+
shelterList?: ShelterRect[];
|
|
8885
|
+
trackEnable?: boolean;
|
|
8886
|
+
trackShelterList?: TrackShelterRect[];
|
|
8887
|
+
}, options?: {
|
|
8888
|
+
canvas?: ShelterCanvas;
|
|
8889
|
+
timeoutMs?: number;
|
|
8890
|
+
}): Promise<void>;
|
|
8617
8891
|
/**
|
|
8618
8892
|
* GetAudioNoise via Baichuan (cmdId=439). Reads `enable` + `level`
|
|
8619
8893
|
* from the aiDenoise block. Mirrors reolink_aio's `GetAudioNoise`.
|
|
@@ -8838,6 +9112,14 @@ export declare class ReolinkBaichuanApi {
|
|
|
8838
9112
|
getVersionInfo(options?: {
|
|
8839
9113
|
timeoutMs?: number;
|
|
8840
9114
|
}): Promise<BaichuanVersionInfo>;
|
|
9115
|
+
/**
|
|
9116
|
+
* GetUid (cmd_id=114). Returns the device UID / serial visible in the
|
|
9117
|
+
* Reolink app. Response shape: `<Uid><uid>9527000XXXXX</uid></Uid>`.
|
|
9118
|
+
* Device-global — no channel parameter.
|
|
9119
|
+
*/
|
|
9120
|
+
getUid(options?: {
|
|
9121
|
+
timeoutMs?: number;
|
|
9122
|
+
}): Promise<string>;
|
|
8841
9123
|
getLedState(channel: number, options?: {
|
|
8842
9124
|
timeoutMs?: number;
|
|
8843
9125
|
}): Promise<BaichuanLedState>;
|
|
@@ -10892,6 +11174,58 @@ export declare function sanitizeFixtureData(value: unknown): unknown;
|
|
|
10892
11174
|
|
|
10893
11175
|
export declare function setGlobalLogger(logger: LoggerLike | Logger_2 | undefined): void;
|
|
10894
11176
|
|
|
11177
|
+
/**
|
|
11178
|
+
* Privacy-mask (Shelter) helpers.
|
|
11179
|
+
*
|
|
11180
|
+
* Reolink's GetMask response (cmd_id=52) carries up to `maxNum` rectangular
|
|
11181
|
+
* zones inside `<shelterList>` plus up to `maxTrackShelterNum` PTZ-tracking
|
|
11182
|
+
* zones inside `<trackShelterList>` (the tracking zones move with the PTZ
|
|
11183
|
+
* preset they were saved at — see `pPos`/`tPos`/`zPos`).
|
|
11184
|
+
*
|
|
11185
|
+
* Wire encoding observed on E1 Zoom firmware: every coordinate is a 32-bit
|
|
11186
|
+
* integer packing `(pixel << 16) | canvas_dimension`. The canvas dimension
|
|
11187
|
+
* is the camera's mask coord-space and is identical across all coords of
|
|
11188
|
+
* the same axis in the same response (so it can be lifted from any rect
|
|
11189
|
+
* in the list). For E1 Zoom we observe 540 × 304 (16:9-ish). Different
|
|
11190
|
+
* firmwares can ship different canvases — never assume the constants.
|
|
11191
|
+
*
|
|
11192
|
+
* value = pixel * 65536 + canvas_dim
|
|
11193
|
+
* pixel = value >>> 16
|
|
11194
|
+
* canvas_dim = value & 0xFFFF
|
|
11195
|
+
*
|
|
11196
|
+
* To keep consumers (UI) decoupled from the wire encoding we surface
|
|
11197
|
+
* rectangles with normalized 0..1 coordinates and a `canvas` block that
|
|
11198
|
+
* remembers the original dimensions for an exact round-trip on SET.
|
|
11199
|
+
*
|
|
11200
|
+
* This mirrors the motion-zone helper pattern: pure encode/decode utilities
|
|
11201
|
+
* that can be used from both the library and the React UI.
|
|
11202
|
+
*/
|
|
11203
|
+
export declare interface ShelterCanvas {
|
|
11204
|
+
/** Camera-reported X canvas dimension (low-16 of every X coord on the wire). */
|
|
11205
|
+
width: number;
|
|
11206
|
+
/** Camera-reported Y canvas dimension (low-16 of every Y coord on the wire). */
|
|
11207
|
+
height: number;
|
|
11208
|
+
}
|
|
11209
|
+
|
|
11210
|
+
export declare interface ShelterRect {
|
|
11211
|
+
/** Stable id (camera assigns `<id>` 0..maxNum-1; tracking rects use `<name>`). */
|
|
11212
|
+
id: number;
|
|
11213
|
+
/** Zone active flag. */
|
|
11214
|
+
enable: boolean;
|
|
11215
|
+
/** Z-order; observed values 0 on the wire. */
|
|
11216
|
+
layer: number;
|
|
11217
|
+
/** Color (camera-side enum). */
|
|
11218
|
+
color: number;
|
|
11219
|
+
/** Top-left X, 0..1 of the camera mask canvas. */
|
|
11220
|
+
x: number;
|
|
11221
|
+
/** Top-left Y, 0..1 of the camera mask canvas. */
|
|
11222
|
+
y: number;
|
|
11223
|
+
/** Width, 0..1 of the camera mask canvas. */
|
|
11224
|
+
width: number;
|
|
11225
|
+
/** Height, 0..1 of the camera mask canvas. */
|
|
11226
|
+
height: number;
|
|
11227
|
+
}
|
|
11228
|
+
|
|
10895
11229
|
export declare type SirenState = {
|
|
10896
11230
|
enabled: boolean;
|
|
10897
11231
|
};
|
|
@@ -11205,6 +11539,15 @@ export declare interface TimelapseCfgConfig {
|
|
|
11205
11539
|
};
|
|
11206
11540
|
}
|
|
11207
11541
|
|
|
11542
|
+
export declare interface TrackShelterRect extends ShelterRect {
|
|
11543
|
+
/** PTZ pan position the tracking mask is anchored to. -1 = unset. */
|
|
11544
|
+
pPos: number;
|
|
11545
|
+
/** PTZ tilt position the tracking mask is anchored to. -1 = unset. */
|
|
11546
|
+
tPos: number;
|
|
11547
|
+
/** PTZ zoom position the tracking mask is anchored to. -1 = unset. */
|
|
11548
|
+
zPos: number;
|
|
11549
|
+
}
|
|
11550
|
+
|
|
11208
11551
|
export declare interface TwoWayAudioConfig {
|
|
11209
11552
|
channel: number;
|
|
11210
11553
|
enabled: boolean;
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
BaichuanFrameParser,
|
|
5
5
|
BaichuanRtspServer,
|
|
6
6
|
BcUdpStream,
|
|
7
|
+
DEFAULT_SHELTER_CANVAS,
|
|
7
8
|
DUAL_LENS_DUAL_MOTION_MODELS,
|
|
8
9
|
DUAL_LENS_MODELS,
|
|
9
10
|
DUAL_LENS_SINGLE_MOTION_MODELS,
|
|
@@ -22,7 +23,10 @@ import {
|
|
|
22
23
|
createNullLogger,
|
|
23
24
|
createTaggedLogger,
|
|
24
25
|
decideSleepInferenceTransition,
|
|
26
|
+
decodeAiDetectCfg,
|
|
25
27
|
decodeHeader,
|
|
28
|
+
decodePrivacyMaskZones,
|
|
29
|
+
decodeShelterCoord,
|
|
26
30
|
discoverReolinkDevices,
|
|
27
31
|
discoverViaArpTable,
|
|
28
32
|
discoverViaDhcpListener,
|
|
@@ -32,6 +36,11 @@ import {
|
|
|
32
36
|
discoverViaUdpBroadcast,
|
|
33
37
|
discoverViaUdpDirect,
|
|
34
38
|
encodeHeader,
|
|
39
|
+
encodeMotionSensitivityListXml,
|
|
40
|
+
encodeShelterCoord,
|
|
41
|
+
encodeShelterListXml,
|
|
42
|
+
encodeTrackShelterListXml,
|
|
43
|
+
extractCanvasFromShelterXml,
|
|
35
44
|
flattenAbilitiesForChannel,
|
|
36
45
|
getConstructedVideoStreamOptions,
|
|
37
46
|
getGlobalLogger,
|
|
@@ -43,9 +52,12 @@ import {
|
|
|
43
52
|
maskUid,
|
|
44
53
|
normalizeUid,
|
|
45
54
|
parseSupportXml,
|
|
55
|
+
patchAiDetectCfgXml,
|
|
56
|
+
patchMotionSensitivityListXml,
|
|
57
|
+
patchShelterXml,
|
|
46
58
|
setGlobalLogger,
|
|
47
59
|
xmlIndicatesFloodlight
|
|
48
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-P4X5OU25.js";
|
|
49
61
|
import {
|
|
50
62
|
ReolinkCgiApi,
|
|
51
63
|
ReolinkHttpClient,
|
|
@@ -92,7 +104,7 @@ import {
|
|
|
92
104
|
upsertXmlTag,
|
|
93
105
|
xmlEscape,
|
|
94
106
|
zipDirectory
|
|
95
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-AHY4L7JI.js";
|
|
96
108
|
import {
|
|
97
109
|
AesStreamDecryptor,
|
|
98
110
|
BC_AES_IV,
|
|
@@ -168,10 +180,12 @@ import {
|
|
|
168
180
|
BC_CMD_ID_GET_REC_ENC_CFG,
|
|
169
181
|
BC_CMD_ID_GET_SIREN_STATUS,
|
|
170
182
|
BC_CMD_ID_GET_SLEEP_STATE,
|
|
183
|
+
BC_CMD_ID_GET_SNAPSHOT,
|
|
171
184
|
BC_CMD_ID_GET_STREAM_INFO_LIST,
|
|
172
185
|
BC_CMD_ID_GET_SUPPORT,
|
|
173
186
|
BC_CMD_ID_GET_SYSTEM_GENERAL,
|
|
174
187
|
BC_CMD_ID_GET_TIMELAPSE_CFG,
|
|
188
|
+
BC_CMD_ID_GET_UID,
|
|
175
189
|
BC_CMD_ID_GET_VERSION_INFO,
|
|
176
190
|
BC_CMD_ID_GET_VIDEO_INPUT,
|
|
177
191
|
BC_CMD_ID_GET_WHITE_LED,
|
|
@@ -262,7 +276,7 @@ import {
|
|
|
262
276
|
parseBcMedia,
|
|
263
277
|
splitAnnexBToNalPayloads,
|
|
264
278
|
splitAnnexBToNalPayloads2
|
|
265
|
-
} from "./chunk-
|
|
279
|
+
} from "./chunk-GVWJGQPT.js";
|
|
266
280
|
|
|
267
281
|
// src/reolink/baichuan/HlsSessionManager.ts
|
|
268
282
|
var withTimeout = async (p, ms, label) => {
|
|
@@ -8336,10 +8350,12 @@ export {
|
|
|
8336
8350
|
BC_CMD_ID_GET_REC_ENC_CFG,
|
|
8337
8351
|
BC_CMD_ID_GET_SIREN_STATUS,
|
|
8338
8352
|
BC_CMD_ID_GET_SLEEP_STATE,
|
|
8353
|
+
BC_CMD_ID_GET_SNAPSHOT,
|
|
8339
8354
|
BC_CMD_ID_GET_STREAM_INFO_LIST,
|
|
8340
8355
|
BC_CMD_ID_GET_SUPPORT,
|
|
8341
8356
|
BC_CMD_ID_GET_SYSTEM_GENERAL,
|
|
8342
8357
|
BC_CMD_ID_GET_TIMELAPSE_CFG,
|
|
8358
|
+
BC_CMD_ID_GET_UID,
|
|
8343
8359
|
BC_CMD_ID_GET_VERSION_INFO,
|
|
8344
8360
|
BC_CMD_ID_GET_VIDEO_INPUT,
|
|
8345
8361
|
BC_CMD_ID_GET_WHITE_LED,
|
|
@@ -8413,6 +8429,7 @@ export {
|
|
|
8413
8429
|
BcUdpStream,
|
|
8414
8430
|
CompositeRtspServer,
|
|
8415
8431
|
CompositeStream,
|
|
8432
|
+
DEFAULT_SHELTER_CANVAS,
|
|
8416
8433
|
DUAL_LENS_DUAL_MOTION_MODELS,
|
|
8417
8434
|
DUAL_LENS_MODELS,
|
|
8418
8435
|
DUAL_LENS_SINGLE_MOTION_MODELS,
|
|
@@ -8485,8 +8502,11 @@ export {
|
|
|
8485
8502
|
createTaggedLogger,
|
|
8486
8503
|
decideSleepInferenceTransition,
|
|
8487
8504
|
decideVideoclipTranscodeMode,
|
|
8505
|
+
decodeAiDetectCfg,
|
|
8488
8506
|
decodeHeader,
|
|
8489
8507
|
decodeMotionScopeBitmap,
|
|
8508
|
+
decodePrivacyMaskZones,
|
|
8509
|
+
decodeShelterCoord,
|
|
8490
8510
|
deriveAesKey,
|
|
8491
8511
|
detectIosClient,
|
|
8492
8512
|
detectVideoCodecFromNal,
|
|
@@ -8500,7 +8520,12 @@ export {
|
|
|
8500
8520
|
discoverViaUdpDirect,
|
|
8501
8521
|
encodeHeader,
|
|
8502
8522
|
encodeMotionScopeBitmap,
|
|
8523
|
+
encodeMotionSensitivityListXml,
|
|
8524
|
+
encodeShelterCoord,
|
|
8525
|
+
encodeShelterListXml,
|
|
8526
|
+
encodeTrackShelterListXml,
|
|
8503
8527
|
ensureXmlHeader,
|
|
8528
|
+
extractCanvasFromShelterXml,
|
|
8504
8529
|
extractH264ParamSetsFromAccessUnit,
|
|
8505
8530
|
extractH265ParamSetsFromAccessUnit,
|
|
8506
8531
|
extractPpsFromAnnexB,
|
|
@@ -8541,7 +8566,10 @@ export {
|
|
|
8541
8566
|
parseBcMedia,
|
|
8542
8567
|
parseRecordingFileName,
|
|
8543
8568
|
parseSupportXml,
|
|
8569
|
+
patchAiDetectCfgXml,
|
|
8570
|
+
patchMotionSensitivityListXml,
|
|
8544
8571
|
patchNestedTag,
|
|
8572
|
+
patchShelterXml,
|
|
8545
8573
|
printNvrDiagnostics,
|
|
8546
8574
|
runAllDiagnosticsConsecutively,
|
|
8547
8575
|
runMultifocalDiagnosticsConsecutively,
|