Skip to content

feat(hikvision): on-demand HCNetSDK pull, WebRTC play, DataChannel PTZ#4688

Open
magicbear wants to merge 5 commits into
ossrs:developfrom
magicbear:feature/hikvision-sdk
Open

feat(hikvision): on-demand HCNetSDK pull, WebRTC play, DataChannel PTZ#4688
magicbear wants to merge 5 commits into
ossrs:developfrom
magicbear:feature/hikvision-sdk

Conversation

@magicbear

Copy link
Copy Markdown

Summary

Experimental Hikvision integration for SRS:

  • On-demand HCNetSDK pull: stream URL shape SerialNO_CHANNEL_SUBCHANNEL; frames injected into LiveSource (no RTMP self-publish loopback) to avoid concurrent StreamBusy races.
  • Playback: HTTP-FLV / WebRTC via existing live pipeline; WebRTC uses rtmp_to_rtc + SrsRtmpBridge from Hikvision ensure_publish().
  • PTZ / control: HTTP API POST /api/v1/hikvision/control, plus experimental WebRTC DataChannel (usrsctp over DTLS) for in-session PTZ.
  • Demo page: trunk/research/players/hikvision.html.
  • Build: ./configure --hikvision=on --sctp=on.
  • Deps: HCNetSDK shared libs under trunk/libs/; usrsctp via git submodule (sctplab/usrsctp).

Commits

  • feat(hikvision): on-demand HCNetSDK pull with LiveSource inject and PTZ API
  • feat(rtc): experimental WebRTC DataChannel via usrsctp for Hikvision PTZ
  • fix(hikvision): bridge LiveSource to WebRTC and add PTZ demo page
  • chore(hikvision): vendor HCNetSDK shared libraries under trunk/libs
  • chore: use sctplab/usrsctp as git submodule

Notes / caveats

  • HCNetSDK is proprietary; binary .so files are vendored for Linux amd64 only.
  • SCTP/DataChannel path is experimental and gated by --sctp=on / SRS_SCTP.
  • After clone: git submodule update --init trunk/3rdparty/usrsctp.
  • Example conf needs RTC candidate / rtmp_to_rtc on for browser play.

Test plan

  • git submodule update --init trunk/3rdparty/usrsctp
  • ./configure --hikvision=on --sctp=on && make
  • Configure Hikvision device + RTC candidate; start SRS
  • HTTP-FLV play of Hikvision stream is smooth (no DTS jump)
  • WebRTC play via /rtc/v1/play/ + demo page shows video
  • PTZ via HTTP control API works
  • (Optional) DataChannel PTZ from demo page when negotiated

MagicBear added 5 commits July 12, 2026 14:16
…TZ API

Integrate Hikvision devices as on-demand publishers for stream names
SerialNO_CHANNEL_SUBCHANNEL, with config, ES preferred demux, direct
SrsLiveSource inject (no RTMP loopback) to avoid StreamBusy races, timestamp
normalization for stable HTTP-FLV/VLC play, and HTTP PTZ control API.
Add optional --sctp=on build with usrsctp, SrsSctp over DTLS application
data, DCEP open/ack, play SDP m=application answer, and route string
messages to Hikvision handle_control_json for camera PTZ control.
Enable rtmp_to_rtc when Hikvision publishes so RTC play receives RTP,
allow m=application in play SDP checks, return JSON on play API errors,
and add research/players/hikvision.html for WebRTC + DataChannel PTZ.
Track amd64/aarch64 libhcnetsdk and HCNetSDKCom dependencies so builds
with --hikvision=on work without manually copying proprietary SDKs.
Remove vendored usrsctp tree from the main repo and track
trunk/3rdparty/usrsctp via submodule (https://github.com/sctplab/usrsctp.git).

Clone with: git submodule update --init trunk/3rdparty/usrsctp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant