Video Knowledge Ingest
Use this skill as the default cross-platform video → transcript → summary → local-knowledge workflow.
Quick start
1. Run the bundled entrypoint:
-
skills/video-knowledge-ingest/scripts/video-ingest.sh "<url-or-local-file>"
2. Read the JSON stdout for paths. Send the summary back to the user from summary.md. Keep the stored files in the local knowledge base; do not move them unless asked.
Default knowledge-base root:
What this skill invokes
Core tools in the normal path:
- yt-dlp — resolve metadata, fetch subtitles, or download media INLINECODE4 / ffprobe — normalize audio before transcription bundled scripts/whisper-gpu.sh — local Whisper transcription using the workspace GPU venv INLINECODE7 — generate the final written summary local filesystem — persist transcript, summary, metadata, and index entries
Platform-specific notes:
- YouTube : prefer subtitles when available; fall back to media download + Whisper Bilibili : often falls back to Whisper; the script auto-normalizes bilibili.com/... to www.bilibili.com/... and strips spm_ tracking paramsXiaohongshu : usually no subtitles; expect media download + WhisperLocal subtitle/text files : skip download and summarize directlyLocal media files : skip yt-dlp; go straight to Whisper
Workflow
1. Normalize the source
- If the input is a URL, use the bundled normalizer. Keep YouTube timing parameters (t, start, list, index) but drop common tracking params. For Bilibili, force www.bilibili.com and remove spm_* query params.
2. Try subtitles first
- Run yt-dlp in subtitle-only mode. Prefer zh.* and en.* subtitles. Treat subtitle download as best effort . If any usable .srt / .vtt file lands, continue with that file even if another subtitle variant returned a non-zero exit code.
3. Fall back to media + Whisper
If no usable subtitles land:
- Download best audio/media with INLINECODE23 Transcribe with bundled INLINECODE24 If GPU transcription fails, the script falls back to CPU automatically
4. Summarize
- Summarize the resulting transcript with INLINECODE25 Expect codex to be installed and logged in, or configure the summarize backend another way before use
5. Persist results
For each ingested item, keep these files:
- source.url or INLINECODE28 INLINECODE29 INLINECODE30 (when remote media/subtitles are fetched) INLINECODE31 (when Whisper was used) INLINECODE32 INLINECODE33 INLINECODE34 global append-only index: INLINECODE35
Common commands
Remote URL:
CODEBLOCK0
Local files:
CODEBLOCK1
Custom output root:
CODEBLOCK2
When to read bundled references
Read references/toolchain.md when you need:
- dependency details exact file layout how each tool is used in the pipeline
Read references/troubleshooting.md when you hit:
- YouTube anti-bot / cookies issues Bilibili 403 on shared links subtitle 429 / partial subtitle failures Xiaohongshu subtitle absence summarize / codex auth failures Whisper venv, CUDA, ffmpeg, or yt-dlp problems
Operating rules
- Prefer the bundled scripts/video-ingest.sh entrypoint over re-implementing the workflow. Do not skip the local knowledge-base write unless explicitly asked. When a run fails, inspect the generated directory before declaring total failure; partial artifacts often explain the real issue. If a platform provides subtitles, prefer them over Whisper. If subtitles are absent or unusable, fall back to media + Whisper automatically.
视频知识摄取
使用此技能作为默认的跨平台视频→转录→摘要→本地知识工作流。
快速开始
1. 运行捆绑的入口点:
- skills/video-knowledge-ingest/scripts/video-ingest.sh
2. 读取JSON标准输出以获取路径。 将summary.md中的摘要发送回用户。 将存储的文件保留在本地知识库中;除非被要求,否则不要移动它们。
默认知识库根目录:
- /home/jason/.openclaw/workspace/knowledge/video-notes/
此技能调用的内容
正常路径中的核心工具:
- yt-dlp — 解析元数据、获取字幕或下载媒体 ffmpeg / ffprobe — 在转录前标准化音频 捆绑的scripts/whisper-gpu.sh — 使用工作区GPU虚拟环境进行本地Whisper转录 summarize --cli codex — 生成最终书面摘要 本地文件系统 — 持久化存储转录、摘要、元数据和索引条目
平台特定说明:
- YouTube :优先使用可用字幕;回退到媒体下载 + Whisper Bilibili :通常回退到Whisper;脚本自动将bilibili.com/...标准化为www.bilibili.com/...并去除spm_跟踪参数小红书 :通常没有字幕;预期媒体下载 + Whisper本地字幕/文本文件 :跳过下载,直接进行摘要本地媒体文件 :跳过yt-dlp;直接进入Whisper
工作流程
1. 标准化源
- 如果输入是URL,使用捆绑的标准化器。 保留YouTube时间参数(t、start、list、index),但丢弃常见的跟踪参数。 对于Bilibili,强制使用www.bilibili.com并移除spm_*查询参数。
2. 优先尝试字幕
- 以仅字幕模式运行yt-dlp。 优先选择zh.和en. 字幕。 将字幕下载视为尽力而为 。 如果有任何可用的.srt/.vtt文件落地,即使另一个字幕变体返回非零退出码,也继续使用该文件。
3. 回退到媒体 + Whisper
如果没有可用的字幕落地:
- 使用yt-dlp下载最佳音频/媒体 使用捆绑的scripts/whisper-gpu.sh进行转录 如果GPU转录失败,脚本会自动回退到CPU
4. 生成摘要
- 使用summarize --cli codex --force-summary对生成的转录进行摘要 预期codex已安装并登录,或者在使用前以其他方式配置摘要后端
5. 持久化结果
对于每个摄取的项目,保留以下文件:
- source.url 或 source.path source.info.json downloads/(当获取远程媒体/字幕时) whisper/(当使用Whisper时) transcript.txt summary.md record.json 全局追加索引:knowledge/video-notes/index.jsonl
常用命令
远程URL:
bash
skills/video-knowledge-ingest/scripts/video-ingest.sh https://www.youtube.com/watch?v=...
skills/video-knowledge-ingest/scripts/video-ingest.sh https://bilibili.com/video/BV...
skills/video-knowledge-ingest/scripts/video-ingest.sh https://www.xiaohongshu.com/explore/...
本地文件:
bash
skills/video-knowledge-ingest/scripts/video-ingest.sh /path/to/file.srt
skills/video-knowledge-ingest/scripts/video-ingest.sh /path/to/file.mp4
自定义输出根目录:
bash
skills/video-knowledge-ingest/scripts/video-ingest.sh --kb-root /some/other/root
何时阅读捆绑的参考文档
当您需要以下内容时,阅读references/toolchain.md:
- 依赖项详细信息 精确的文件布局 每个工具在管道中的使用方式
当您遇到以下问题时,阅读references/troubleshooting.md:
- YouTube反爬虫/ Cookie问题 Bilibili共享链接的403错误 字幕429 / 部分字幕失败 小红书字幕缺失 summarize / codex认证失败 Whisper虚拟环境、CUDA、ffmpeg或yt-dlp问题
操作规则
- 优先使用捆绑的scripts/video-ingest.sh入口点,而不是重新实现工作流程。 除非明确要求,否则不要跳过本地知识库写入。 当运行失败时,在宣布完全失败之前检查生成的目录;部分工件通常能解释真正的问题。 如果平台提供字幕,优先使用它们而不是Whisper。 如果字幕缺失或不可用,自动回退到媒体 + Whisper。