Skip to main content

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

Project description

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, 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, 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.1.tar.gz (101.4 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.1-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hikcloudstream-0.1.1.tar.gz
  • Upload date:
  • Size: 101.4 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.1.tar.gz
Algorithm Hash digest
SHA256 b089ad5c119e2dced1f365d5e93a1a9096a6bebcae5e4172df4fe594368627eb
MD5 6f3a46abd48e20212292f9fd7cfbe7eb
BLAKE2b-256 b3b6895bf49c2c4f9baf79ee9b4ae7597d32da184077e6e50c5ed16c48e2055d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hikcloudstream-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 33.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b98c4f5df3b5992183034fd52c5786f5a577e0d1205d7c60b1d5bf5af566490
MD5 c29873f1917625b257c95b3baf3ecada
BLAKE2b-256 44bc1c6d4dda0f546a091edb38b2de2981891819e3031f1a3bb0b20aa9d9900a

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