Skip to main content

Unofficial Python SDK for Hik-Connect cloud cameras: list devices, snapshots, and live VTM streaming

Project description

hikcloudstream

CI 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, 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

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 or uv sync
cli Command-line tools + Pillow uv sync --extra cli
viewer MJPEG HTTP viewer (PyAV) uv sync --extra viewer
dev Tests, ruff, mypy uv sync --extra dev

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

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" 1 -o frame.jpg --duration 6s

Open http://127.0.0.1:8558/ in a browser when using --proxy.

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.

Project details


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.0.tar.gz (100.7 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.0-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hikcloudstream-0.1.0.tar.gz
  • Upload date:
  • Size: 100.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hikcloudstream-0.1.0.tar.gz
Algorithm Hash digest
SHA256 45356e3167ae6a04f7b2099dedc873631aa2fb7bc706fbd8f7328fdff45e2885
MD5 f251415f4fb36e147620254d6bd95c38
BLAKE2b-256 c547f262f7448dcc91b36a443f40ee4a696b0fc3426d965abe43a3239481e682

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hikcloudstream-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hikcloudstream-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22df18006429a7a8426c50913782472e2a8b7fe100654d4e58bc98a4adde3bed
MD5 bce9a39e6fcb773138d73121bc25d585
BLAKE2b-256 55b69bba74852c0468a98a8787ed04a200de4d4e2d7db5af2837a2a74fc22ddf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page