Skip to main content

hikcloudstream

CI PyPI Python License

Unofficial Python SDK for Hik-Connect cloud cameras — list devices, cloud snapshots, and live streaming over the VTM relay.

If you have Hik-Connect cameras in the cloud (condo, shared NVR, no RTSP URL) and found almost nothing on GitHub — that's why this exists. This is a community library, not an official Hikvision or EZVIZ product. APIs can change without notice.

What it does

  • Log in with your Hik-Connect account (same credentials as the mobile app)
  • List cameras and channels on the account
  • Cloud snapshot (~352×288 thumbnail via API)
  • Live stream via cloud VTM relay (H.264 → Annex B, MPEG-TS, HLS fMP4, MJPEG viewer)
  • Auto-select substream vs main stream per camera

What it does not do

  • LAN RTSP / ONVIF / ISAPI (use FFmpeg, go2rtc, or HCNetSDK for local NVR access)
  • P2P hole-punching (the app uses P2P at home; remote cloud preview uses VTM relay — same path as this library)
  • Official support or guaranteed API stability

Quick start

pip install "hikcloudstream[viewer]"
# or from source:
git clone https://github.com/cristianojmiranda/hikcloudstream.git
cd hikcloudstream && uv sync --extra viewer
from hikcloudstream import Credentials, HikConnectClient

with HikConnectClient() as client:
    client.login(Credentials("user@example.com", "your_password"))
    for cam in client.list_cameras():
        print(cam.index, cam.name, cam.device_serial, cam.channel_no)

Install

Extra Purpose Command
core API + streaming protocol pip install hikcloudstream
cli Command-line tools + Pillow pip install "hikcloudstream[cli]"
viewer MJPEG HTTP viewer (PyAV) pip install "hikcloudstream[viewer]"
dev Tests, ruff, mypy uv sync --extra dev

System dependency: FFmpeg (ffmpeg on PATH) for recording, HD frame capture, MPEG-TS remux, and HLS fMP4 segment generation.

CLI

export HIK_CONNECT_USER="user@example.com"
export HIK_CONNECT_PASSWORD="your_password"

uv run hikcloudstream-snapshot "$HIK_CONNECT_USER" "$HIK_CONNECT_PASSWORD" --list
uv run hikcloudstream-snapshot "$HIK_CONNECT_USER" "$HIK_CONNECT_PASSWORD" 1 -o thumb.jpg
uv run hikcloudstream-stream "$HIK_CONNECT_USER" "$HIK_CONNECT_PASSWORD" 1 --proxy
uv run hikcloudstream-stream "$HIK_CONNECT_USER" "$HIK_CONNECT_PASSWORD" 17 --proxy --player hls
uv run hikcloudstream-stream "$HIK_CONNECT_USER" "$HIK_CONNECT_PASSWORD" 1 -o frame.jpg --duration 6s

Open http://127.0.0.1:8558/ when using --proxy (default HLS player; use --player mjpeg for legacy MJPEG).

Browser proxy options

Flag Default Description
--player hls yes H.264 passthrough via hls.js (sharper)
--player mjpeg PyAV MJPEG <img> viewer
--main-stream Force stream=1; falls back to substream only when substream exists
--preview-fps 8 MJPEG frame rate
--jpeg-quality 75 MJPEG JPEG quality
--max-width auto MJPEG max width (0=native substream)

Stream types

stream= Typical use
2 (substream) Lower bandwidth, standard H.264 — works on most DVR channels
1 (main) Higher resolution; some cameras only expose this stream
auto (default) Probes substream for 5s, falls back to main

Force main stream in Python: StreamType.MAIN. In CLI: --main-stream.

Examples

See examples/ — each script documents required extras and env vars.

Documentation

Origin

Live streaming was reverse-engineered from the Hik-Connect for End User mobile app and aligned with pyezvizapi. The implementation uses the cloud VTM relay protocol.

Contributing

See CONTRIBUTING.md. AI agents: read AGENT.md first.

This is an unofficial community project. It is not affiliated with, endorsed by, or supported by Hangzhou Hikvision Digital Technology Co., Ltd. or EZVIZ. Use at your own risk. You are responsible for complying with Hik-Connect / EZVIZ Terms of Service and applicable law. Trademarks belong to their respective owners.

License

Apache-2.0 — see LICENSE and NOTICE.

Metadata

Release files for hikcloudstream 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hikcloudstream 0.1.4
File Size Uploaded
hikcloudstream-0.1.4.tar.gz 88.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hikcloudstream 0.1.4
File Interpreter ABI Platform
hikcloudstream-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 131.9 kB

Release files / hikcloudstream-0.1.4.tar.gz

Download URL hikcloudstream-0.1.4.tar.gz
Size 88.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9859c08690bb3e59e19ba2d093bcde8c86e7ee53523785213f9f2538e2dc1760
BLAKE2b-256 checksum
How to use checksums
641698b15977a6920fa2561a0643f7d1511a091398e31949f1575c533164b3ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / hikcloudstream-0.1.4-py3-none-any.whl

Download URL hikcloudstream-0.1.4-py3-none-any.whl
Size 43.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6810647a83f144b7e2952be380b0a9a6017c2f22d2302f6c804b6b785e5f8106
BLAKE2b-256 checksum
How to use checksums
228c0deb442f8b5b81c6288e9199a9487a4c72caee84c0eca6e47650f2c2ae7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page