@camstack/addon-provider-hikvision

中文文档
1.2.186发布于 2026/11/08MITESM + CJS近 30 天下载 6455

Hikvision camera device provider addon for CamStack — ISAPI over HTTP(S) with digest auth (snapshot, alarm stream, RTSP discovery)

原始使用文档
文档目录9 节
  1. v0.1 surface
  2. v0.2 surface (added)
  3. Deferred to v0.3+
  4. Notes
  5. References
  6. What it provides
  7. Configuration
  8. Requirements
  9. Documentation

@camstack/addon-provider-hikvision

Hikvision ISAPI camera/NVR provider for CamStack. Speaks HTTP(S) ISAPI with HTTP Digest auth and hands RTSP URLs to the camstack stream-broker for video pull (no in-process video work).

v0.1 surface

  • Connection: ISAPI over HTTP or HTTPS, digest auth (RFC 7616, MD5+qop=auth). HTTPS uses rejectUnauthorized: false because Hikvision ships self-signed certs by default.
  • Probe: /ISAPI/System/deviceInfo — used by the Add-Device modal's Test button + by onCreateDevice to confirm the camera responds and persist the model/serial cache.
  • Snapshot: /ISAPI/Streaming/channels/{id}/picture?snapShotImageType=JPEG (registered as the snapshot native cap; the system snapshot wrapper handles caching + sleep gating on top).
  • Reboot: /ISAPI/System/reboot (registered as the reboot native cap).
  • Stream discovery: /ISAPI/Streaming/channels enumerates every (camera, slot) pair on single-camera devices and NVRs. Each enabled entry is published to the stream-broker as a pull-rtsp source (rtsp://user:pass@host:554/Streaming/Channels/{id}?transportmode=unicast).
  • Alarm stream: subscribes to /ISAPI/Event/notification/alertStream; the multipart parser emits EventCategory.Motion (with hysteresis: motion → inactive after 3s of silence) and EventCategory.NativeDetection (smart events: line-cross, region-entrance/exit, field-detection — class names normalised via HIKVISION_AI_CLASS_MAP).

v0.2 surface (added)

  • PTZ — ptz cap registered when /PTZCtrl/channels/{id}/capabilities reports any of pan / tilt / zoom. Methods: move (one-shot 500ms burst then auto-stop), continuousMove, stop, getPresets (/presets), goToPreset (/presets/{id}/goto), goHome (alias for preset id 1). Speed range -100..+100 per axis as Hikvision documents; clamped on send.
  • Supplemental light — switch + brightness caps registered when /Image/channels/{id}/supplementLight/capabilities advertises any non-close mode. The "on" mode is picked deterministically: colorVuWhiteLight when present (newer ColorVu firmwares), else the first non-close mode. Brightness 0..100 — when the light is off, brightness writes are stashed and applied on the next setState({on:true}).
  • Siren / alarm output — switch cap registered when /System/IO/inputs lists at least one alarm input port. Defaults to port 1 (the typical built-in-siren GPIO). Note: the camera-side Linkage Method (Configuration → Event → Linkage Method) must be configured to fire the siren tone / strobe when the input flips — the API only toggles the input state. v0.2 limitation: when both supplemental light and siren are present, the supplemental light owns the switch cap; the siren registration logs and skips. Child accessory devices (one per cap) land in v0.3 to fix the collision.

The probe runs once per camera lifetime (after the first successful publishToBroker); results are cached into deviceCache.{hasPtz,hasSupplementalLight,hasAlarmIo} so the next boot can short-circuit without re-probing. Cap registration itself is always re-done at runtime.

Deferred to v0.3+

  • Child accessory devices — model siren / supplemental light as separate child IDevice rows (parentDeviceId = camera) so the two switches don't have to share the parent's switch cap. Mirrors Reolink's ReolinkAccessory pattern.
  • Two-way audio (intercom) — /ISAPI/System/TwoWayAudio/... plus RTP relay; out of scope until camstack adds an intercom cap that other providers can also implement.
  • AI thumbnail forwarding — the alarm-stream parser sees image/jpeg parts that follow smart-detection events but discards them. Hook lands cleanly in pumpAlarmStream when consumers ask for it.
  • PTZ position read-back — /PTZCtrl/channels/{id}/status is firmware-dependent; today we return a stub {0,0,0} for getPosition.

Notes

  • Channel id encoding: Hikvision uses {cameraNumber}{streamSlot} — 101 = camera 1 / main, 102 = camera 1 / sub, 201 = camera 2 / main. Single-camera devices yield native:main / native:sub cam-stream ids; multi-channel NVRs yield ch{N}-main / ch{N}-sub.
  • Old NVR fallback: pre-2018 NVRs (DS-7600 series and similar) lack /ISAPI/Streaming/channels. The provider falls back to a synthetic [101, 102] channel set so video still publishes.
  • Motion debounce: Hikvision fires VMD events every ~1s while motion is active. The driver flips the motion cap to detected: true on the first event of a burst and waits 3s of silence before flipping back to detected: false — emitting both the activated and deactivated transitions on the event bus.

References

  • ISAPI Service v2 & v3 specs (Hikvision ISAPI doc package — vendor download).

Package @camstack/addon-provider-hikvision on npm.

What it provides

  • Hikvision (provider-hikvision): Hikvision ISAPI camera/NVR provider — discovers RTSP streams, captures snapshots, parses the alarm event stream. Category: providers.
    • Capabilities: device-provider, stream-params, recording-onboard, motion-zones, privacy-mask, day-night, image-settings, failure-contribution, videoclips.

Configuration

Edit these from System, Addons, this addon, Settings (a device's own settings are on its device page). A password field is stored in the keychain.

Adding a device

  • Camera: Name
  • Credentials: Username, Password
  • Connection: Camera IP, Port, Use HTTPS

Per-device settings

  • Supplemental Light: Mode (on), Default brightness, Mode, Brightness regulator, IR brightness, White-light brightness
  • Siren / Alarm Output: Alarm input port, Auto-release after (ms)
  • Connection: Camera IP, Port, Use HTTPS, RTSP transport, Username, Password
  • On-camera motion (VMD): Motion detection, Sensitivity
  • Image: Brightness, Contrast, Saturation, Sharpness, WDR, WDR level, Day/Night
  • Time / NTP: Timezone, Time sync, NTP server, NTP port, Sync interval (min), Manual date & time, Sync time
  • Two-way audio: Mode
  • Two-way audio channel: Audio codec, Input source, Speaker volume, Noise reduction
  • and 4 more sections

Requirements

  • Placement: hub-only.
  • Runtime dependencies installed with the addon: onvif, werift.
  • A CamStack hub. An agent is used only where the placement above allows it.

Documentation

See CHANGELOG.md for what changed in each version.

版本与发布记录

@camstack/addon-provider-hikvision 共发布 238 个版本,首次发布于 2026/05/08;过去 12 个月发布了 238 个版本。

版本发布日期距今
1.2.186latest2026/11/08今天
1.2.1852026/11/072 天前
1.2.1842026/11/072 天前
1.2.1832026/11/063 天前
1.2.1822026/11/054 天前
1.2.1812026/11/054 天前

关于 @camstack/addon-provider-hikvision 的常见问题

@camstack/addon-provider-hikvision 是什么?

Hikvision camera device provider addon for CamStack — ISAPI over HTTP(S) with digest auth (snapshot, alarm stream, RTSP discovery)

如何安装 @camstack/addon-provider-hikvision?

在项目目录运行 npm install @camstack/addon-provider-hikvision,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:zod(^4.3.6)、@camstack/types(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@camstack/addon-provider-hikvision 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/camstack__addon-provider-hikvision 是否存在。

@camstack/addon-provider-hikvision 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@camstack/addon-provider-hikvision 可以商用吗?

@camstack/addon-provider-hikvision 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@camstack/addon-provider-hikvision 的下载量有多少?

根据 npm 官方下载统计,@camstack/addon-provider-hikvision 在 2026/10/09 – 2026/11/07 这 30 天内被下载 6,455 次,日均约 215 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@camstack/addon-provider-hikvision 还在维护吗?

最新版本 1.2.186 发布于 2026/11/08(今天);至今共发布 238 个版本,其中过去 12 个月发布了 238 个;首次发布于 2026/05/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。