ilps2/dsh-video-understand

低成本视频理解工具,适用于DeepSeek Harness(dsh)插件:B站/本地视频 → AVIS信息层 → 摘要与问答(token压缩率超过99.95%)。

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness that adds the video_understand tool to DSH agents. It accepts Bilibili video URLs, BV numbers, or absolute paths to local video files as input. It processes the input video to generate a structured AVIS information layer with ASR transcription, scene structure, motion object tracks, and YOLO semantics, then uses this compressed information to generate summaries and answer user questions about the video. It supports three processing levels with different cost tradeoffs and privacy configurations to match different user needs.

The plugin is designed for DSH users who need to extract information or answer questions from video content. To use it, you simply input your target video identifier (link, BV number, or local path) and can optionally set custom questions, processing level, and maximum cost budget for the call. The default L0 processing level runs fully locally, meaning no video data is uploaded to external servers, making it suitable for private or sensitive video content. L1 and L2 levels use an external MiMo API for additional visual analysis, with clear cost estimates built in to prevent overspending.

You can install the plugin via the built-in DSH plugin command dsh plugin add dsh-video-understand or via npm install. The only required system dependencies are a pre-installed ffmpeg and a valid LLM API key, which the plugin will automatically pull from your existing DSH credentials file if you do not set it explicitly. All core Python dependencies are automatically installed in an isolated virtual environment on the first run, so they do not interfere with your system Python installation. Optional 2GB semantic layer dependencies need to be installed manually, and the plugin is released under the open source MIT license.

这是一款专为 DeepSeek Harness 开发的原生插件,为 DSH Agent 注册了 video_understand 工具。它支持处理 B 站视频链接、BV 号或本地视频文件,输出包含 ASR 转写、场景结构、运动目标轨迹、YOLO 语义的结构化 AVIS 信息层,最终生成视频摘要并回答用户针对视频内容的提问,支持三个不同处理等级和成本控制策略。

它面向需要对视频内容做问答分析或信息提取的 DSH 用户,典型工作流是输入目标视频链接、BV 号或本地路径,还可以自定义问题、处理等级、单次调用预算上限,插件自动完成全部处理流程,最终返回结构化的摘要和问答结果,默认 L0 等级完全本地处理,不会上传任何用户视频数据。

安装可通过 DSH 内置的插件管理命令 dsh plugin add dsh-video-understand 或 npm 安装,依赖仅需要系统预装 ffmpeg 和 LLM API 密钥,核心依赖会在首次调用时自动安装到隔离虚拟环境,不会污染系统 Python,可选语义层依赖约 2GB,需手动安装,采用 MIT 许可证开放使用。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 8 stars - very few users, little community feedback星标只有 8,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:ilps2/dsh-video-understand

把 ilps2/dsh-video-understand 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-video-understand

npm version GitHub stars

低成本视频理解插件:给 dsh agent 注册 video_understand 工具——B站链接 / BV 号 / 本地视频 → AVIS 信息层(ASR 转写 + 场景结构 + 运动对象轨迹 + YOLO 语义)→ 摘要+问答。采用 Python 引擎:核心层需 faster-whisper / opencv / yt-dlp(约 200-300MB),可选语义层另需约 2GB 的 torch / transformers / ultralytics,内置 doctor --fix 一键建 venv 并装齐两者。

安装

# npm 安装
npm install dsh-video-understand

# 或 dsh plugin add dsh-video-understand

装完即用:首次调用 video_understand 时自动创建插件本地隔离环境(.venv)并安装核心依赖(优先 uv,回退 venv+pip 清华镜像)——无需手动执行任何命令,不污染系统 Python。

引擎已内含,无需额外克隆外部仓库。

环境自检

npx dsh-video-understand doctor        # 逐项检测 + 给出修复命令
npx dsh-video-understand doctor --fix  # 一键自动修复(建环境 + 装依赖)

前置条件仅两个:ffmpeg(macOS brew install ffmpeg / Ubuntu sudo apt install ffmpeg)和一个 LLM API key(见下表)。语义层依赖(torch/CLIP/YOLO,约 2GB)为可选,仅建完整语义层时再装:pip install -r engine/requirements-layer.txt。

⚠️ 数据流披露

级别 数据流向 说明
L0(默认) 完全本地 ASR + 场景分类 + 运动检测,不上传任何数据
L1 MiMo API 视频帧发送至 MiMo 服务器进行 VLM 分析
L2 MiMo API 视频帧发送至 MiMo 服务器进行 VLM 分析
  • L0 级别(默认)仅使用本地 ASR + 场景分类 + 运动检测,不涉及云服务
  • L1/L2 级别会将视频帧(JPEG 编码)发送至 MiMo API 进行视觉理解
  • 帧数据仅用于单次 VLM 推理,不会被存储或用于训练

环境变量

变量 必需 说明
LLM_API_KEY ✅* LLM API 密钥(默认 MiMo:sk-xxxxx)
LLM_API_URL ❌ API endpoint(默认 https://api.xiaomimimo.com/v1/chat/completions)
LLM_MODEL ❌ 模型名(默认 mimo-v2.5)
VIDEO_UNDERSTAND_PYTHON ❌ Python 解释器路径(自动检测有依赖的 Python)
BILI_DOWNLOAD_SCRIPT ❌ bilibili-downloader 脚本路径(下载 B站视频用)

* 未设置 LLM_API_KEY 时,自动从 ~/.dsh/.credentials.yaml 读取(优先 XIAOMI_API_KEY,兼容 DEEPSEEK_API_KEY)。一个 key 搞定。

工具

video_understand(target, questions?, noDownload?, level?, window?)

参数 类型 说明
target string B站 URL / BV 号 / 本地视频绝对路径
questions string[] 可选,自定义问题(默认 3 问)
noDownload boolean 本地文件置 true
level string l0(默认) / l1(+3-5帧VLM视觉摘要) / l2(+时间窗密集帧证据)
window string L2 时间窗,如 10-30 或秒数(auto=轨迹最活跃30s)
budgetCny number 单次问题预算上限(元),视觉成本估算超预算自动降级(拦截 L2 用 L0/L1 回答)

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-serial-console 下一个 Next dsh-ask-peer →