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, 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" 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.2.tar.gz (83.1 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.2-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hikcloudstream-0.1.2.tar.gz
  • Upload date:
  • Size: 83.1 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.2.tar.gz
Algorithm Hash digest
SHA256 31934a7a09bb44f444b46f7619d33e2b679da9afc2f07fdc6048b237165ba200
MD5 e316642f0dd8aa3bd404ae0a47cd2d6e
BLAKE2b-256 ea1b35cb61656d5ff74515d30d6d9d6c15b27ce41780d73216e1131f63c19ac5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hikcloudstream-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 39.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 66a888a8bdc109d3203f9f93b778a2f57928d8a0daa008f7a1edf83378ab21e9
MD5 a758f200082560b829602a09ce52104c
BLAKE2b-256 1e07dd1d4b3cbc379233af51610da3857868e42f14054ce66673997f183d12f4

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