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.

Related projects

Contributing

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

Legal disclaimer

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hikcloudstream-0.1.4.tar.gz (88.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hikcloudstream-0.1.4-py3-none-any.whl (43.7 kB view details)

Uploaded Python 3

File details

Details for the file hikcloudstream-0.1.4.tar.gz.

File metadata

  • Download URL: hikcloudstream-0.1.4.tar.gz
  • Upload date:
  • Size: 88.2 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for hikcloudstream-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9859c08690bb3e59e19ba2d093bcde8c86e7ee53523785213f9f2538e2dc1760
MD5 0a33443786b326d48b1c465f1735d09f
BLAKE2b-256 641698b15977a6920fa2561a0643f7d1511a091398e31949f1575c533164b3ed

See more details on using hashes here.

File details

Details for the file hikcloudstream-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: hikcloudstream-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 43.7 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for hikcloudstream-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6810647a83f144b7e2952be380b0a9a6017c2f22d2302f6c804b6b785e5f8106
MD5 a4f3e77682bab65e7779f97aac280af5
BLAKE2b-256 228c0deb442f8b5b81c6288e9199a9487a4c72caee84c0eca6e47650f2c2ae7e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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