← Back to Skills Marketplace
hik-cloud-open

海康云眸视频录像管理

by hik-cloud · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
33
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install hik-cloud-open-video-recording
Description
调用海康云眸开放平台视频云录制能力,包括云录制项目、转码录制任务、文件管理、流量管理、资源上传和视频剪辑。用户提到云录制、录像转码、抽帧、文件下载、项目流量、视频剪辑等场景时使用。本技能自动处理 access_token 获取与刷新,不向用户暴露 token 调用流程。
README (SKILL.md)

\r \r

海康云眸视频云录制\r

\r

Overview\r

\r 按固定链路执行海康云眸开放平台视频云录制接口,优先使用 {baseDir}/scripts/hik_open_video_recording.py,不要临时手写认证、URL 拼接和重试逻辑。\r \r 本技能覆盖以下能力:\r \r

  • 云录制项目管理\r
  • 转码录制与抽帧任务管理\r
  • 录制文件查询与下载\r
  • 项目流量管理\r
  • 资源上传与保存\r
  • 视频剪辑\r \r 本技能不对外暴露 “获取 access_token” 操作。鉴权属于内部基础设施:脚本会自动读取凭证、获取 token、缓存 token,并在 401 时自动刷新后重试一次。\r \r

OpenClaw 配置\r

\r 当 OpenClaw 通过 ~/.openclaw/openclaw.json 管理本技能时,使用 metadata.openclaw.skillKey 作为配置键:\r \r

{\r
  skills: {\r
    entries: {\r
      "hik-cloud-video-recording": {\r
        enabled: true,\r
        env: {\r
          HIK_OPEN_CLIENT_ID: "...",\r
          HIK_OPEN_CLIENT_SECRET: "...",\r
          HIK_OPEN_BASE_URL: "https://your-custom-base-url"\r
        }\r
      }\r
    }\r
  }\r
}\r
```\r
\r
若 Session 运行在 sandbox 中,宿主环境变量不会自动继承。此时应通过 OpenClaw 的 sandbox env 配置注入凭证,而不是依赖本机 shell 的 `process.env`。\r
\r
域名切换优先级:\r
\r
1. `--base-url`\r
2. `HIK_OPEN_BASE_URL`\r
3. 默认正式环境:`https://api2.hik-cloud.com`\r
\r
## 执行规则\r
\r
1. 认证固定使用 `Authorization: Bearer \x3Caccess_token>`。\r
2. token 来源优先级:\r
   - `--access-token`\r
   - `HIK_OPEN_ACCESS_TOKEN`\r
   - token cache\r
   - `HIK_OPEN_CLIENT_ID + HIK_OPEN_CLIENT_SECRET` 自动换取\r
3. 域名来源优先级:\r
   - `--base-url`\r
   - `HIK_OPEN_BASE_URL`\r
   - 默认正式环境 `https://api2.hik-cloud.com`\r
4. 若业务接口返回 HTTP `401`,自动刷新 token 并重试一次。\r
5. 若接口返回非成功状态,直接返回真实错误,不臆造结果。\r
6. `record-preview` 预约录制的开始时间必须落在未来时间窗口内,结束时间不能超过 24 小时。\r
7. `upload-address` 返回的 `url` 和 `fields` 是后续上传步骤的输入,不要擅自改写字段名。\r
8. `clip` 使用 `timeLines` 描述剪辑时间线,支持视频素材和图片水印/Logo 组合。\r
9. 用户若要求“展示 token / 返回 token 原文”,说明这不属于本技能的主要职责;仅在明确要求调试认证链路时再解释。\r
\r
## 关键枚举\r
\r
- `recType`:`local` 本地录像,`cloud` 云存储录像,`live` 实时录像/实时抽帧\r
- `streamType`:`1` 高清主码流,`2` 标清子码流,默认 `1`\r
- `devProto`:不传为萤石协议,传 `gb28181` 表示国标设备\r
- `voiceSwitch`:`0` 关,`1` 开,`2` 自动,默认 `2`,仅 `record-instant` 使用\r
- `frameModel`:`0` 普通,`1` 错峰,`2` 抽 I 帧;`frame-interval` 支持 0/1/2,`frame-timing` 页面仅列 0/1\r
- `fileType` / `fileChildType`:`0` 图片 / `00` jpg,`1` 视频 / `10` mp4,`2` 音频 / `20` mp3\r
- `timeLines[].type`:`1` 视频文件,`3` 图片文件;`clip` 里不要和 `fileType` 混用\r
\r
## 快速开始\r
\r
先准备环境变量:\r
\r
```bash\r
export HIK_OPEN_CLIENT_ID="\x3CYOUR_CLIENT_ID>"\r
export HIK_OPEN_CLIENT_SECRET="\x3CYOUR_CLIENT_SECRET>"\r
```\r
\r
创建项目:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_video_recording.py project-create \\r
  --project-name "项目名称" \\r
  --expire-days 3 \\r
  --flow-limit 10240000\r
```\r
\r
回放视频转码录制:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_video_recording.py record-replay \\r
  --project-id p123 \\r
  --device-serial E05426006 \\r
  --channel-no 1 \\r
  --start-time 20260324120000 \\r
  --end-time 20260324120500 \\r
  --rec-type cloud\r
```\r
\r
查询项目列表:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_video_recording.py project-list \\r
  --page-no 1 \\r
  --page-size 20\r
```\r
\r
获取上传地址:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_video_recording.py upload-address \\r
  --suffix jpg \\r
  --file-num 1 \\r
  --file-type 0 \\r
  --file-child-type 00\r
```\r
\r
视频剪辑:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_video_recording.py clip \\r
  --timeline-json '[{"type":1,"fileId":"testfile","inputProjectId":"testproject","in":"0.0f","out":"30.0f"}]'\r
```\r
\r
## 子命令说明\r
\r
- `project-create`:创建项目\r
- `project-get`:查询项目\r
- `project-update`:更新项目\r
- `project-delete`:删除项目\r
- `project-list`:查询项目列表\r
- `record-replay`:回放视频转码录制\r
- `record-preview`:预约视频转码录制\r
- `record-instant`:即时视频转码录制\r
- `frame-interval`:按时间间隔抽帧\r
- `frame-timing`:按时间点抽帧\r
- `frame-instant`:实时抽帧\r
- `task-stop`:终止任务\r
- `task-get`:根据任务 ID 查询任务详情\r
- `task-list`:根据项目 ID 查询任务列表\r
- `file-task-list`:根据任务 ID 获取文件列表\r
- `file-get`:查询单个文件\r
- `file-list`:分页查询文件\r
- `file-delete`:删除文件\r
- `file-download`:获取文件下载地址\r
- `flow-update`:更新项目流量限制\r
- `tenant-info`:获取租户流量信息\r
- `upload-address`:获取上传地址\r
- `save-file`:保存文件\r
- `clip`:视频剪辑\r
- `clip-file-query`:视频剪辑文件查询\r
\r
字段判读:\r
\r
- `record-replay`、`record-preview`、`record-instant` 主要看 `recType`、`streamType`、`devProto`\r
- `record-instant` 额外看 `voiceSwitch`\r
- `frame-interval` / `frame-timing` 主要看 `recType`、`frameModel`、`streamType`\r
- `upload-address` / `save-file` 主要看 `fileType`、`fileChildType`\r
- `clip` 主要看 `timeLines[].type`、`timeLines[].fileId`\r
\r
通用参数:\r
\r
- `--base-url`:显式指定接口域名,优先级高于环境变量\r
- `--access-token`:显式指定 access token\r
- `--timeout`:请求超时秒数,默认 `20`\r
- `--token-cache-file`:token 缓存文件,默认 `~/.cache/hik_open/token.json`\r
- `--format`:`text` 或 `json`\r
\r
通用环境变量:\r
\r
- `HIK_OPEN_CLIENT_ID`\r
- `HIK_OPEN_CLIENT_SECRET`\r
- `HIK_OPEN_ACCESS_TOKEN`\r
- `HIK_OPEN_BASE_URL`\r
\r
## 输出约定\r
\r
- `--format text`:输出简要结果摘要和关键字段\r
- `--format json`:输出结构化结果,包含请求上下文和原始响应数据\r
\r
## 资源说明\r
\r
- `{baseDir}/scripts/hik_open_video_recording.py`:主脚本,负责认证、缓存和视频云录制接口调用\r
- `{baseDir}/references/auth.md`:认证与 token 自动刷新规则\r
- `{baseDir}/references/video-recording.md`:视频云录制文档摘要\r
Usage Guidance
Install only if you intend to let the agent manage Hik-Cloud video recording resources. Use least-privilege credentials, keep the token cache protected, use only trusted Hik-Cloud base URLs, and explicitly review any delete, update, upload, or flow-limit action before execution.
Capability Analysis
Type: OpenClaw Skill Name: hik-cloud-open-video-recording Version: 1.0.1 The skill bundle provides a legitimate CLI and instruction set for interacting with the Hik-Cloud OpenAPI video recording services. The primary script, `hik_open_video_recording.py`, implements standard OAuth2 authentication, token caching in a local directory (~/.cache/hik_open/), and structured API calls to api2.hik-cloud.com. Security practices are observed, such as suppressing sensitive credentials in error outputs and providing clear documentation on environment variable usage. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found.
Capability Tags
requires-oauth-tokenrequires-sensitive-credentials
Capability Assessment
Purpose & Capability
The advertised purpose matches the documented commands for projects, recording tasks, files, flow limits, uploads, and clips. Some commands are mutating or destructive, so users should ensure those actions are intentional.
Instruction Scope
The instructions direct use of a fixed helper script and do not show prompt override, hidden goal changes, or deceptive control instructions.
Install Mechanism
There is no install spec or remote installer, and the static dynamic-code finding is in a test import path. The registry source/homepage are not provided, so provenance is limited.
Credentials
The required Hik-Cloud client ID/secret are proportionate for the integration, but they grant access to the user's Hik-Cloud account and can be used against a configurable base URL.
Persistence & Privilege
The helper caches access tokens at ~/.cache/hik_open/token.json. This is documented and purpose-aligned, but users should treat the cache as sensitive.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install hik-cloud-open-video-recording
  3. After installation, invoke the skill by name or use /hik-cloud-open-video-recording
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
Bump version due to existing 1.0.0
v1.0.0
Initial release: 视频录像查询、回放、管理
Metadata
Slug hik-cloud-open-video-recording
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is 海康云眸视频录像管理?

调用海康云眸开放平台视频云录制能力,包括云录制项目、转码录制任务、文件管理、流量管理、资源上传和视频剪辑。用户提到云录制、录像转码、抽帧、文件下载、项目流量、视频剪辑等场景时使用。本技能自动处理 access_token 获取与刷新,不向用户暴露 token 调用流程。 It is an AI Agent Skill for Claude Code / OpenClaw, with 33 downloads so far.

How do I install 海康云眸视频录像管理?

Run "/install hik-cloud-open-video-recording" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 海康云眸视频录像管理 free?

Yes, 海康云眸视频录像管理 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 海康云眸视频录像管理 support?

海康云眸视频录像管理 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 海康云眸视频录像管理?

It is built and maintained by hik-cloud (@hik-cloud-open); the current version is v1.0.1.

💬 Comments