alee-ibrahim

Dahua Nvr Kit — Development skill for Claude Code

Development community

Toolkit + Claude Code skill for administering Dahua NVR fleets over RPC2: channel rearrange/resort, recover camera passwords from config backups, encode lag diagnosis + ONVIF/SUNAPI/Dahua fixes, conta.

How to install Dahua Nvr Kit

This entry records only its repository, not the path inside it, so there is no exact command to give. Open alee-ibrahim/dahua-nvr-kit and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Dahua Nvr Kit does

Toolkit + Claude Code skill for administering Dahua NVR fleets over RPC2: channel rearrange/resort, recover camera passwords from config backups, encode lag diagnosis + ONVIF/SUNAPI/Dahua fixes, contact-sheet verification. For devices you own or administer.

Alternatives in Development

  • Memory Gc — Inspect or rotate the autopilot ledger JSONL files (findings.jsonl, negatives.jsonl) 3.8k ★
  • Investigate Performance — Investigate a Nimbalyst performance problem (freeze, lag, idle CPU, slow op, memory growth) with measured evid 1.6k ★
  • Traffic Diagnosis — Traffic Change Diagnosis 242 ★

README

dahua-nvr-kit

Scripts + a Claude Code skill for administering a fleet of **Dahua NVRs** (and their attached ONVIF / Samsung / Hanwha cameras) over the RPC2 API: rearrange and retitle channels, recover lost camera passwords from an encrypted NVR config backup, diagnose live-view lag, and tune camera encode profiles. Built from real field work and generalized -- no site data.

**Use only on NVRs/cameras you own or are authorized to administer.** This kit is for operators maintaining their own CCTV estate. Do not use it against devices you do not control.

Features

  • Read-only survey of every channel across the fleet (bound camera IP, lens index, connection state, title).
  • Config-backup export + decrypt to recover the per-camera credentials the NVR stores -- Dahua MWPZWJGS v1 (base64 + AES-ECB + gzip, via the vendored bashis tool) and a best-effort v2 (AES-OFB) path.
  • Channel rearrange / resort / retitle from a declarative target-map JSON, applied over RPC2 (RemoteDevice / RemoteChannel / ChannelTitle), backup-first.
  • Verification with per-channel snapshots and labelled contact sheets.
  • Encode diagnosis (MJPEG mains, oversized subs, silly main profiles, decode budget) and fixes via ONVIF SetVideoEncoderConfiguration, Samsung/Hanwha SUNAPI, or the Dahua Encode CGI -- backup-first, verify-after, auto-revert on unreachable.
  • Documented known limitation: these NVRs don't expose ONVIF main-stream profile selection via API, so a firmware-locked-MJPEG camera's main must be switched in the NVR web UI (exact click path in docs/METHOD.md).

Why session-cookie auth

The RPC2 client logs in with the two-step MD5 challenge-response and then rides the `DhWebClientSessionID` cookie for all calls (including the CGI snapshot/export endpoints), because HTTP Digest auth fails on several Dahua firmware builds. Login is attempted **once** -- never in a loop -- so you don't lock out the admin account.