YM-MediaToolkit(媒体处理工具集)
自然语言媒体助手 - 视频压缩、MP4/MOV 封面提取、音频转换、字幕识别
Rank
62
Safety
84
Downloads
1.5k
Updated
Oct 10, 2026
Version
4.2.2
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.5K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 10, 2026
- Adoption signal
- 1.5K downloadsadoption · observed Oct 10, 2026
- Latest release
- 4.2.2release · observed Jun 25, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s179wpayjrbp1yrqzswm93bgsx84sbcs:ym-mediatoolkit- Install using `clawhub skill install s179wpayjrbp1yrqzswm93bgsx84sbcs:ym-mediatoolkit` in an isolated environment before connecting it to live workloads.
- No published capability contract is available yet, so validate auth and request/response behavior manually.
- Review the upstream CLAWHUB listing at https://clawhub.ai/370299455cx-web/ym-mediatoolkit before using production credentials.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-370299455cx-web-ym-mediatoolkit/snapshot"
Documentation
CLAWHUB
149,476 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
--- name: ym-mediatoolkit version: 4.3.1 description: 自然语言媒体助手 - 视频压缩、MP4/MOV 封面提取、音频转换、字幕识别 author: your_name tags: - video - compression - thumbnail - audio - streaming - ffmpeg categories: - media - utility clawhub: entrypoint: python run.py runtime: python3 http_port: 8080 --- # YM MediaToolkit 自然语言媒体助手,支持从远程视频 URL、当前工作目录内的本地视频文件、或配置过 `media_roots` 的本地媒体目录直接处理: - 自然语言调用 - 视频压缩 - MP4/MOV 封面提取 - 音频提取与转换:MP3 / WAV / AAC / M4A - OCR / ASR 字幕识别 - emlet 字幕二次分句 - 批量处理 - JSON 驱动媒体流水线 ## 依赖 ```bash pip install -r requirements.txt ``` 系统需要安装: ```bash ffmpeg ffprobe ``` 字幕识别依赖已内置在 `requirements.txt`,包括 `faster-whisper`、`paddlepaddle`、`paddleocr`。 ## 维护 维护、发布、测试和排障流程见 [MAINTENANCE.md](./MAINTENANCE.md)。 ## 命令行 ```bash python run.py -a <action> -i '<json>' ``` 也可以从 JSON 文件读取参数: ```bash python run.py -i params.json ``` ## HTTP 服务 ```bash python run.py --serve ``` 默认监听 `127.0.0.1:8080`。 健康检查: ```http GET /health ``` 异步长任务: ```http POST /skill/jobs GET /skill/jobs/<job_id> GET /skill/jobs ``` ## 功能 输入源字段可使用 `video_url`、`url` 或 `source`,三者等价。远程输入仅支持 `http/https`,本地输入默认限制在当前工作目录内;需要访问绝对路径时,通过请求参数 `media_roots` 或环境变量 `YM_MEDIA_ROOTS` 配置允许的媒体根目录。 ## 返回协议 从 `4.1.0` 开始,所有 action 都会返回稳定协议字段: | 字段 | 说明 | |------|------| | `status` | `success` / `partial` / `skipped` / `error` | | `code` | 稳定机器码,例如 `ok`、`missing_source`、`output_exists`、`parse_failed` | | `reply` | 适合聊天展示的简短中文回复 | | `hint` | 面向调用方或用户的下一步建议 | 原有业务字段会继续保留,例如 `output_path`、`saved_path`、`outputPath`、`manifest_path`、`info`、`captions`、`result`。 默认输出目录: | 类型 | 默认目录 | |------|----------| | 压缩视频 | `output/videos` | | 音频 | `output/audio` | | 封面 | `output/thumbs` | 所有会写文件的接口都支持 `overwrite`,默认 `true`。设置为 `false` 时,如果输出文件已存在会直接返回错误。 ## 3.0.3 更新 - 支持当前工作目录内的本地视频文件输入。 - 统一 `video_url` / `url` / `source` 三种输入字段。 - 增加默认输出目录:`output/videos`、`output/audio`、`output/thumbs`。 - 增加 `overwrite` 覆盖策略,避免误覆盖已有文件。 ## 4.0.0 更新 - 新增自然语言入口 `chat`,适合 Claw 直接转发用户聊天文本。 - 新增 `media_roots` 白名单,支持处理授权目录内的绝对路径文件。 - 自然语言命令支持提取音频、提取封面、压缩、查看信息、JSON 流水线。 - `chat` 返回 `reply` 和结构化 `result`,同时兼顾聊天展示和自动化消费。 ## 4.0.1 更新 - 新增 `subtitle` 推荐入口,支持 `asr` / `ocr` / `fusion` 模式。 - 新增 `asr` 和 `ocr` 单独调试入口。 - 字幕统一输出 SRT-like JSON:`captionTxt`、`startTimeUs`、`endTimeUs`、`source`、`confidence`。 - `chat` 支持“识别字幕 / 提取字幕 / 转字幕 / 生成字幕”等自然语言命令。 ## 4.0.2 更新 - 将 `faster-whisper`、`paddlepaddle`、`paddleocr` 纳入默认 `requirements.txt`。 - 字幕识别从“可选依赖”调整为默认安装能力。 - 运行时仍保留缺依赖 JSON error,方便定位未重新安装依赖的环境。 ## 4.1.0 更新 - 所有 action 统一补齐 `code`、`reply`、`hint`,方便 Claw 和后续渠道适配。 - 增加稳定错误码:`missing_source`、`source_not_allowed`、`output_exists`、`parse_failed`、`missing_steps`、`unsupported_action`、`ffmpeg_failed`、`missing_asr_dependency`、`missing_ocr_dependency`。 - 保持旧字段兼容,不改变现有 action 名称、HTTP endpoint 和底层媒体处理逻辑。 ## 4.1.1 更新 - 新增 `caption_segment`,用于 emlet 字幕二次分句。 - 默认每句最多 `12` 个字符,按强标点、弱标点、连接词和长度切分。 - 新增 `protected_terms` 和 `protected_terms_path`,用于保护品牌词、产品名、人名、术语不被拆开。 - `pipeline` 支持 `subtitle -> caption_segment` 串联;分句步骤未传 `cap
_meta.json
{
"ownerId": "kn787sam7qk7fffsjc875yxp0984rpzh",
"slug": "ym-mediatoolkit",
"version": "4.2.2",
"publishedAt": 1782377864696
}MAINTENANCE.md
# YM MediaToolkit 维护手册
本文档面向后续维护者,记录版本发布、测试验证、配置边界和排障流程。
## 发布流程
1. 同步版本号:
- `SKILL.md` front matter 的 `version`
- `skill.json` 的 `version`
2. 更新用户文档:
- 新增 action 时同步更新 `SKILL.md` 和 `skill.json`
- 新增参数时同步补充默认值、用途和安全限制
- 变更行为时在 `SKILL.md` 的版本更新段落记录
3. 运行验证:
```bash
python3 -B -m py_compile run.py utils.py intent_parser.py audio_extractor.py frame_extractor.py video_compressor.py asr_engine.py ocr_engine.py subtitle_extractor.py caption_segmenter.py job_manager.py tests/test_release_behaviors.py scripts/smoke_test.py
python3 -m json.tool skill.json
python3 -B -m unittest discover -s tests
python3 scripts/smoke_test.py
```
4. 清理产物:
```bash
find . -type d -name __pycache__ -prune -exec rm -r {} +
find . -name .DS_Store -delete
```
## 当前接口分层
- `chat`:Claw 推荐入口,接收自然语言,解析后调用现有 action。
- `pipeline`:确定性 JSON 流水线入口,适合多步骤、可重复的自动化流程。
- `audio` / `thumbnail` / `compress` / `info` / `audio_info`:底层单步能力。
- `subtitle` / `asr` / `ocr`:字幕识别能力,输出 SRT-like captions JSON。
- `caption_segment`:emlet 字幕二次分句器,处理已有 captions,不重新识别媒体。
- `batch` / `audio_batch`:批量处理入口。
- `/skill/jobs`:HTTP 异步长任务入口,适合压缩、字幕识别、pipeline 等耗时 action。
- `/skill/chat` + `async:"auto"`:Claw 推荐长任务入口,先解析自然语言,再自动提交 job。
维护原则:新体验优先接到 `chat` 或 `pipeline`,媒体处理逻辑继续复用底层 action,避免重复实现 ffmpeg 调用。
## Action 返回协议
所有 action 必须返回 JSON 对象,并保留以下协议字段:
- `status`:`success` / `partial` / `skipped` / `error`
- `code`:稳定机器码,成功为 `ok`
- `reply`:适合聊天展示的中文回复
- `hint`:下一步建议或排障提示
新增 handler 时只需要返回原始业务结果,`run.py` 的 action protocol wrapper 会补齐缺失字段。若底层模块已经返回 `code`,包装层会保留该值。
常用错误码:
| code | 场景 |
|------|------|
| `missing_source` | 缺少 `video_url` / `url` / `source` |
| `source_not_allowed` | 本地路径不在当前工作目录或 `media_roots` 内 |
| `output_exists` | 输出文件已存在且 `overwrite=false` |
| `parse_failed` | `chat` 无法识别自然语言意图 |
| `missing_steps` | `pipeline` 未传 `steps` |
| `missing_captions` | `caption_segment` 未传 `captions` 或 `caption_path` |
| `invalid_action` | 异步任务或 CLI 传入不支持的 action |
| `invalid_params` | HTTP job 的 `params` 不是 JSON object |
| `invalid_async_mode` | HTTP chat 的 `async` 不是 boolean 或 `"auto"` |
| `invalid_wait_timeout` | HTTP chat 的 `wait_timeout_sec` 不是 `0-30` 秒数字 |
| `invalid_job_id` | job id 格式不合法 |
| `job_not_found` | job 文件不存在 |
| `job_interrupted` | 服务重启或进程中断导致未完成 job 失效 |
| `unsupported_action` | action 或 pipeline step 不支持 |
| `invalid_step` | pipeline step 结构不合法 |
| `ffmpeg_failed` | ffmpeg / ffprobe 缺失或执行失败 |
| `missing_asr_dependency` | ASR 依赖缺失 |
| `missing_ocr_dependency` | OCR 依赖缺失 |
## HTTP 异步任务维护
异步任务逻辑在 `job_manager.py`。HTTP 服务启动时会创建单 worker 队列,串行执行提交到 `/skill/jobs` 的 action。
维护规则:
- job 文件存储在 `output/jobs/<job_id>/job.json`。
- job id 使用 32 位十六进制 UUID。
- job 文件必须保留 `job_id`、`action`、`params`、`status`、`code`、`reply`、`hint`、`created_at`、`started_at`、`finished_at`、`result`、`output_paths`、`error`。
- `chat` 提交的 job 会额外写入 `created_by=chat`、`intent`、`source`、`metadata.message`。
- `/skill/jobs` 直接提交的 job 会写入 `created_by=jobs`。
- 当前版本不支持取消任务,不记录进度百分比。
- 服务重启后不恢复未完成任务;旧的 `queued` / `runninskill-card.md
## Description: 自然语言媒体助手 - 视频压缩、MP4/MOV 封面提取、音频转换、字幕识别。 This skill is ready for commercial/non-commercial use. ## Publisher: [370299455cx-web](https://clawhub.ai/user/370299455cx-web) ### License/Terms of Use: MIT-0 ## Use Case: Developers and external users use this skill to turn natural-language or JSON requests into media-processing tasks such as video compression, thumbnail extraction, audio conversion, subtitle recognition, batch processing, and asynchronous job polling. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: The unauthenticated local HTTP API can process local files and remote URLs. Mitigation: Run it only in a trusted local environment and do not expose the HTTP server to a network. Risk: Changing the bind host to 0.0.0.0 can make the service reachable beyond localhost. Mitigation: Use authentication, restricted CORS, and a controlled reverse proxy before any non-local deployment. Risk: Accepting media_roots from untrusted callers can expand local file access. Mitigation: Do not accept media_roots from untrusted callers and restrict configured media roots to approved directories. Risk: Media processing and model dependencies can consume significant compute, memory, disk, and network resources. Mitigation: Use pinned dependencies, trusted media sources, quota controls, and resource limits before production use. ## Reference(s): - [ClawHub skill page](https://clawhub.ai/370299455cx-web/skills/ym-mediatoolkit) - [Publisher profile](https://clawhub.ai/user/370299455cx-web) ## Skill Output: **Output Type(s):** [text, markdown, code, shell commands, configuration, guidance, files] **Output Format:** [Markdown guidance, shell commands, JSON responses, and generated media or caption files] **Output Parameters:** [1D] **Other Properties Related to Output:** [Outputs can include stable status/code/reply/hint fields, media file paths, caption JSON, pipeline manifests, and asynchronous job metadata.] ## Skill Version(s): 4.2.2 (source: server release metadata) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
output/jobs/c65f1520dca6436c87f1028354263718/job.json
{
"job_id": "c65f1520dca6436c87f1028354263718",
"action": "info",
"params": {
"source": "sample.mp4",
"name": "sample"
},
"created_by": "chat",
"intent": "info",
"source": "sample.mp4",
"metadata": {
"created_by": "chat",
"intent": "info",
"source": "sample.mp4",
"message": "查看 \"sample.mp4\" 信息"
},
"status": "success",
"code": "ok",
"reply": "ok",
"hint": "ok",
"created_at": "2026-06-25T02:22:13.021739+00:00",
"started_at": "2026-06-25T02:22:13.022226+00:00",
"finished_at": "2026-06-25T02:22:13.022565+00:00",
"result": {
"status": "success",
"code": "ok",
"reply": "ok",
"hint": "ok",
"output_path": "out/a.json",
"nested": {
"outputPath": "out/a.json"
}
},
"output_paths": [
"out/a.json"
],
"error": null
}AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/370299455cx-web/skills/ym-mediatoolkit",
"sourceUrl": "https://clawhub.ai/370299455cx-web/skills/ym-mediatoolkit",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T11:42:42.807Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-370299455cx-web-ym-mediatoolkit/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-370299455cx-web-ym-mediatoolkit/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T11:42:42.807Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.5K downloads",
"href": "https://clawhub.ai/370299455cx-web/ym-mediatoolkit",
"sourceUrl": "https://clawhub.ai/370299455cx-web/ym-mediatoolkit",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T11:42:42.807Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "4.2.2",
"href": "https://clawhub.ai/370299455cx-web/ym-mediatoolkit",
"sourceUrl": "https://clawhub.ai/370299455cx-web/ym-mediatoolkit",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-06-25T08:57:44.696Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-370299455cx-web-ym-mediatoolkit/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-370299455cx-web-ym-mediatoolkit/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 4.2.2",
"description": "4.3.1 更新 - 修正 HTTP chat 短等待:job 在 wait_timeout_sec 内完成时返回 200 和最终结果,否则返回 202。 - /skill/jobs 接口的 params 仅允许为 JSON object,缺省/null 时自动为 {},其他类型返回 invalid_params。 - async 仅支持 JSON boolean 或 \"auto\" 字符串,wait_timeout_sec 必须为 0–30 秒数字。 - 异步返回的 output_paths 去重并保持首次出现顺序。",
"href": "https://clawhub.ai/370299455cx-web/ym-mediatoolkit",
"sourceUrl": "https://clawhub.ai/370299455cx-web/ym-mediatoolkit",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-06-25T08:57:44.696Z",
"isPublic": true
}
]
}Record generated Oct 10, 2026.
