@apocaliss92/nodelink-js 0.4.10 → 0.4.12

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/index.d.cts CHANGED
@@ -88,9 +88,11 @@ declare const BC_CMD_ID_SUPPORT = 199;
88
88
  declare const BC_CMD_ID_PING = 93;
89
89
  declare const BC_CMD_ID_CHANNEL_INFO_ALL = 145;
90
90
  declare const BC_CMD_ID_GET_OSD_DATETIME = 44;
91
+ declare const BC_CMD_ID_SET_OSD_DATETIME = 45;
91
92
  declare const BC_CMD_ID_GET_RECORD_CFG = 54;
92
93
  declare const BC_CMD_ID_GET_ABILITY_SUPPORT = 58;
93
94
  declare const BC_CMD_ID_GET_FTP_TASK = 70;
95
+ declare const BC_CMD_ID_GET_VERSION_INFO = 80;
94
96
  declare const BC_CMD_ID_GET_RECORD = 81;
95
97
  declare const BC_CMD_ID_GET_HDD_INFO_LIST = 102;
96
98
  declare const BC_CMD_ID_GET_WIFI_SIGNAL = 115;
@@ -411,6 +413,12 @@ declare function ensureXmlHeader(xml: string): string;
411
413
  * pass partial patches without branching at every field.
412
414
  */
413
415
  declare function applyXmlTagPatch(xml: string, tag: string, value: string | number | boolean | undefined): string;
416
+ /**
417
+ * Like {@link applyXmlTagPatch} but inserts the tag at the end of the block
418
+ * when it is not already present. Required for fields the camera omits on
419
+ * GET responses but expects on SET (e.g. `<encoderType>` on `setEnc`).
420
+ */
421
+ declare function upsertXmlTag(xml: string, tag: string, value: string | number | boolean | undefined): string;
414
422
  /**
415
423
  * Patch a child tag inside a named parent block. Used for nested
416
424
  * structures like `<DayNight><mode>...</mode></DayNight>` where the
@@ -418,15 +426,27 @@ declare function applyXmlTagPatch(xml: string, tag: string, value: string | numb
418
426
  */
419
427
  declare function patchNestedTag(xml: string, parent: string, child: string, value: string | number | boolean | undefined): string;
420
428
  /**
421
- * Patch one or more fields inside an `<Enc>` stream block
422
- * (`<mainStream>` or `<subStream>`). Used by `setEnc` —
423
- * Reolink emits both blocks in the same document so a per-block scope
424
- * is needed to avoid clobbering the wrong stream.
425
- */
426
- declare function applyStreamPatch(xml: string, streamTag: "mainStream" | "subStream", patch: {
429
+ * Patch fields inside a `<Compression>` stream block (`<mainStream>`,
430
+ * `<subStream>`, or `<thirdStream>`). Used by `setEnc` — Reolink emits all
431
+ * three blocks in the same document so a per-block scope is needed to avoid
432
+ * clobbering the wrong stream.
433
+ *
434
+ * The mapping `videoEncType` codec uses the convention seen on the wire:
435
+ * 0 = H.264
436
+ * 1 = H.265
437
+ * Both `<frame>` (camera-side preferred) and `<frameRate>` (older reolink_aio
438
+ * naming) are patched defensively — no-op if only one is present.
439
+ */
440
+ declare function applyStreamPatch(xml: string, streamTag: "mainStream" | "subStream" | "thirdStream", patch: {
441
+ audio?: 0 | 1;
442
+ width?: number;
443
+ height?: number;
427
444
  bitRate?: number;
428
445
  frameRate?: number;
429
446
  videoEncType?: "h264" | "h265";
447
+ encoderType?: "vbr" | "cbr";
448
+ encoderProfile?: "high" | "main" | "baseline";
449
+ gop?: number;
430
450
  } | undefined): string;
431
451
  /**
432
452
  * Normalize human-friendly day/night labels to the camera's expected
@@ -902,6 +922,49 @@ type BaichuanLedState = {
902
922
  state?: string;
903
923
  lightState?: string;
904
924
  };
925
+ /**
926
+ * Snapshot of `<VersionInfo>` returned by Baichuan cmd_id=80
927
+ * (`BC_CMD_ID_GET_VERSION_INFO`) — the same payload the Reolink mobile app
928
+ * displays in "About this device". Distinct from `getSystemGeneral`
929
+ * (cmd_104) which holds time/locale.
930
+ *
931
+ * All fields optional because firmware variants and models include
932
+ * different subsets. Empty XML elements (e.g. `<cc3200Version></cc3200Version>`)
933
+ * come through as the empty string so callers can distinguish "absent"
934
+ * (undefined) from "explicitly empty" ("").
935
+ */
936
+ interface BaichuanVersionInfo {
937
+ /** User-assigned name (matches the OSD camera name). */
938
+ name?: string;
939
+ /** Model code, e.g. `"E1 Zoom"`, `"RLC-810A"`. */
940
+ type?: string;
941
+ /** Hardware serial number. */
942
+ serialNumber?: string;
943
+ /** Build identifier, typically a date string like `"build 2503281992"`. */
944
+ buildDay?: string;
945
+ /** Internal hardware revision, e.g. `"IPC_NT14NA48MPSD6"`. */
946
+ hardwareVersion?: string;
947
+ /** Config-format version Reolink uses to identify the schema the device speaks. */
948
+ cfgVersion?: string;
949
+ /** Firmware version, e.g. `"v3.2.0.4741_2503281992"`. */
950
+ firmwareVersion?: string;
951
+ /** Extended hardware detail (often hardwareVersion + region/sku suffix). */
952
+ detail?: string;
953
+ /** IE-Client identifier (legacy plug-in tag, usually `"IEClient"`). */
954
+ IEClient?: string;
955
+ /** Legacy MCU firmware version (present on some Reolink wireless models). */
956
+ cc3200Version?: string;
957
+ /** Signal-processor firmware version (rarely populated). */
958
+ spVersion?: string;
959
+ /** File extension Reolink expects for firmware updates (`"pak"`). */
960
+ pakSuffix?: string;
961
+ /** Reolink item / SKU number, e.g. `"E340"`. */
962
+ itemNo?: string;
963
+ /** AI-model bundle version (the on-device people/vehicle/animal detector). */
964
+ aiVersion?: string;
965
+ /** Diagnostic helper string the app sends to support, e.g. `"blackPointsLevel=0"`. */
966
+ helpVersion?: string;
967
+ }
905
968
  type BaichuanSleepState = {
906
969
  sleep?: number;
907
970
  mode?: number;
@@ -1087,6 +1150,61 @@ interface ReolinkSimpleEvent {
1087
1150
  /** Present when type === "battery" — pushed by the camera via cmdId 252. */
1088
1151
  battery?: Partial<BatteryInfo>;
1089
1152
  }
1153
+ /**
1154
+ * A single detection bounding box in normalized [0, 1] coordinates relative to
1155
+ * the source video frame. Using fractions instead of pixels keeps the same box
1156
+ * valid across mainStream / subStream / externStream output and across firmware
1157
+ * resolution changes.
1158
+ */
1159
+ interface ReolinkDetectionBox {
1160
+ /** Left edge in [0, 1] (0 = left, 1 = right). */
1161
+ x: number;
1162
+ /** Top edge in [0, 1] (0 = top, 1 = bottom). */
1163
+ y: number;
1164
+ /** Width in [0, 1]. */
1165
+ width: number;
1166
+ /** Height in [0, 1]. */
1167
+ height: number;
1168
+ /** AI class label if the camera reports one (e.g. "person", "vehicle"). */
1169
+ label?: string;
1170
+ /** Confidence in [0, 1] if exposed by the camera. */
1171
+ confidence?: number;
1172
+ }
1173
+ /**
1174
+ * Diagnostic state describing how much of the BcMedia additionalHeader the
1175
+ * decoder was able to interpret. Useful for consumers iterating on the format.
1176
+ */
1177
+ type ReolinkDetectionDecodeState =
1178
+ /** Header marker was missing or malformed. */
1179
+ "invalid-marker"
1180
+ /** Baseline 128-byte header — camera reports no overlay metadata. */
1181
+ | "no-overlay"
1182
+ /** Overlay block present, but coordinates have not been decoded yet. */
1183
+ | "overlay-undecoded"
1184
+ /** Overlay block decoded successfully. */
1185
+ | "overlay-decoded";
1186
+ /**
1187
+ * High-level "detection" event emitted alongside every video frame that carries
1188
+ * a non-empty BcMedia additionalHeader. Mirrors `ReolinkSimpleEvent` but is
1189
+ * sourced from the streaming side-channel rather than from cmd_id 33 push events.
1190
+ */
1191
+ interface ReolinkDetectionEvent {
1192
+ channel: number;
1193
+ /** Microseconds timestamp from the BcMedia video frame. */
1194
+ microseconds: number;
1195
+ /** Stream profile that produced the underlying frame. */
1196
+ profile: "main" | "sub" | "ext";
1197
+ /** Boxes in [0, 1] fractional coordinates. */
1198
+ boxes: ReolinkDetectionBox[];
1199
+ /** Source frame width (from BcMedia InfoV1/V2) if known. */
1200
+ frameWidth?: number;
1201
+ /** Source frame height (from BcMedia InfoV1/V2) if known. */
1202
+ frameHeight?: number;
1203
+ /** Decoder diagnostic state. */
1204
+ decodeState: ReolinkDetectionDecodeState;
1205
+ /** Raw additionalHeader bytes — kept for downstream decoder work. */
1206
+ rawHeader: Buffer;
1207
+ }
1090
1208
  interface TwoWayAudioConfig {
1091
1209
  channel: number;
1092
1210
  enabled: boolean;
@@ -1702,6 +1820,70 @@ interface CompressionStream {
1702
1820
  encoderType?: string | undefined;
1703
1821
  [key: string]: unknown;
1704
1822
  }
1823
+ /**
1824
+ * One allowable resolution from a `getEncOptions` reply.
1825
+ * `videoEncTypeList` enumerates the codecs supported at this resolution
1826
+ * (mapped to `"h264"`/`"h265"`).
1827
+ */
1828
+ interface EncResolutionOption {
1829
+ width: number;
1830
+ height: number;
1831
+ /** Codecs available at this resolution. */
1832
+ videoEncTypes: Array<"h264" | "h265">;
1833
+ /** Camera-default framerate at this resolution, if reported. */
1834
+ defaultFramerate?: number;
1835
+ /** Camera-default bitrate (kbps) at this resolution, if reported. */
1836
+ defaultBitrate?: number;
1837
+ /** Camera-default GOP at this resolution, if reported. */
1838
+ defaultGop?: number;
1839
+ /** Allowed framerate values. */
1840
+ framerateOptions: number[];
1841
+ /** Allowed bitrate values (kbps). */
1842
+ bitrateOptions: number[];
1843
+ }
1844
+ /**
1845
+ * Allowable values for a single stream profile (mainStream / subStream / thirdStream).
1846
+ * Aggregated from `getStreamInfoList` (cmd_146) so consumers can populate UI
1847
+ * pickers without re-implementing the parsing logic.
1848
+ */
1849
+ interface EncStreamOptions {
1850
+ /** Stream profile (one of `mainStream` / `subStream` / `thirdStream`). */
1851
+ type: string;
1852
+ /** Each entry is a `{width, height}` paired with its allowed values. */
1853
+ resolutions: EncResolutionOption[];
1854
+ /** Encoder rate-control modes Reolink exposes in the app. */
1855
+ encoderTypes: Array<"vbr" | "cbr">;
1856
+ /** Encoder profiles Reolink exposes in the app. */
1857
+ encoderProfiles: Array<"high" | "main" | "baseline">;
1858
+ }
1859
+ /**
1860
+ * Reply from `getEncOptions` — the set of allowable values for `setEnc`,
1861
+ * derived from `getStreamInfoList`. Use this to validate user input or
1862
+ * populate UI selectors.
1863
+ */
1864
+ interface EncOptions {
1865
+ channel: number;
1866
+ mainStream?: EncStreamOptions;
1867
+ subStream?: EncStreamOptions;
1868
+ thirdStream?: EncStreamOptions;
1869
+ }
1870
+ /**
1871
+ * Patch payload accepted by `setEnc` for a single stream block
1872
+ * (`mainStream` / `subStream` / `thirdStream`). All fields optional —
1873
+ * unspecified ones are preserved from the device's current config.
1874
+ */
1875
+ interface EncStreamPatch {
1876
+ audio?: 0 | 1;
1877
+ width?: number;
1878
+ height?: number;
1879
+ bitRate?: number;
1880
+ frameRate?: number;
1881
+ videoEncType?: "h264" | "h265";
1882
+ encoderType?: "vbr" | "cbr";
1883
+ encoderProfile?: "high" | "main" | "baseline";
1884
+ /** Keyframe interval in seconds — patches `<gop><cur>`. */
1885
+ gop?: number;
1886
+ }
1705
1887
  /**
1706
1888
  * Encoding configuration (getEnc response).
1707
1889
  * cmdId=56 (GetEnc) — payload is wrapped in `Compression`, not `Enc`.
@@ -2226,6 +2408,23 @@ declare class BaichuanClient extends EventEmitter<{
2226
2408
  * even if the current client instance is idle/disconnected.
2227
2409
  */
2228
2410
  private static readonly streamingRegistry;
2411
+ /**
2412
+ * Per-device set of live BaichuanClient instances.
2413
+ *
2414
+ * Why: when a streaming client unsubscribes (e.g. RTSP grace timer expires
2415
+ * and SocketPool tears the streaming socket down), the global streaming
2416
+ * registry decrements but the GENERAL client of the same device has no
2417
+ * way of knowing — its idle-disconnect timer was last evaluated while
2418
+ * `isDeviceStreamingActive()` was still true (because the streaming socket
2419
+ * was still alive) and wasn't rescheduled. Without this registry the
2420
+ * general socket stays connected, the 60-second session-guard timer keeps
2421
+ * sending getOnlineUserList() to the camera, and a battery camera ends up
2422
+ * waking up every minute (issue #18).
2423
+ *
2424
+ * On streamingRegistry decrement-to-zero we walk this set and kick every
2425
+ * sibling's idle-disconnect timer so it can re-evaluate eligibility.
2426
+ */
2427
+ private static readonly deviceClients;
2229
2428
  /**
2230
2429
  * Per-host D2C_DISC backoff state that persists across client instance recreation.
2231
2430
  *
@@ -2314,6 +2513,10 @@ declare class BaichuanClient extends EventEmitter<{
2314
2513
  private streamTraceStats;
2315
2514
  private rxCmdTraceStats;
2316
2515
  private readonly alarmEventState;
2516
+ /** Whether this instance is currently in BaichuanClient.deviceClients. */
2517
+ private registeredInDeviceClients;
2518
+ private registerInDeviceClients;
2519
+ private unregisterFromDeviceClients;
2317
2520
  constructor(options: BaichuanClientOptions);
2318
2521
  private newSocketSessionId;
2319
2522
  private logFixed;
@@ -4198,6 +4401,143 @@ declare class BaichuanRtspServer extends EventEmitter<{
4198
4401
  } | null;
4199
4402
  }
4200
4403
 
4404
+ /**
4405
+ * BcMedia Parser - Parses Baichuan media packets (video/audio frames)
4406
+ *
4407
+ * BcMedia packets have magic headers that identify the packet type:
4408
+ * - InfoV1: 0x31303031
4409
+ * - InfoV2: 0x32303031
4410
+ * - IFrame: 0x63643030 - 0x63643039 (includes channel number)
4411
+ * - PFrame: 0x63643130 - 0x63643139 (includes channel number)
4412
+ * - AAC: 0x62773530
4413
+ * - ADPCM: 0x62773130
4414
+ */
4415
+ type BcMediaType = "InfoV1" | "InfoV2" | "Iframe" | "Pframe" | "Aac" | "Adpcm";
4416
+ interface BcMediaIframe {
4417
+ type: "Iframe";
4418
+ videoType: "H264" | "H265";
4419
+ microseconds: number;
4420
+ time?: number;
4421
+ /** Raw additional header (if present) */
4422
+ additionalHeader?: Buffer;
4423
+ /** Additional header size */
4424
+ additionalHeaderSize?: number;
4425
+ /** Unknown u32 field after microseconds */
4426
+ unknown?: number;
4427
+ data: Buffer;
4428
+ }
4429
+ interface BcMediaPframe {
4430
+ type: "Pframe";
4431
+ videoType: "H264" | "H265";
4432
+ microseconds: number;
4433
+ /** Raw additional header (if present) */
4434
+ additionalHeader?: Buffer;
4435
+ /** Additional header size */
4436
+ additionalHeaderSize?: number;
4437
+ /** Unknown u32 field after microseconds */
4438
+ unknown?: number;
4439
+ data: Buffer;
4440
+ }
4441
+ interface BcMediaInfoV1 {
4442
+ type: "InfoV1";
4443
+ videoWidth: number;
4444
+ videoHeight: number;
4445
+ fps: number;
4446
+ startYear: number;
4447
+ startMonth: number;
4448
+ startDay: number;
4449
+ startHour: number;
4450
+ startMin: number;
4451
+ startSeconds: number;
4452
+ endYear: number;
4453
+ endMonth: number;
4454
+ endDay: number;
4455
+ endHour: number;
4456
+ endMin: number;
4457
+ endSeconds: number;
4458
+ }
4459
+ interface BcMediaInfoV2 {
4460
+ type: "InfoV2";
4461
+ videoWidth: number;
4462
+ videoHeight: number;
4463
+ fps: number;
4464
+ startYear: number;
4465
+ startMonth: number;
4466
+ startDay: number;
4467
+ startHour: number;
4468
+ startMin: number;
4469
+ startSeconds: number;
4470
+ endYear: number;
4471
+ endMonth: number;
4472
+ endDay: number;
4473
+ endHour: number;
4474
+ endMin: number;
4475
+ endSeconds: number;
4476
+ }
4477
+ interface BcMediaAac {
4478
+ type: "Aac";
4479
+ data: Buffer;
4480
+ }
4481
+ interface BcMediaAdpcm {
4482
+ type: "Adpcm";
4483
+ data: Buffer;
4484
+ }
4485
+ type BcMedia = BcMediaIframe | BcMediaPframe | BcMediaInfoV1 | BcMediaInfoV2 | BcMediaAac | BcMediaAdpcm;
4486
+ /**
4487
+ * Parse BcMedia packet from binary data.
4488
+ */
4489
+ declare function parseBcMedia(buf: Buffer): {
4490
+ media: BcMedia;
4491
+ consumed: number;
4492
+ } | null;
4493
+
4494
+ /**
4495
+ * BcMedia Codec - Assembles fragmented BcMedia packets from stream
4496
+ *
4497
+ * BcMedia packets can be fragmented across multiple Baichuan frames.
4498
+ * This codec buffers incomplete packets and assembles them when complete.
4499
+ */
4500
+
4501
+ /**
4502
+ * Optional listener invoked whenever the codec encounters a 4-byte sequence
4503
+ * at the buffer head that does NOT match any known BcMedia magic and is about
4504
+ * to be skipped as "recovery". Use it to discover undocumented sub-packet
4505
+ * shapes (e.g. AI overlay metadata) without altering the codec's behaviour.
4506
+ */
4507
+ type UnknownChunkListener = (info: {
4508
+ magic: number;
4509
+ /** Up to 256 bytes starting at the unknown chunk's first byte. */
4510
+ preview: Buffer;
4511
+ /** Number of bytes the codec is about to skip before resyncing. */
4512
+ skipped: number;
4513
+ }) => void;
4514
+ declare class BcMediaCodec {
4515
+ private buffer;
4516
+ private strict;
4517
+ private amountSkipped;
4518
+ private logger;
4519
+ private onUnknownChunk;
4520
+ constructor(strict?: boolean, logger?: Logger);
4521
+ /** Register a listener that fires for every unknown chunk before recovery. */
4522
+ setUnknownChunkListener(listener: UnknownChunkListener | undefined): void;
4523
+ /**
4524
+ * Push data into the codec buffer and try to parse complete BcMedia packets.
4525
+ * Returns an array of complete BcMedia packets found.
4526
+ *
4527
+ * @param chunk - New data chunk to add to buffer
4528
+ * @returns Array of complete BcMedia packets (empty if none complete yet)
4529
+ */
4530
+ decode(chunk: Buffer): BcMedia[];
4531
+ /**
4532
+ * Get remaining buffer (for debugging)
4533
+ */
4534
+ getRemainingBuffer(): Buffer;
4535
+ /**
4536
+ * Clear the buffer (useful for resetting the codec)
4537
+ */
4538
+ clear(): void;
4539
+ }
4540
+
4201
4541
  /**
4202
4542
  * Baichuan Video Stream - Builds a video stream from the native Baichuan protocol.
4203
4543
  *
@@ -4250,6 +4590,22 @@ declare class BaichuanVideoStream extends EventEmitter<{
4250
4590
  time?: number;
4251
4591
  }
4252
4592
  ];
4593
+ /**
4594
+ * Raw BcMedia `additionalHeader` block emitted for every I-frame and P-frame.
4595
+ * Carries Reolink's per-frame side-channel metadata (detection bounding boxes).
4596
+ * `frameWidth`/`frameHeight` come from the most recent BcMedia InfoV1/V2 packet
4597
+ * so consumers can normalize pixel coordinates against the actual stream size.
4598
+ */
4599
+ additionalHeader: [
4600
+ {
4601
+ raw: Buffer;
4602
+ frameType: "Iframe" | "Pframe";
4603
+ videoType: "H264" | "H265";
4604
+ microseconds: number;
4605
+ frameWidth?: number;
4606
+ frameHeight?: number;
4607
+ }
4608
+ ];
4253
4609
  audioFrame: [Buffer];
4254
4610
  error: [Error];
4255
4611
  close: [];
@@ -4268,6 +4624,13 @@ declare class BaichuanVideoStream extends EventEmitter<{
4268
4624
  private readonly acceptAnyStreamType;
4269
4625
  private lockedChannelId;
4270
4626
  private bcMediaCodec;
4627
+ /**
4628
+ * Diagnostic-only accessor for the BcMedia codec. Used by tools that need to
4629
+ * inspect unknown chunks (for example to discover undocumented audio
4630
+ * sub-packets the parser currently skips). Not part of the supported public
4631
+ * surface — do not rely on it in application code.
4632
+ */
4633
+ get _bcMediaCodec(): BcMediaCodec;
4271
4634
  private debugH264LogsLeft;
4272
4635
  private debugSavedSamples;
4273
4636
  private warnedNonAnnexBOnce;
@@ -4286,6 +4649,9 @@ declare class BaichuanVideoStream extends EventEmitter<{
4286
4649
  private lastPpsH265;
4287
4650
  private lastPrependedParamSetsH265;
4288
4651
  private aesStreamDecryptor;
4652
+ private latestFrameWidth;
4653
+ private latestFrameHeight;
4654
+ private detectionTeardown;
4289
4655
  /**
4290
4656
  * Pending startup error stashed when emitSafeError is called before any
4291
4657
  * "error" listener is registered (e.g. camera returns 400 during start()).
@@ -4977,6 +5343,12 @@ declare class ReolinkBaichuanApi {
4977
5343
  private sessionGuardIntervalTimer;
4978
5344
  private readonly simpleEventListeners;
4979
5345
  private simpleEventSubscribed;
5346
+ private readonly detectionEventListeners;
5347
+ private readonly detectionEventStreamHooks;
5348
+ private readonly objectDetectionListeners;
5349
+ private objectDetectionStream;
5350
+ private objectDetectionStreamStartInFlight;
5351
+ private objectDetectionInternalListener;
4980
5352
  private simpleEventSubscribeInFlight;
4981
5353
  private simpleEventUnsubscribeInFlight;
4982
5354
  private simpleEventResubscribeTimer;
@@ -5394,6 +5766,73 @@ declare class ReolinkBaichuanApi {
5394
5766
  * When the last listener is removed, the API unsubscribes from Baichuan events.
5395
5767
  */
5396
5768
  offSimpleEvent(callback?: (event: ReolinkSimpleEvent) => void | Promise<void>): Promise<void>;
5769
+ /**
5770
+ * Subscribe to per-frame detection events sourced from the BcMedia
5771
+ * `additionalHeader` block on active video streams.
5772
+ *
5773
+ * Mirrors {@link onSimpleEvent} but is fed by the streaming side-channel:
5774
+ * one event fires for every I-frame / P-frame that carries an overlay block.
5775
+ * Coordinates are reported in normalized [0, 1] fractions of the source
5776
+ * frame, so the same box renders correctly on mainStream, subStream, and
5777
+ * externStream.
5778
+ *
5779
+ * Unlike `onSimpleEvent`, no Baichuan subscribe command is involved — events
5780
+ * only flow while a video stream is open. The library hooks every
5781
+ * `BaichuanVideoStream` created via this API for the listener's lifetime.
5782
+ */
5783
+ onDetection(callback: (event: ReolinkDetectionEvent) => void | Promise<void>): void;
5784
+ /**
5785
+ * Remove a single detection callback, or all of them if `callback` is omitted.
5786
+ */
5787
+ offDetection(callback?: (event: ReolinkDetectionEvent) => void | Promise<void>): void;
5788
+ /**
5789
+ * Subscribe to AI object detections (people / vehicle / animal / face boxes
5790
+ * with class label and confidence) without managing a video stream yourself.
5791
+ *
5792
+ * Mirrors {@link onSimpleEvent} end-to-end: the API opens a dedicated
5793
+ * substream behind the scenes on the first listener, forwards every box-bearing
5794
+ * `additionalHeader` to your callback, and tears the stream down when the last
5795
+ * listener unsubscribes. The substream is the lightest profile (typically
5796
+ * 640×360) so the additional bandwidth/CPU overhead is minimal.
5797
+ *
5798
+ * Each event carries normalized `[0, 1]` box coordinates, a class label, and
5799
+ * a confidence score — render-ready without further conversion.
5800
+ */
5801
+ onObjectDetections(callback: (event: ReolinkDetectionEvent) => void | Promise<void>): Promise<void>;
5802
+ /**
5803
+ * Remove one detection callback, or all of them if `callback` is omitted.
5804
+ * When the last listener is removed the auto-managed substream is closed.
5805
+ */
5806
+ offObjectDetections(callback?: (event: ReolinkDetectionEvent) => void | Promise<void>): Promise<void>;
5807
+ private ensureObjectDetectionStream;
5808
+ private tearDownObjectDetectionStream;
5809
+ /**
5810
+ * Internal: invoked by BaichuanVideoStream when it starts so the API can hook
5811
+ * its `additionalHeader` event. Returns a teardown function the stream calls
5812
+ * on stop. Not intended for direct use by consumers.
5813
+ */
5814
+ _registerVideoStreamForDetection(stream: {
5815
+ on: (event: "additionalHeader", listener: (info: {
5816
+ raw: Buffer;
5817
+ frameType: "Iframe" | "Pframe";
5818
+ videoType: "H264" | "H265";
5819
+ microseconds: number;
5820
+ frameWidth?: number;
5821
+ frameHeight?: number;
5822
+ }) => void) => void;
5823
+ off: (event: "additionalHeader", listener: (info: {
5824
+ raw: Buffer;
5825
+ frameType: "Iframe" | "Pframe";
5826
+ videoType: "H264" | "H265";
5827
+ microseconds: number;
5828
+ frameWidth?: number;
5829
+ frameHeight?: number;
5830
+ }) => void) => void;
5831
+ }, context: {
5832
+ channel: number;
5833
+ profile: "main" | "sub" | "ext";
5834
+ }): () => void;
5835
+ private dispatchDetectionEvent;
5397
5836
  private startSimpleEventResubscribeTimer;
5398
5837
  private stopSimpleEventResubscribeTimer;
5399
5838
  /**
@@ -5549,6 +5988,55 @@ declare class ReolinkBaichuanApi {
5549
5988
  port: "rtsp" | "rtmp" | "onvif" | "http" | "https";
5550
5989
  enable: boolean;
5551
5990
  }): Promise<void>;
5991
+ /**
5992
+ * Full port-config setter (cmd_id 36). Patches one or more of the six
5993
+ * service ports the camera serves — Server (Baichuan), HTTP, HTTPS,
5994
+ * RTSP, RTMP, ONVIF. Each entry takes an optional `port` (number) and
5995
+ * `enable` (boolean); fields the caller doesn't pass are left alone.
5996
+ *
5997
+ * Sends one block per port that has any field set, then issues a
5998
+ * single cmd_36 with the merged body. The camera accepts multiple
5999
+ * `<XxxPort>` siblings in the same payload.
6000
+ *
6001
+ * Wire format observed on E1 Zoom:
6002
+ *
6003
+ * <body>
6004
+ * <RtspPort version="1.1">
6005
+ * <rtspPort>554</rtspPort>
6006
+ * <enable>1</enable>
6007
+ * </RtspPort>
6008
+ * <HttpsPort version="1.1">
6009
+ * <enable>0</enable>
6010
+ * </HttpsPort>
6011
+ * ...
6012
+ * </body>
6013
+ */
6014
+ setPortConfig(patch: {
6015
+ server?: {
6016
+ port?: number;
6017
+ enable?: boolean;
6018
+ };
6019
+ http?: {
6020
+ port?: number;
6021
+ enable?: boolean;
6022
+ };
6023
+ https?: {
6024
+ port?: number;
6025
+ enable?: boolean;
6026
+ };
6027
+ rtsp?: {
6028
+ port?: number;
6029
+ enable?: boolean;
6030
+ };
6031
+ rtmp?: {
6032
+ port?: number;
6033
+ enable?: boolean;
6034
+ };
6035
+ onvif?: {
6036
+ port?: number;
6037
+ enable?: boolean;
6038
+ };
6039
+ }): Promise<void>;
5552
6040
  /** GetDevInfo via Baichuan: host cmd_id 80, channel cmd_id 318 */
5553
6041
  getInfo(channel?: number, options?: {
5554
6042
  timeoutMs?: number;
@@ -6339,6 +6827,15 @@ declare class ReolinkBaichuanApi {
6339
6827
  */
6340
6828
  setPtzPreset(presetId: number, name: string, channel?: number): Promise<void>;
6341
6829
  setPtzPreset(channel: number, presetId: number, name: string): Promise<void>;
6830
+ /**
6831
+ * Recall (move to) a saved PTZ preset.
6832
+ *
6833
+ * cmd_id 19 (PTZ_CONTROL_PRESET) with command="toPos". The camera moves
6834
+ * the head at its own default preset-recall speed; we don't expose
6835
+ * speed here because most firmwares ignore the field on toPos.
6836
+ */
6837
+ gotoPtzPreset(presetId: number, channel?: number): Promise<void>;
6838
+ gotoPtzPreset(channel: number, presetId: number): Promise<void>;
6342
6839
  /**
6343
6840
  * Best-effort delete/disable a PTZ preset.
6344
6841
  *
@@ -6513,6 +7010,39 @@ declare class ReolinkBaichuanApi {
6513
7010
  */
6514
7011
  setMotionDetection(enabled: boolean, sensitivity?: number, channel?: number): Promise<void>;
6515
7012
  setMotionDetection(channel: number, enabled: boolean, sensitivity?: number): Promise<void>;
7013
+ /**
7014
+ * Set motion alarm with full control, including the detection-zone grid.
7015
+ *
7016
+ * Wire format observed on E1 Zoom (cmd_id=47 SetMdAlarm body):
7017
+ *
7018
+ * <MD version="1.1">
7019
+ * <channelId>0</channelId>
7020
+ * <enable>1</enable>
7021
+ * <usepir>0</usepir>
7022
+ * <width>60</width> <height>33</height>
7023
+ * <scope>
7024
+ * <columns>96</columns> <rows>64</rows>
7025
+ * <valueTable>{base64 6144-bit bitmap}</valueTable>
7026
+ * </scope>
7027
+ * ... other camera-specific fields ...
7028
+ * </MD>
7029
+ *
7030
+ * We do a read-modify-write of the GET response so any camera-specific
7031
+ * extension fields are preserved untouched. Pass `valueTable` to update
7032
+ * the detection zone — see `encodeMotionScopeBitmap` for the bitmap layout.
7033
+ *
7034
+ * @param channel - 0-based channel
7035
+ * @param enabled - toggle motion detection on/off (optional)
7036
+ * @param sensitivity - 0-50, higher = more sensitive (optional)
7037
+ * @param valueTable - base64-encoded grid bitmap; size must match
7038
+ * `<scope><columns>×<rows></scope>` from the GET (optional)
7039
+ */
7040
+ setMotionAlarmFull(opts: {
7041
+ channel?: number;
7042
+ enabled?: boolean;
7043
+ sensitivity?: number;
7044
+ valueTable?: string;
7045
+ }): Promise<void>;
6516
7046
  /**
6517
7047
  * Set AI detection settings via Baichuan.
6518
7048
  * cmd_id: 343 (SetAiAlarm)
@@ -6803,25 +7333,30 @@ declare class ReolinkBaichuanApi {
6803
7333
  }): Promise<EncConfig>;
6804
7334
  /**
6805
7335
  * SetEnc via Baichuan (cmdId=57). Read-modify-write — preserves
6806
- * unspecified fields. Mirrors reolink_aio's `SetEnc`.
7336
+ * unspecified fields. Mirrors reolink_aio's `SetEnc` plus the additional
7337
+ * `width`/`height`/`encoderType`/`encoderProfile`/`gop`/`thirdStream`
7338
+ * fields observed in the official mobile app (see `pcap/resolution.pcapng`).
7339
+ *
7340
+ * Field meaning per stream:
7341
+ * - `audio` — 0/1 toggle
7342
+ * - `width`/`height` — resolution in pixels. Must be one of the
7343
+ * resolutions returned by {@link getStreamInfoList}.
7344
+ * - `bitRate` — kbps. Must match the table from `getStreamInfoList`.
7345
+ * - `frameRate` — fps. Must match the table from `getStreamInfoList`.
7346
+ * - `videoEncType` — `"h264"` or `"h265"`
7347
+ * - `encoderType` — `"vbr"` or `"cbr"`
7348
+ * - `encoderProfile` — `"high"`, `"main"`, or `"baseline"`
7349
+ * - `gop` — keyframe interval in seconds (sets `<gop><cur>`)
6807
7350
  *
6808
7351
  * @param channel - Channel number (0-based)
6809
- * @param patch - Fields to update on `mainStream` and/or `subStream`,
6810
- * plus a top-level `audio` toggle (0/1). Pass only what you want
6811
- * to change.
7352
+ * @param patch - Fields to update. Pass only the fields you want to change;
7353
+ * everything else is preserved from the device's current configuration.
6812
7354
  */
6813
7355
  setEnc(channel: number, patch: {
6814
7356
  audio?: 0 | 1;
6815
- mainStream?: {
6816
- bitRate?: number;
6817
- frameRate?: number;
6818
- videoEncType?: "h264" | "h265";
6819
- };
6820
- subStream?: {
6821
- bitRate?: number;
6822
- frameRate?: number;
6823
- videoEncType?: "h264" | "h265";
6824
- };
7357
+ mainStream?: EncStreamPatch;
7358
+ subStream?: EncStreamPatch;
7359
+ thirdStream?: EncStreamPatch;
6825
7360
  }, options?: {
6826
7361
  timeoutMs?: number;
6827
7362
  }): Promise<void>;
@@ -7081,6 +7616,35 @@ declare class ReolinkBaichuanApi {
7081
7616
  getCoordinatePointListFromPushCache(channel?: number): BaichuanCachedPush<BaichuanCoordinatePointListPush> | undefined;
7082
7617
  private isNvrLikeDevice;
7083
7618
  private sendPcapDerivedSettingsGetXml;
7619
+ /**
7620
+ * Update the OSD timestamp + channel-name overlay via cmd_id=45
7621
+ * (SetOsdDatetime). The schema is the same `<body><OsdDatetime>` +
7622
+ * `<OsdChannelName>` block returned by `getOsdDatetime` — we
7623
+ * read-modify-write so any extension fields the camera sent are
7624
+ * preserved.
7625
+ *
7626
+ * Position is in **camera pixel coordinates** (e.g. (1,1) for top-left,
7627
+ * not preset strings). Set `enable=0` to hide the overlay; the camera
7628
+ * keeps the stored position so re-enabling later restores it.
7629
+ */
7630
+ setOsdDatetime(channel: number, patch: {
7631
+ datetime?: {
7632
+ enable?: boolean | 0 | 1;
7633
+ topLeftX?: number;
7634
+ topLeftY?: number;
7635
+ language?: string;
7636
+ };
7637
+ channelName?: {
7638
+ name?: string;
7639
+ enable?: boolean | 0 | 1;
7640
+ topLeftX?: number;
7641
+ topLeftY?: number;
7642
+ enWatermark?: boolean | 0 | 1;
7643
+ enBgcolor?: boolean | 0 | 1;
7644
+ };
7645
+ }, options?: {
7646
+ timeoutMs?: number;
7647
+ }): Promise<void>;
7084
7648
  getOsdDatetime(channel: number, options?: {
7085
7649
  timeoutMs?: number;
7086
7650
  }): Promise<BaichuanGetOsdDatetimeResult>;
@@ -7099,6 +7663,36 @@ declare class ReolinkBaichuanApi {
7099
7663
  getStreamInfoList(channel: number, options?: {
7100
7664
  timeoutMs?: number;
7101
7665
  }): Promise<BaichuanStreamInfoList>;
7666
+ /**
7667
+ * Return the set of values `setEnc` will accept on each stream of `channel`.
7668
+ * Aggregates `getStreamInfoList` (cmd_146) into a UI-friendly shape:
7669
+ * per-stream resolutions with their allowed codecs/framerates/bitrates plus
7670
+ * the enumerated encoder modes/profiles Reolink exposes.
7671
+ *
7672
+ * Useful for populating selectors and validating user input before calling
7673
+ * `setEnc` — picking an unsupported combination causes the camera to reject
7674
+ * the SET_ENC command (responseCode != 200).
7675
+ */
7676
+ getEncOptions(channel: number, options?: {
7677
+ timeoutMs?: number;
7678
+ }): Promise<EncOptions>;
7679
+ /**
7680
+ * Read the camera's `<VersionInfo>` block (cmd_id=80). Returns the
7681
+ * friendly name, model code (e.g. `"E1 Zoom"`), serial number, firmware
7682
+ * version, hardware revision, build day, AI model bundle version, etc.
7683
+ *
7684
+ * This is the same info the Reolink mobile app shows in "About this
7685
+ * device" — distinct from `getSystemGeneral` (cmd_104) which carries
7686
+ * time/locale.
7687
+ *
7688
+ * No channel parameter: this command is device-global on NVRs/Hubs and
7689
+ * camera-global on standalone cameras. Pass an explicit channel via the
7690
+ * underlying `sendXml` only if a specific firmware demands it (none we've
7691
+ * tested do).
7692
+ */
7693
+ getVersionInfo(options?: {
7694
+ timeoutMs?: number;
7695
+ }): Promise<BaichuanVersionInfo>;
7102
7696
  getLedState(channel: number, options?: {
7103
7697
  timeoutMs?: number;
7104
7698
  }): Promise<BaichuanLedState>;
@@ -9008,6 +9602,9 @@ declare class Go2rtcTcpServer extends EventEmitter<{
9008
9602
  private resolvedPort;
9009
9603
  private nativeFanout;
9010
9604
  private nativeStreamActive;
9605
+ private nativeStreamStopping;
9606
+ private nativeStreamRetryTimer;
9607
+ private nativeStreamRetryDelayMs;
9011
9608
  private dedicatedSessionRelease;
9012
9609
  private detectedVideoType;
9013
9610
  private connectedClients;
@@ -9069,6 +9666,21 @@ declare class Go2rtcTcpServer extends EventEmitter<{
9069
9666
  * Returns null when the buffer is not a valid ADTS frame.
9070
9667
  */
9071
9668
  private static parseAdtsSamplingInfo;
9669
+ /**
9670
+ * Schedule another startNativeStream() attempt after the given delay.
9671
+ * Idempotent: a no-op if a retry is already scheduled, the server is no
9672
+ * longer active, or an explicit stop is in progress. Implements unbounded
9673
+ * exponential backoff (5s → 60s) so a camera that stays unreachable for
9674
+ * minutes (e.g. nightly maintenance reboot) eventually recovers without
9675
+ * manual intervention — see issue #16.
9676
+ */
9677
+ private scheduleNativeStreamRetry;
9678
+ /**
9679
+ * Cancel any pending retry timer and reset the backoff. Called on explicit
9680
+ * stop and on first-frame-received so the next failure starts the backoff
9681
+ * window from scratch.
9682
+ */
9683
+ private clearNativeStreamRetry;
9072
9684
  private startNativeStream;
9073
9685
  private stopNativeStream;
9074
9686
  private startStreamHealthMonitor;
@@ -9368,6 +9980,12 @@ interface BaichuanWebRTCServerOptions {
9368
9980
  iceAdditionalHostAddresses?: string[];
9369
9981
  /** Force relay-only (TURN) if needed */
9370
9982
  iceTransportPolicy?: "all" | "relay";
9983
+ /**
9984
+ * Path to ffmpeg used for AAC → Opus audio transcoding. Defaults to
9985
+ * "ffmpeg" on PATH. Pass an empty string to disable audio (the audio track
9986
+ * will still appear in the SDP for SDP-stability, but stay silent).
9987
+ */
9988
+ ffmpegPath?: string;
9371
9989
  /** Logger callback */
9372
9990
  logger?: (level: "debug" | "info" | "warn" | "error", message: string) => void;
9373
9991
  }
@@ -9466,6 +10084,14 @@ declare class BaichuanWebRTCServer extends EventEmitter {
9466
10084
  * H.265 → DataChannel with raw Annex-B frames (decoded by WebCodecs in browser)
9467
10085
  */
9468
10086
  private pumpFramesToWebRTC;
10087
+ /**
10088
+ * Lazily start the AAC → Opus transcoder for `session` and wire it to the
10089
+ * audio RTP track. ffmpeg writes RTP-formatted Opus packets back to a UDP
10090
+ * loopback the transcoder owns; we strip the RTP header and rewrap the
10091
+ * Opus payload with our audioTrack's SSRC so the browser receives a
10092
+ * coherent stream.
10093
+ */
10094
+ private ensureAudioTranscoder;
9469
10095
  /**
9470
10096
  * Send H.264 frame via RTP media track
9471
10097
  * Returns the number of RTP packets sent
@@ -9724,127 +10350,6 @@ declare function createMjpegBoundary(): string;
9724
10350
  declare function getMjpegContentType(boundary: string): string;
9725
10351
  declare function formatMjpegFrame(frame: Buffer, boundary: string): Buffer;
9726
10352
 
9727
- /**
9728
- * BcMedia Parser - Parses Baichuan media packets (video/audio frames)
9729
- *
9730
- * BcMedia packets have magic headers that identify the packet type:
9731
- * - InfoV1: 0x31303031
9732
- * - InfoV2: 0x32303031
9733
- * - IFrame: 0x63643030 - 0x63643039 (includes channel number)
9734
- * - PFrame: 0x63643130 - 0x63643139 (includes channel number)
9735
- * - AAC: 0x62773530
9736
- * - ADPCM: 0x62773130
9737
- */
9738
- type BcMediaType = "InfoV1" | "InfoV2" | "Iframe" | "Pframe" | "Aac" | "Adpcm";
9739
- interface BcMediaIframe {
9740
- type: "Iframe";
9741
- videoType: "H264" | "H265";
9742
- microseconds: number;
9743
- time?: number;
9744
- /** Raw additional header (if present) */
9745
- additionalHeader?: Buffer;
9746
- /** Additional header size */
9747
- additionalHeaderSize?: number;
9748
- /** Unknown u32 field after microseconds */
9749
- unknown?: number;
9750
- data: Buffer;
9751
- }
9752
- interface BcMediaPframe {
9753
- type: "Pframe";
9754
- videoType: "H264" | "H265";
9755
- microseconds: number;
9756
- /** Raw additional header (if present) */
9757
- additionalHeader?: Buffer;
9758
- /** Additional header size */
9759
- additionalHeaderSize?: number;
9760
- /** Unknown u32 field after microseconds */
9761
- unknown?: number;
9762
- data: Buffer;
9763
- }
9764
- interface BcMediaInfoV1 {
9765
- type: "InfoV1";
9766
- videoWidth: number;
9767
- videoHeight: number;
9768
- fps: number;
9769
- startYear: number;
9770
- startMonth: number;
9771
- startDay: number;
9772
- startHour: number;
9773
- startMin: number;
9774
- startSeconds: number;
9775
- endYear: number;
9776
- endMonth: number;
9777
- endDay: number;
9778
- endHour: number;
9779
- endMin: number;
9780
- endSeconds: number;
9781
- }
9782
- interface BcMediaInfoV2 {
9783
- type: "InfoV2";
9784
- videoWidth: number;
9785
- videoHeight: number;
9786
- fps: number;
9787
- startYear: number;
9788
- startMonth: number;
9789
- startDay: number;
9790
- startHour: number;
9791
- startMin: number;
9792
- startSeconds: number;
9793
- endYear: number;
9794
- endMonth: number;
9795
- endDay: number;
9796
- endHour: number;
9797
- endMin: number;
9798
- endSeconds: number;
9799
- }
9800
- interface BcMediaAac {
9801
- type: "Aac";
9802
- data: Buffer;
9803
- }
9804
- interface BcMediaAdpcm {
9805
- type: "Adpcm";
9806
- data: Buffer;
9807
- }
9808
- type BcMedia = BcMediaIframe | BcMediaPframe | BcMediaInfoV1 | BcMediaInfoV2 | BcMediaAac | BcMediaAdpcm;
9809
- /**
9810
- * Parse BcMedia packet from binary data.
9811
- */
9812
- declare function parseBcMedia(buf: Buffer): {
9813
- media: BcMedia;
9814
- consumed: number;
9815
- } | null;
9816
-
9817
- /**
9818
- * BcMedia Codec - Assembles fragmented BcMedia packets from stream
9819
- *
9820
- * BcMedia packets can be fragmented across multiple Baichuan frames.
9821
- * This codec buffers incomplete packets and assembles them when complete.
9822
- */
9823
-
9824
- declare class BcMediaCodec {
9825
- private buffer;
9826
- private strict;
9827
- private amountSkipped;
9828
- private logger;
9829
- constructor(strict?: boolean, logger?: Logger);
9830
- /**
9831
- * Push data into the codec buffer and try to parse complete BcMedia packets.
9832
- * Returns an array of complete BcMedia packets found.
9833
- *
9834
- * @param chunk - New data chunk to add to buffer
9835
- * @returns Array of complete BcMedia packets (empty if none complete yet)
9836
- */
9837
- decode(chunk: Buffer): BcMedia[];
9838
- /**
9839
- * Get remaining buffer (for debugging)
9840
- */
9841
- getRemainingBuffer(): Buffer;
9842
- /**
9843
- * Clear the buffer (useful for resetting the codec)
9844
- */
9845
- clear(): void;
9846
- }
9847
-
9848
10353
  /**
9849
10354
  * H.264 Format Converter
9850
10355
  * Converts H.264 data from length-prefixed (AVCC) to Annex-B (start codes).
@@ -10116,4 +10621,65 @@ declare class CompositeRtspServer extends EventEmitter<{
10116
10621
  getClientCount(): number;
10117
10622
  }
10118
10623
 
10119
- export { type AIDetectionState, type AIEvent, type AIState, type AbilityInfo, type AccessUserListConfig, AesStreamDecryptor, type AiAlarmConfig, type AiConfig, type AiDenoiseConfig, type AiKey, type AiTypesCacheEntry, type AnyBuffer, type AudioAlarmParams, type AudioCfgConfig, type AudioConfig, type AudioNoiseConfig, type AudioTaskConfig, type AutoDetectInputs, type AutoDetectMode, type AutoDetectResult, type AutoFocusConfig, AutodiscoveryClient, type AutodiscoveryClientOptions, BC_AES_IV, BC_CLASS_FILE_DOWNLOAD, BC_CLASS_LEGACY, BC_CLASS_MODERN_20, BC_CLASS_MODERN_24, BC_CLASS_MODERN_24_ALT, BC_CMD_ID_ABILITY_INFO, BC_CMD_ID_ALARM_EVENT_LIST, BC_CMD_ID_AUDIO_ALARM_PLAY, BC_CMD_ID_CHANNEL_INFO_ALL, BC_CMD_ID_CMD_123, BC_CMD_ID_CMD_209, BC_CMD_ID_CMD_265, BC_CMD_ID_CMD_440, BC_CMD_ID_COVER_PREVIEW, BC_CMD_ID_COVER_RESPONSE, BC_CMD_ID_COVER_STANDALONE_458, BC_CMD_ID_COVER_STANDALONE_459, BC_CMD_ID_COVER_STANDALONE_460, BC_CMD_ID_COVER_STANDALONE_461, BC_CMD_ID_COVER_STANDALONE_462, BC_CMD_ID_DING_DONG_CTRL, BC_CMD_ID_DING_DONG_OPT, BC_CMD_ID_FILE_INFO_LIST_CLOSE, BC_CMD_ID_FILE_INFO_LIST_DL_VIDEO, BC_CMD_ID_FILE_INFO_LIST_DOWNLOAD, BC_CMD_ID_FILE_INFO_LIST_GET, BC_CMD_ID_FILE_INFO_LIST_OPEN, BC_CMD_ID_FILE_INFO_LIST_REPLAY, BC_CMD_ID_FILE_INFO_LIST_STOP, BC_CMD_ID_FIND_REC_VIDEO_CLOSE, BC_CMD_ID_FIND_REC_VIDEO_GET, BC_CMD_ID_FIND_REC_VIDEO_OPEN, BC_CMD_ID_FLOODLIGHT_STATUS_LIST, BC_CMD_ID_GET_ABILITY_SUPPORT, BC_CMD_ID_GET_ACCESS_USER_LIST, BC_CMD_ID_GET_AI_ALARM, BC_CMD_ID_GET_AI_CFG, BC_CMD_ID_GET_AI_DENOISE, BC_CMD_ID_GET_AUDIO_ALARM, BC_CMD_ID_GET_AUDIO_CFG, BC_CMD_ID_GET_AUDIO_TASK, BC_CMD_ID_GET_AUTO_FOCUS, BC_CMD_ID_GET_BATTERY_INFO, BC_CMD_ID_GET_BATTERY_INFO_LIST, BC_CMD_ID_GET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_GET_DAY_RECORDS, BC_CMD_ID_GET_DING_DONG_CFG, BC_CMD_ID_GET_DING_DONG_LIST, BC_CMD_ID_GET_DING_DONG_SILENT, BC_CMD_ID_GET_EMAIL_TASK, BC_CMD_ID_GET_ENC, BC_CMD_ID_GET_FTP_TASK, BC_CMD_ID_GET_HDD_INFO_LIST, BC_CMD_ID_GET_KIT_AP_CFG, BC_CMD_ID_GET_LED_STATE, BC_CMD_ID_GET_MOTION_ALARM, BC_CMD_ID_GET_ONLINE_USER_LIST, BC_CMD_ID_GET_OSD_DATETIME, BC_CMD_ID_GET_PIR_INFO, BC_CMD_ID_GET_PRIVACY_MASK, BC_CMD_ID_GET_PTZ_POSITION, BC_CMD_ID_GET_PTZ_PRESET, BC_CMD_ID_GET_PUSH_TASK, BC_CMD_ID_GET_RECORD, BC_CMD_ID_GET_RECORD_CFG, BC_CMD_ID_GET_REC_ENC_CFG, BC_CMD_ID_GET_SIREN_STATUS, BC_CMD_ID_GET_SLEEP_STATE, BC_CMD_ID_GET_STREAM_INFO_LIST, BC_CMD_ID_GET_SUPPORT, BC_CMD_ID_GET_SYSTEM_GENERAL, BC_CMD_ID_GET_TIMELAPSE_CFG, BC_CMD_ID_GET_VIDEO_INPUT, BC_CMD_ID_GET_WHITE_LED, BC_CMD_ID_GET_WIFI, BC_CMD_ID_GET_WIFI_SIGNAL, BC_CMD_ID_GET_ZOOM_FOCUS, BC_CMD_ID_LOGIN, BC_CMD_ID_LOGOUT, BC_CMD_ID_PING, BC_CMD_ID_PTZ_CONTROL, BC_CMD_ID_PTZ_CONTROL_PRESET, BC_CMD_ID_PUSH_COORDINATE_POINT_LIST, BC_CMD_ID_PUSH_DINGDONG_LIST, BC_CMD_ID_PUSH_NET_INFO, BC_CMD_ID_PUSH_SERIAL, BC_CMD_ID_PUSH_SLEEP_STATUS, BC_CMD_ID_PUSH_VIDEO_INPUT, BC_CMD_ID_QUICK_REPLY_PLAY, BC_CMD_ID_SET_AI_ALARM, BC_CMD_ID_SET_AI_CFG, BC_CMD_ID_SET_AI_DENOISE, BC_CMD_ID_SET_AUDIO_CFG, BC_CMD_ID_SET_AUDIO_TASK, BC_CMD_ID_SET_AUTO_FOCUS, BC_CMD_ID_SET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_SET_DING_DONG_CFG, BC_CMD_ID_SET_DING_DONG_SILENT, BC_CMD_ID_SET_EMAIL_TASK, BC_CMD_ID_SET_ENC, BC_CMD_ID_SET_LED_STATE, BC_CMD_ID_SET_MOTION_ALARM, BC_CMD_ID_SET_PIR_INFO, BC_CMD_ID_SET_PRIVACY_MASK, BC_CMD_ID_SET_PUSH_TASK, BC_CMD_ID_SET_RECORD, BC_CMD_ID_SET_RECORD_CFG, BC_CMD_ID_SET_VIDEO_INPUT, BC_CMD_ID_SET_WHITE_LED_STATE, BC_CMD_ID_SET_WHITE_LED_TASK, BC_CMD_ID_SET_ZOOM_FOCUS, BC_CMD_ID_SUPPORT, BC_CMD_ID_TALK, BC_CMD_ID_TALK_ABILITY, BC_CMD_ID_TALK_CONFIG, BC_CMD_ID_TALK_RESET, BC_CMD_ID_UDP_KEEP_ALIVE, BC_CMD_ID_VIDEO, BC_CMD_ID_VIDEO_STOP, BC_MAGIC, BC_MAGIC_REV, BC_TCP_DEFAULT_PORT, BC_XML_KEY, type BaichuanCachedPush, BaichuanClient, type BaichuanClientOptions, type BaichuanCoordinatePointListPush, type BaichuanDingdongListPush, type BaichuanEndpointsServerOptions, BaichuanEventEmitter, type BaichuanFrame, BaichuanFrameParser, type BaichuanGetOsdDatetimeResult, type BaichuanHeader, BaichuanHlsServer, type BaichuanHlsServerOptions, BaichuanHttpStreamServer, type BaichuanHttpStreamServerOptions, type BaichuanLedState, BaichuanMjpegServer, type BaichuanMjpegServerOptions, type BaichuanNetInfoPush, type BaichuanOsdChannelName, type BaichuanOsdDatetime, type BaichuanRecordCfg, type BaichuanRecordSchedule, BaichuanRtspServer, type BaichuanRtspServerOptions, type BaichuanSerialPush, type BaichuanSettingsPushCacheEntry, type BaichuanSleepState, type BaichuanSleepStatusPush, type BaichuanStreamEncodeTable, type BaichuanStreamInfo, type BaichuanStreamInfoList, type BaichuanTransport, type BaichuanVideoInputPush, BaichuanVideoStream, type BaichuanVideoStreamOptions, BaichuanWebRTCServer, type BaichuanWebRTCServerOptions, type BaichuanWifi, type BaichuanWifiSignal, type BatteryInfo, type BatteryInfoResponse, type BcMedia, type BcMediaAac, type BcMediaAdpcm, BcMediaAnnexBDecoder, type BcMediaAnnexBDecoderStats, type BcMediaAnnexBInfo, type BcMediaAudioFrame, type BcMediaAudioType, BcMediaCodec, type BcMediaIframe, type BcMediaInfoV1, type BcMediaInfoV2, type BcMediaPframe, type BcMediaType, type BcMediaVideoFrame, type BcMediaVideoType, type BcUdpDiscoveryMethod, BcUdpStream, type BcUdpStreamOptions, type CgiAbility, type CgiAbilityChn, type CgiAbilityLeaf, type CgiAiAlarm, type CgiAiCfg, type CgiAiKey, type CgiAiStateValue, type CgiAudioAlarm, type CgiAudioAlarmPlayParam, type CgiAudioCfg, type CgiAudioNoise, type CgiAutoFocus, type CgiBattery, type CgiChannelStatusEntry, type CgiChnTypeInfoValue, type CgiDetectionState, type CgiDevInfo, type CgiDeviceInfoEntries, type CgiEmail, type CgiEnc, type CgiEncStream, type CgiEncValue, type CgiGetAbilityResponse, type CgiGetAbilityValue, type CgiGetAiAlarmValue, type CgiGetAiCfgValue, type CgiGetAiStateResponse, type CgiGetAudioAlarmValue, type CgiGetAudioCfgValue, type CgiGetAudioNoiseValue, type CgiGetAutoFocusValue, type CgiGetChannelstatusResponse, type CgiGetChannelstatusValue, type CgiGetChnTypeInfoResponse, type CgiGetDevInfoResponse, type CgiGetDevInfoValue, type CgiGetEmailValue, type CgiGetEncResponse, type CgiGetImageValue, type CgiGetIrLightsValue, type CgiGetIspValue, type CgiGetMaskValue, type CgiGetMdAlarmValue, type CgiGetOsdValue, type CgiGetPushValue, type CgiGetRecValue, type CgiGetRtspUrlResponse, type CgiGetRtspUrlValue, type CgiGetVideoclipsParams, type CgiImage, type CgiIrLights, type CgiIsp, type CgiMask, type CgiMaskShelter, type CgiMdAlarm, type CgiMdAlarmScope, type CgiMdAlarmSens, type CgiNetPort, type CgiOsd, type CgiPirInfo, type CgiPtzPreset, type CgiPush, type CgiRec, type CgiRecSchedule, type CgiSetAiAlarmParam, type CgiSetAiCfgParam, type CgiSetAudioAlarmParam, type CgiSetAudioCfgParam, type CgiSetAudioNoiseParam, type CgiSetAutoFocusParam, type CgiSetEmailParam, type CgiSetEncParam, type CgiSetImageParam, type CgiSetIrLightsParam, type CgiSetIspParam, type CgiSetMaskParam, type CgiSetMdAlarmParam, type CgiSetOsdParam, type CgiSetPirInfoParam, type CgiSetPushParam, type CgiSetRecParam, type CgiSetWhiteLedParam, type CgiWhiteLed, type ChannelPushCacheEntry, type ChannelPushDataEntry, type ChannelRecordingFile, type ChannelStreamMetadata, type ChimeAlarmCfg, type ChimeCfg, type ChimeDevice, type ChimeParams, type CollectNvrDiagnosticsOptions, CompositeRtspServer, type CompositeRtspServerOptions, CompositeStream, type CompositeStreamOptions, type CompositeStreamPipOptions, type CompressionStream, DUAL_LENS_DUAL_MOTION_MODELS, DUAL_LENS_MODELS, DUAL_LENS_SINGLE_MOTION_MODELS, type DayNightThresholdConfig, type DebugConfig, type DebugOptions, type DeviceAbilities, type DeviceCapabilities, type DeviceCapabilitiesCacheEntry, type DeviceCapabilitiesDebugInfo, type DeviceCapabilitiesResult, type DeviceInfoResponse, type DeviceInputData, type DeviceObjectType, type DeviceStatusResponse, type DeviceSupportFlags, type DeviceType, type DiagnosticsCollectorResult, type DiagnosticsStreamKind, type DiscoveredDevice, type DiscoveryOptions, type DownloadRecordingParams, type DualLensChannelAnalysis, type DualLensChannelInfo, type EmailTaskConfig, type EncConfig, type EncryptionProtocol, type Events, type EventsResponse, type FloodlightTaskConfig, type FtpTaskConfig, type GetRecordingVideoResult, type GetRecordingVideoStats, type GetVideoclipsParams, type GetVodUrlParams, Go2rtcTcpServer, type Go2rtcTcpServerOptions, H264RtpDepacketizer, H265RtpDepacketizer, type HardwiredChimeState, type HddInfoListConfig, type HlsCodec, type HlsHttpResponse, type HlsServerStatus, type HlsSession, HlsSessionManager, type HlsSessionManagerOptions, type HlsSessionParams, Intercom, type IntercomOptions, type IrLightsConfig, type IspConfig, type JsonObject, type JsonPrimitive, type JsonValue, type LastSleepProbe, type LogLevel, type Logger, type LoggerCallback, type LoginResponseValue, type MaskConfig, type MaxEncryption, type MediaStream, type MjpegFrame, MjpegTransformer, type MjpegTransformerOptions, type ModelFixtureCaptureResult, type MotionAlarmConfig, type MotionEvent, MpegTsMuxer, type MpegTsMuxerOptions, NVR_HUB_EXACT_TYPES, NVR_HUB_MODEL_PATTERNS, type NativeVideoStreamVariant, type NvrChannelsSummaryCacheEntry, type OnlineUserListConfig, type OsdChannel, type OsdConfig, type OsdTime, type ParsedRecordingFileName, type PipPosition, type PirConfig, type PirState, type PlaybackSnapshotStreamInfo, type PtzCommand, type PtzPosition, type PtzPreset, type RecEncConfig, type RecordingAudioCodec, type RecordingDetectionClass, type RecordingDevType, type RecordingFile, type RecordingPlaybackUrls, type RecordingStreamType, type RecordingVideoCodec, type RecordingVodFlags, type RecordingVodStreamHint, type RecordingsCacheEntry, type RecordingsQueueItem, type ReolinkAiNotification, ReolinkBaichuanApi, type ReolinkBaichuanChannelIdentity, type ReolinkBaichuanChannelInfo, type ReolinkBaichuanDeviceSummary, type ReolinkBaichuanNetworkInfo, type ReolinkBaichuanPorts, ReolinkCgiApi, type ReolinkCmdRequest, type ReolinkCmdResponse, type ReolinkCmdResponseExt, type ReolinkDayNightNotification, type ReolinkDeviceInfo, type ReolinkDeviceInfoTag, type ReolinkEvent, ReolinkHttpClient, type ReolinkHttpClientOptions, type ReolinkJson, type ReolinkMotionNotification, type ReolinkNvrChannelInfo, type ReolinkNvrDeviceGroupSummary, type ReolinkNvrDeviceGroupsResult, type ReolinkSimpleEvent, type ReolinkSimpleEventType, type ReolinkSupportedStream, type ReolinkVideoStreamOptionsResult, type ReolinkVisitorNotification, type ReplayHttpServer, type ReplayHttpServerOptions, type ResponseMediaStreamOptions, type Rfc4571ApiFactoryContext, type Rfc4571Client, Rfc4571Muxer, type Rfc4571ReplayServer, type Rfc4571ReplayServerOptions, type Rfc4571TcpServer, type Rfc4571TcpServerOptions, type RtpPacketizationOptions, type RtspCreateOptions, type RtspProxyServerOptions, type RtspStreamProfile, type RunAllDiagnosticsConsecutivelyParams, type RunAllDiagnosticsConsecutivelyResult, type RunMultifocalDiagnosticsConsecutivelyParams, type RunMultifocalDiagnosticsConsecutivelyResult, type SirenState, type SirenStatusConfig, type SleepInferenceDecision, type SleepInferenceInput, type SleepInferencePending, type SleepState, type SleepStatus, type StreamMetadata, type StreamProfile, type StreamSamplingOptions, type StreamSamplingSelection, type SupportConfig, type SupportInfo, type SupportItem, type SystemGeneralConfig, type TalkAbility$1 as TalkAbility, type TalkAudioConfig, type TalkConfig, type TalkSession$1 as TalkSession, type TalkSessionInfo, type TimelapseCfgConfig, type TwoWayAudioConfig, type VideoCodec, type VideoInputConfig, type VideoParamSets, type VideoStreamOptions, type VideoStreamOptionsCacheEntry, type VideoType, type VideoclipClientInfo, type VideoclipModeDecision, type VideoclipThumbnailResult, type VideoclipTranscodeMode, type VodFile, type VodSearchResponse, type VodSearchResult, type VodSearchStatus, type WakeUpOptions, type WebRTCAnswer, type WebRTCIceCandidate, type WebRTCOffer, type WebRTCSessionInfo, type WhiteLedConfig, type WhiteLedState, type WirelessChimeSilentState, type ZoomFocusStatus, type ZoomFocusTriplet, abilitiesHasAny, aesDecrypt, aesEncrypt, applyStreamPatch, applyXmlTagPatch, asLogger, autoDetectDeviceType, bcDecrypt, bcEncrypt, bcHeaderHasPayloadOffset, buildAacAudioSpecificConfigHex, buildAbilityInfoExtensionXml, buildBinaryExtensionXml, buildChannelExtensionXml, buildFloodlightManualXml, buildHlsRedirectUrl, buildLoginXml, buildLogoutXml, buildPreviewStopXml, buildPreviewStopXmlV11, buildPreviewXml, buildPreviewXmlV11, buildPtzControlXml, buildPtzPresetXml, buildPtzPresetXmlV2, buildRfc4571Sdp, buildRtspPath, buildRtspUrl, buildSirenManualXml, buildSirenTimesXml, buildStartZoomFocusXml, buildWhiteLedStateXml, captureModelFixtures, collectCgiDiagnostics, collectMultifocalDiagnostics, collectNativeDiagnostics, collectNvrDiagnostics, computeDeviceCapabilities, computeExpectedStreamCompatibility, convertToAnnexB as convertH265ToAnnexB, convertToAnnexB$1 as convertToAnnexB, convertToLengthPrefixed, createBaichuanEndpointsServer, createDebugGateLogger, createDiagnosticsBundle, createLogger, createMjpegBoundary, createNativeStream, createNullLogger, createReplayHttpServer, createRfc4571TcpServer, createRfc4571TcpServerForReplay, createRtspProxyServer, createTaggedLogger, decideSleepInferenceTransition, decideVideoclipTranscodeMode, decodeHeader, deriveAesKey, detectIosClient, detectVideoCodecFromNal, discoverReolinkDevices, discoverViaArpTable, discoverViaDhcpListener, discoverViaHttpScan, discoverViaOnvif, discoverViaTcpPortScan, discoverViaUdpBroadcast, discoverViaUdpDirect, encodeHeader, ensureXmlHeader, extractH264ParamSetsFromAccessUnit, extractH265ParamSetsFromAccessUnit, extractPpsFromAnnexB, extractSpsFromAnnexB, extractVpsFromAnnexB, flattenAbilitiesForChannel, formatMjpegFrame, getConstructedVideoStreamOptions, getGlobalLogger, getH265NalType, getMjpegContentType, getSupportItemForChannel, getVideoStream, getVideoclipClientInfo, getXmlText, hasStartCodes as hasH265StartCodes, hasStartCodes$1 as hasStartCodes, isDualLenseModel, isH264KeyframeAnnexB, isH265Irap, isH265KeyframeAnnexB, isNvrHubModel, isTcpFailureThatShouldFallbackToUdp, isValidH264AnnexBAccessUnit, isValidH265AnnexBAccessUnit, maskUid, md5HexUpper, md5StrModern, normalizeDayNightMode, normalizeOpenClose, normalizeUid, packetizeAacAdtsFrame, packetizeAacRawFrame, packetizeH264, packetizeH265, parseAdtsHeader, parseBcMedia, parseRecordingFileName, parseSupportXml, patchNestedTag, printNvrDiagnostics, runAllDiagnosticsConsecutively, runMultifocalDiagnosticsConsecutively, sampleStreams, sanitizeFixtureData, setGlobalLogger, splitAnnexBToNalPayloads$1 as splitAnnexBToNalPayloads, splitAnnexBToNals, splitAnnexBToNalPayloads as splitH265AnnexBToNalPayloads, testChannelStreams, xmlEscape, xmlIndicatesFloodlight, zipDirectory };
10624
+ /**
10625
+ * Motion-detection zone grid helpers.
10626
+ *
10627
+ * Reolink's GetMdAlarm response (cmd_id=46) carries the active detection
10628
+ * region as a base64-encoded bitmap inside `<scope><valueTable>...</valueTable></scope>`.
10629
+ * The bitmap has one bit per grid cell:
10630
+ *
10631
+ * <scope>
10632
+ * <columns>96</columns>
10633
+ * <rows>64</rows>
10634
+ * <valueTable>{base64 of columns*rows bits, packed MSB-first per byte}</valueTable>
10635
+ * </scope>
10636
+ *
10637
+ * The same shape is reused by AI detection (`<AiDetectCfg><area>...</area>`)
10638
+ * — only the column/row counts differ across firmwares. Use the helpers
10639
+ * here to round-trip between the camera's base64 string and a flat boolean
10640
+ * grid the UI can render and edit.
10641
+ */
10642
+ interface MotionZoneScope {
10643
+ /** Active region width (effective grid columns, `<width>` in MD). */
10644
+ width: number;
10645
+ /** Active region height (effective grid rows, `<height>` in MD). */
10646
+ height: number;
10647
+ /** Bitmap columns reported by `<scope><columns>`. */
10648
+ columns: number;
10649
+ /** Bitmap rows reported by `<scope><rows>`. */
10650
+ rows: number;
10651
+ /** Flat `width × height` array, row-major. `true` = cell included. */
10652
+ cells: boolean[];
10653
+ }
10654
+ /**
10655
+ * Decode the base64 `valueTable` from a `<scope>` (or `<area>`) into a flat
10656
+ * boolean grid. Bytes are packed MSB-first: bit 7 of byte 0 is cell (0,0).
10657
+ *
10658
+ * The camera ships TWO pairs of dimensions: `<scope><columns>×<rows>`
10659
+ * (bitmap size — typically 96×64) and `<width>×<height>` in the parent
10660
+ * block (the effective motion grid — typically smaller, e.g. 60×33 on
10661
+ * E1 Zoom). The user-editable region matches `width × height`, not the
10662
+ * full bitmap; bits past that are camera-side padding that stays 0.
10663
+ *
10664
+ * When `width`/`height` are omitted we treat the whole bitmap as the
10665
+ * active region (back-compat).
10666
+ *
10667
+ * Throws if the base64 contains too few bytes for `columns*rows` bits.
10668
+ */
10669
+ declare function decodeMotionScopeBitmap(valueTable: string, columns: number, rows: number, width?: number, height?: number): MotionZoneScope;
10670
+ /**
10671
+ * Encode a `width × height` boolean grid back into the camera's
10672
+ * `columns × rows` `valueTable`. Bits outside the active region stay 0,
10673
+ * matching what the camera ships on the way down.
10674
+ *
10675
+ * `scope.cells.length` must equal `scope.width * scope.height`.
10676
+ */
10677
+ declare function encodeMotionScopeBitmap(scope: MotionZoneScope): string;
10678
+ /**
10679
+ * Convenience: build an "everything enabled" grid of the given dimensions.
10680
+ * Useful when the camera response has no `<valueTable>` and we want to
10681
+ * start the user off with a clean slate.
10682
+ */
10683
+ declare function fullCoverageScope(columns: number, rows: number, width?: number, height?: number): MotionZoneScope;
10684
+
10685
+ export { type AIDetectionState, type AIEvent, type AIState, type AbilityInfo, type AccessUserListConfig, AesStreamDecryptor, type AiAlarmConfig, type AiConfig, type AiDenoiseConfig, type AiKey, type AiTypesCacheEntry, type AnyBuffer, type AudioAlarmParams, type AudioCfgConfig, type AudioConfig, type AudioNoiseConfig, type AudioTaskConfig, type AutoDetectInputs, type AutoDetectMode, type AutoDetectResult, type AutoFocusConfig, AutodiscoveryClient, type AutodiscoveryClientOptions, BC_AES_IV, BC_CLASS_FILE_DOWNLOAD, BC_CLASS_LEGACY, BC_CLASS_MODERN_20, BC_CLASS_MODERN_24, BC_CLASS_MODERN_24_ALT, BC_CMD_ID_ABILITY_INFO, BC_CMD_ID_ALARM_EVENT_LIST, BC_CMD_ID_AUDIO_ALARM_PLAY, BC_CMD_ID_CHANNEL_INFO_ALL, BC_CMD_ID_CMD_123, BC_CMD_ID_CMD_209, BC_CMD_ID_CMD_265, BC_CMD_ID_CMD_440, BC_CMD_ID_COVER_PREVIEW, BC_CMD_ID_COVER_RESPONSE, BC_CMD_ID_COVER_STANDALONE_458, BC_CMD_ID_COVER_STANDALONE_459, BC_CMD_ID_COVER_STANDALONE_460, BC_CMD_ID_COVER_STANDALONE_461, BC_CMD_ID_COVER_STANDALONE_462, BC_CMD_ID_DING_DONG_CTRL, BC_CMD_ID_DING_DONG_OPT, BC_CMD_ID_FILE_INFO_LIST_CLOSE, BC_CMD_ID_FILE_INFO_LIST_DL_VIDEO, BC_CMD_ID_FILE_INFO_LIST_DOWNLOAD, BC_CMD_ID_FILE_INFO_LIST_GET, BC_CMD_ID_FILE_INFO_LIST_OPEN, BC_CMD_ID_FILE_INFO_LIST_REPLAY, BC_CMD_ID_FILE_INFO_LIST_STOP, BC_CMD_ID_FIND_REC_VIDEO_CLOSE, BC_CMD_ID_FIND_REC_VIDEO_GET, BC_CMD_ID_FIND_REC_VIDEO_OPEN, BC_CMD_ID_FLOODLIGHT_STATUS_LIST, BC_CMD_ID_GET_ABILITY_SUPPORT, BC_CMD_ID_GET_ACCESS_USER_LIST, BC_CMD_ID_GET_AI_ALARM, BC_CMD_ID_GET_AI_CFG, BC_CMD_ID_GET_AI_DENOISE, BC_CMD_ID_GET_AUDIO_ALARM, BC_CMD_ID_GET_AUDIO_CFG, BC_CMD_ID_GET_AUDIO_TASK, BC_CMD_ID_GET_AUTO_FOCUS, BC_CMD_ID_GET_BATTERY_INFO, BC_CMD_ID_GET_BATTERY_INFO_LIST, BC_CMD_ID_GET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_GET_DAY_RECORDS, BC_CMD_ID_GET_DING_DONG_CFG, BC_CMD_ID_GET_DING_DONG_LIST, BC_CMD_ID_GET_DING_DONG_SILENT, BC_CMD_ID_GET_EMAIL_TASK, BC_CMD_ID_GET_ENC, BC_CMD_ID_GET_FTP_TASK, BC_CMD_ID_GET_HDD_INFO_LIST, BC_CMD_ID_GET_KIT_AP_CFG, BC_CMD_ID_GET_LED_STATE, BC_CMD_ID_GET_MOTION_ALARM, BC_CMD_ID_GET_ONLINE_USER_LIST, BC_CMD_ID_GET_OSD_DATETIME, BC_CMD_ID_GET_PIR_INFO, BC_CMD_ID_GET_PRIVACY_MASK, BC_CMD_ID_GET_PTZ_POSITION, BC_CMD_ID_GET_PTZ_PRESET, BC_CMD_ID_GET_PUSH_TASK, BC_CMD_ID_GET_RECORD, BC_CMD_ID_GET_RECORD_CFG, BC_CMD_ID_GET_REC_ENC_CFG, BC_CMD_ID_GET_SIREN_STATUS, BC_CMD_ID_GET_SLEEP_STATE, BC_CMD_ID_GET_STREAM_INFO_LIST, BC_CMD_ID_GET_SUPPORT, BC_CMD_ID_GET_SYSTEM_GENERAL, BC_CMD_ID_GET_TIMELAPSE_CFG, BC_CMD_ID_GET_VERSION_INFO, BC_CMD_ID_GET_VIDEO_INPUT, BC_CMD_ID_GET_WHITE_LED, BC_CMD_ID_GET_WIFI, BC_CMD_ID_GET_WIFI_SIGNAL, BC_CMD_ID_GET_ZOOM_FOCUS, BC_CMD_ID_LOGIN, BC_CMD_ID_LOGOUT, BC_CMD_ID_PING, BC_CMD_ID_PTZ_CONTROL, BC_CMD_ID_PTZ_CONTROL_PRESET, BC_CMD_ID_PUSH_COORDINATE_POINT_LIST, BC_CMD_ID_PUSH_DINGDONG_LIST, BC_CMD_ID_PUSH_NET_INFO, BC_CMD_ID_PUSH_SERIAL, BC_CMD_ID_PUSH_SLEEP_STATUS, BC_CMD_ID_PUSH_VIDEO_INPUT, BC_CMD_ID_QUICK_REPLY_PLAY, BC_CMD_ID_SET_AI_ALARM, BC_CMD_ID_SET_AI_CFG, BC_CMD_ID_SET_AI_DENOISE, BC_CMD_ID_SET_AUDIO_CFG, BC_CMD_ID_SET_AUDIO_TASK, BC_CMD_ID_SET_AUTO_FOCUS, BC_CMD_ID_SET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_SET_DING_DONG_CFG, BC_CMD_ID_SET_DING_DONG_SILENT, BC_CMD_ID_SET_EMAIL_TASK, BC_CMD_ID_SET_ENC, BC_CMD_ID_SET_LED_STATE, BC_CMD_ID_SET_MOTION_ALARM, BC_CMD_ID_SET_OSD_DATETIME, BC_CMD_ID_SET_PIR_INFO, BC_CMD_ID_SET_PRIVACY_MASK, BC_CMD_ID_SET_PUSH_TASK, BC_CMD_ID_SET_RECORD, BC_CMD_ID_SET_RECORD_CFG, BC_CMD_ID_SET_VIDEO_INPUT, BC_CMD_ID_SET_WHITE_LED_STATE, BC_CMD_ID_SET_WHITE_LED_TASK, BC_CMD_ID_SET_ZOOM_FOCUS, BC_CMD_ID_SUPPORT, BC_CMD_ID_TALK, BC_CMD_ID_TALK_ABILITY, BC_CMD_ID_TALK_CONFIG, BC_CMD_ID_TALK_RESET, BC_CMD_ID_UDP_KEEP_ALIVE, BC_CMD_ID_VIDEO, BC_CMD_ID_VIDEO_STOP, BC_MAGIC, BC_MAGIC_REV, BC_TCP_DEFAULT_PORT, BC_XML_KEY, type BaichuanCachedPush, BaichuanClient, type BaichuanClientOptions, type BaichuanCoordinatePointListPush, type BaichuanDingdongListPush, type BaichuanEndpointsServerOptions, BaichuanEventEmitter, type BaichuanFrame, BaichuanFrameParser, type BaichuanGetOsdDatetimeResult, type BaichuanHeader, BaichuanHlsServer, type BaichuanHlsServerOptions, BaichuanHttpStreamServer, type BaichuanHttpStreamServerOptions, type BaichuanLedState, BaichuanMjpegServer, type BaichuanMjpegServerOptions, type BaichuanNetInfoPush, type BaichuanOsdChannelName, type BaichuanOsdDatetime, type BaichuanRecordCfg, type BaichuanRecordSchedule, BaichuanRtspServer, type BaichuanRtspServerOptions, type BaichuanSerialPush, type BaichuanSettingsPushCacheEntry, type BaichuanSleepState, type BaichuanSleepStatusPush, type BaichuanStreamEncodeTable, type BaichuanStreamInfo, type BaichuanStreamInfoList, type BaichuanTransport, type BaichuanVersionInfo, type BaichuanVideoInputPush, BaichuanVideoStream, type BaichuanVideoStreamOptions, BaichuanWebRTCServer, type BaichuanWebRTCServerOptions, type BaichuanWifi, type BaichuanWifiSignal, type BatteryInfo, type BatteryInfoResponse, type BcMedia, type BcMediaAac, type BcMediaAdpcm, BcMediaAnnexBDecoder, type BcMediaAnnexBDecoderStats, type BcMediaAnnexBInfo, type BcMediaAudioFrame, type BcMediaAudioType, BcMediaCodec, type BcMediaIframe, type BcMediaInfoV1, type BcMediaInfoV2, type BcMediaPframe, type BcMediaType, type BcMediaVideoFrame, type BcMediaVideoType, type BcUdpDiscoveryMethod, BcUdpStream, type BcUdpStreamOptions, type CgiAbility, type CgiAbilityChn, type CgiAbilityLeaf, type CgiAiAlarm, type CgiAiCfg, type CgiAiKey, type CgiAiStateValue, type CgiAudioAlarm, type CgiAudioAlarmPlayParam, type CgiAudioCfg, type CgiAudioNoise, type CgiAutoFocus, type CgiBattery, type CgiChannelStatusEntry, type CgiChnTypeInfoValue, type CgiDetectionState, type CgiDevInfo, type CgiDeviceInfoEntries, type CgiEmail, type CgiEnc, type CgiEncStream, type CgiEncValue, type CgiGetAbilityResponse, type CgiGetAbilityValue, type CgiGetAiAlarmValue, type CgiGetAiCfgValue, type CgiGetAiStateResponse, type CgiGetAudioAlarmValue, type CgiGetAudioCfgValue, type CgiGetAudioNoiseValue, type CgiGetAutoFocusValue, type CgiGetChannelstatusResponse, type CgiGetChannelstatusValue, type CgiGetChnTypeInfoResponse, type CgiGetDevInfoResponse, type CgiGetDevInfoValue, type CgiGetEmailValue, type CgiGetEncResponse, type CgiGetImageValue, type CgiGetIrLightsValue, type CgiGetIspValue, type CgiGetMaskValue, type CgiGetMdAlarmValue, type CgiGetOsdValue, type CgiGetPushValue, type CgiGetRecValue, type CgiGetRtspUrlResponse, type CgiGetRtspUrlValue, type CgiGetVideoclipsParams, type CgiImage, type CgiIrLights, type CgiIsp, type CgiMask, type CgiMaskShelter, type CgiMdAlarm, type CgiMdAlarmScope, type CgiMdAlarmSens, type CgiNetPort, type CgiOsd, type CgiPirInfo, type CgiPtzPreset, type CgiPush, type CgiRec, type CgiRecSchedule, type CgiSetAiAlarmParam, type CgiSetAiCfgParam, type CgiSetAudioAlarmParam, type CgiSetAudioCfgParam, type CgiSetAudioNoiseParam, type CgiSetAutoFocusParam, type CgiSetEmailParam, type CgiSetEncParam, type CgiSetImageParam, type CgiSetIrLightsParam, type CgiSetIspParam, type CgiSetMaskParam, type CgiSetMdAlarmParam, type CgiSetOsdParam, type CgiSetPirInfoParam, type CgiSetPushParam, type CgiSetRecParam, type CgiSetWhiteLedParam, type CgiWhiteLed, type ChannelPushCacheEntry, type ChannelPushDataEntry, type ChannelRecordingFile, type ChannelStreamMetadata, type ChimeAlarmCfg, type ChimeCfg, type ChimeDevice, type ChimeParams, type CollectNvrDiagnosticsOptions, CompositeRtspServer, type CompositeRtspServerOptions, CompositeStream, type CompositeStreamOptions, type CompositeStreamPipOptions, type CompressionStream, DUAL_LENS_DUAL_MOTION_MODELS, DUAL_LENS_MODELS, DUAL_LENS_SINGLE_MOTION_MODELS, type DayNightThresholdConfig, type DebugConfig, type DebugOptions, type DeviceAbilities, type DeviceCapabilities, type DeviceCapabilitiesCacheEntry, type DeviceCapabilitiesDebugInfo, type DeviceCapabilitiesResult, type DeviceInfoResponse, type DeviceInputData, type DeviceObjectType, type DeviceStatusResponse, type DeviceSupportFlags, type DeviceType, type DiagnosticsCollectorResult, type DiagnosticsStreamKind, type DiscoveredDevice, type DiscoveryOptions, type DownloadRecordingParams, type DualLensChannelAnalysis, type DualLensChannelInfo, type EmailTaskConfig, type EncConfig, type EncOptions, type EncResolutionOption, type EncStreamOptions, type EncStreamPatch, type EncryptionProtocol, type Events, type EventsResponse, type FloodlightTaskConfig, type FtpTaskConfig, type GetRecordingVideoResult, type GetRecordingVideoStats, type GetVideoclipsParams, type GetVodUrlParams, Go2rtcTcpServer, type Go2rtcTcpServerOptions, H264RtpDepacketizer, H265RtpDepacketizer, type HardwiredChimeState, type HddInfoListConfig, type HlsCodec, type HlsHttpResponse, type HlsServerStatus, type HlsSession, HlsSessionManager, type HlsSessionManagerOptions, type HlsSessionParams, Intercom, type IntercomOptions, type IrLightsConfig, type IspConfig, type JsonObject, type JsonPrimitive, type JsonValue, type LastSleepProbe, type LogLevel, type Logger, type LoggerCallback, type LoginResponseValue, type MaskConfig, type MaxEncryption, type MediaStream, type MjpegFrame, MjpegTransformer, type MjpegTransformerOptions, type ModelFixtureCaptureResult, type MotionAlarmConfig, type MotionEvent, type MotionZoneScope, MpegTsMuxer, type MpegTsMuxerOptions, NVR_HUB_EXACT_TYPES, NVR_HUB_MODEL_PATTERNS, type NativeVideoStreamVariant, type NvrChannelsSummaryCacheEntry, type OnlineUserListConfig, type OsdChannel, type OsdConfig, type OsdTime, type ParsedRecordingFileName, type PipPosition, type PirConfig, type PirState, type PlaybackSnapshotStreamInfo, type PtzCommand, type PtzPosition, type PtzPreset, type RecEncConfig, type RecordingAudioCodec, type RecordingDetectionClass, type RecordingDevType, type RecordingFile, type RecordingPlaybackUrls, type RecordingStreamType, type RecordingVideoCodec, type RecordingVodFlags, type RecordingVodStreamHint, type RecordingsCacheEntry, type RecordingsQueueItem, type ReolinkAiNotification, ReolinkBaichuanApi, type ReolinkBaichuanChannelIdentity, type ReolinkBaichuanChannelInfo, type ReolinkBaichuanDeviceSummary, type ReolinkBaichuanNetworkInfo, type ReolinkBaichuanPorts, ReolinkCgiApi, type ReolinkCmdRequest, type ReolinkCmdResponse, type ReolinkCmdResponseExt, type ReolinkDayNightNotification, type ReolinkDetectionBox, type ReolinkDetectionDecodeState, type ReolinkDetectionEvent, type ReolinkDeviceInfo, type ReolinkDeviceInfoTag, type ReolinkEvent, ReolinkHttpClient, type ReolinkHttpClientOptions, type ReolinkJson, type ReolinkMotionNotification, type ReolinkNvrChannelInfo, type ReolinkNvrDeviceGroupSummary, type ReolinkNvrDeviceGroupsResult, type ReolinkSimpleEvent, type ReolinkSimpleEventType, type ReolinkSupportedStream, type ReolinkVideoStreamOptionsResult, type ReolinkVisitorNotification, type ReplayHttpServer, type ReplayHttpServerOptions, type ResponseMediaStreamOptions, type Rfc4571ApiFactoryContext, type Rfc4571Client, Rfc4571Muxer, type Rfc4571ReplayServer, type Rfc4571ReplayServerOptions, type Rfc4571TcpServer, type Rfc4571TcpServerOptions, type RtpPacketizationOptions, type RtspCreateOptions, type RtspProxyServerOptions, type RtspStreamProfile, type RunAllDiagnosticsConsecutivelyParams, type RunAllDiagnosticsConsecutivelyResult, type RunMultifocalDiagnosticsConsecutivelyParams, type RunMultifocalDiagnosticsConsecutivelyResult, type SirenState, type SirenStatusConfig, type SleepInferenceDecision, type SleepInferenceInput, type SleepInferencePending, type SleepState, type SleepStatus, type StreamMetadata, type StreamProfile, type StreamSamplingOptions, type StreamSamplingSelection, type SupportConfig, type SupportInfo, type SupportItem, type SystemGeneralConfig, type TalkAbility$1 as TalkAbility, type TalkAudioConfig, type TalkConfig, type TalkSession$1 as TalkSession, type TalkSessionInfo, type TimelapseCfgConfig, type TwoWayAudioConfig, type UnknownChunkListener, type VideoCodec, type VideoInputConfig, type VideoParamSets, type VideoStreamOptions, type VideoStreamOptionsCacheEntry, type VideoType, type VideoclipClientInfo, type VideoclipModeDecision, type VideoclipThumbnailResult, type VideoclipTranscodeMode, type VodFile, type VodSearchResponse, type VodSearchResult, type VodSearchStatus, type WakeUpOptions, type WebRTCAnswer, type WebRTCIceCandidate, type WebRTCOffer, type WebRTCSessionInfo, type WhiteLedConfig, type WhiteLedState, type WirelessChimeSilentState, type ZoomFocusStatus, type ZoomFocusTriplet, abilitiesHasAny, aesDecrypt, aesEncrypt, applyStreamPatch, applyXmlTagPatch, asLogger, autoDetectDeviceType, bcDecrypt, bcEncrypt, bcHeaderHasPayloadOffset, buildAacAudioSpecificConfigHex, buildAbilityInfoExtensionXml, buildBinaryExtensionXml, buildChannelExtensionXml, buildFloodlightManualXml, buildHlsRedirectUrl, buildLoginXml, buildLogoutXml, buildPreviewStopXml, buildPreviewStopXmlV11, buildPreviewXml, buildPreviewXmlV11, buildPtzControlXml, buildPtzPresetXml, buildPtzPresetXmlV2, buildRfc4571Sdp, buildRtspPath, buildRtspUrl, buildSirenManualXml, buildSirenTimesXml, buildStartZoomFocusXml, buildWhiteLedStateXml, captureModelFixtures, collectCgiDiagnostics, collectMultifocalDiagnostics, collectNativeDiagnostics, collectNvrDiagnostics, computeDeviceCapabilities, computeExpectedStreamCompatibility, convertToAnnexB as convertH265ToAnnexB, convertToAnnexB$1 as convertToAnnexB, convertToLengthPrefixed, createBaichuanEndpointsServer, createDebugGateLogger, createDiagnosticsBundle, createLogger, createMjpegBoundary, createNativeStream, createNullLogger, createReplayHttpServer, createRfc4571TcpServer, createRfc4571TcpServerForReplay, createRtspProxyServer, createTaggedLogger, decideSleepInferenceTransition, decideVideoclipTranscodeMode, decodeHeader, decodeMotionScopeBitmap, deriveAesKey, detectIosClient, detectVideoCodecFromNal, discoverReolinkDevices, discoverViaArpTable, discoverViaDhcpListener, discoverViaHttpScan, discoverViaOnvif, discoverViaTcpPortScan, discoverViaUdpBroadcast, discoverViaUdpDirect, encodeHeader, encodeMotionScopeBitmap, ensureXmlHeader, extractH264ParamSetsFromAccessUnit, extractH265ParamSetsFromAccessUnit, extractPpsFromAnnexB, extractSpsFromAnnexB, extractVpsFromAnnexB, flattenAbilitiesForChannel, formatMjpegFrame, fullCoverageScope, getConstructedVideoStreamOptions, getGlobalLogger, getH265NalType, getMjpegContentType, getSupportItemForChannel, getVideoStream, getVideoclipClientInfo, getXmlText, hasStartCodes as hasH265StartCodes, hasStartCodes$1 as hasStartCodes, isDualLenseModel, isH264KeyframeAnnexB, isH265Irap, isH265KeyframeAnnexB, isNvrHubModel, isTcpFailureThatShouldFallbackToUdp, isValidH264AnnexBAccessUnit, isValidH265AnnexBAccessUnit, maskUid, md5HexUpper, md5StrModern, normalizeDayNightMode, normalizeOpenClose, normalizeUid, packetizeAacAdtsFrame, packetizeAacRawFrame, packetizeH264, packetizeH265, parseAdtsHeader, parseBcMedia, parseRecordingFileName, parseSupportXml, patchNestedTag, printNvrDiagnostics, runAllDiagnosticsConsecutively, runMultifocalDiagnosticsConsecutively, sampleStreams, sanitizeFixtureData, setGlobalLogger, splitAnnexBToNalPayloads$1 as splitAnnexBToNalPayloads, splitAnnexBToNals, splitAnnexBToNalPayloads as splitH265AnnexBToNalPayloads, testChannelStreams, upsertXmlTag, xmlEscape, xmlIndicatesFloodlight, zipDirectory };