You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

4.7 KiB

Hikvision NVR RTSP Playback Compatibility Fix Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Make the playback-search endpoint return an RTSP URL that the target Hikvision NVR can actually play while retaining SDK channel 33 for recording lookup.

Architecture: Extend the existing Hikvision login cache value with immutable device channel metadata read from NET_DVR_DEVICEINFO_V40. The playback service uses that metadata to map SDK channel numbers to RTSP display-channel numbers, then passes the resolved RTSP channel to a pure URL builder. RTSP query timestamps keep Beijing clock digits because the target firmware was verified to interpret them as device-local time.

Tech Stack: Java 8, Spring Boot 2.3.4, HCNetSDK/JNA, Caffeine, JUnit 4, Mockito, Maven.

Execution constraint: Modify the local master worktree only. Do not stage or commit any file.


File map

  • Create src/main/java/com/inspect/nvr/service/HikLoginSession.java — immutable login handle and channel-layout mapping.
  • Modify src/main/java/com/inspect/nvr/service/HikLoginService.java — cache HikLoginSession and capture login device metadata while preserving existing login(NvrInfo) callers.
  • Modify src/main/java/com/inspect/nvr/hik/service/HikNvrPlaybackService.java — use the login session for the SDK handle and resolved RTSP channel.
  • Modify src/main/java/com/inspect/nvr/hik/service/HikPlaybackUrlBuilder.java — accept an RTSP channel explicitly and retain Beijing clock digits.
  • Create src/test/java/com/inspect/nvr/service/HikLoginSessionTest.java — pure channel mapping coverage.
  • Create src/test/java/com/inspect/nvr/service/HikLoginServiceTest.java — verify SDK device metadata is captured into the cached session.
  • Modify src/test/java/com/inspect/nvr/hik/service/HikPlaybackUrlBuilderTest.java — reproduce 3301 and UTC-conversion regressions.
  • Modify src/test/java/com/inspect/nvr/hik/service/HikNvrPlaybackServiceTest.java — prove SDK search still uses 33 while the URL uses 101.

Task 1: Lock down corrected RTSP behavior

Task 2: Implement the minimal production fix

Task 3: Verify regression safety and the real device