@pls-compile-owo/fisheye 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  本项目遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 规范与 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## [0.7.2] - 2026-11-14
6
+
7
+ ### Docs
8
+
9
+ 纯文档同步版本(功能与 0.7.1 完全一致,无需重新安装)。
10
+
11
+ - README 补全:批量处理、字幕翻译、MCP server、OCR、任意平台视频、清理、断点续跑等 0.5~0.7 新增功能的文档。
12
+ - 第三方依赖致谢补充 whisper.cpp / Tesseract / yt-dlp。
13
+ - 英文 README 补充 More commands 段。
14
+
5
15
  ## [0.7.1] - 2026-11-14
6
16
 
7
17
  ### Added
package/README.en.md CHANGED
@@ -65,6 +65,20 @@ node fisheye.mjs grab BV1xxx 69.6,75.3
65
65
  The CLI prints `SHEET: <path>` — feed that image to your multimodal model via
66
66
  `read_image`. (Optional: wrap the CLI in an MCP server if your agent environment supports it.)
67
67
 
68
+ ## More commands
69
+
70
+ ```bash
71
+ node fisheye.mjs local ./video.mp4 [--grid 4x4] # local video
72
+ node fisheye.mjs transcribe BV1xxx [--lang zh] # audio transcription (whisper.cpp)
73
+ node fisheye.mjs ocr image.png [--lang chi_sim+eng] # OCR text (tesseract)
74
+ node fisheye.mjs url "https://..." # any platform (yt-dlp)
75
+ node fisheye.mjs batch list.txt --concurrency 2 # process many videos
76
+ node fisheye.mjs clean [--target out] [--yes] # clean artifacts
77
+ ```
78
+
79
+ `auto --resume` reuses existing grids and skips frame extraction; `--force` re-runs everything.
80
+ Optional integrations: whisper.cpp (audio), tesseract (OCR), yt-dlp (any URL), and `mcp-video-server.js` (MCP tools, needs `npm i @modelcontextprotocol/sdk zod`).
81
+
68
82
  ## Docs
69
83
 
70
84
  - `docs/DESIGN.md` — design rationale
@@ -88,6 +102,9 @@ Third-party dependencies:
88
102
  |---|---|---|
89
103
  | [ffmpeg](https://ffmpeg.org/) | frame extraction, tiling, subtitle-band slicing | LGPL/GPL |
90
104
  | [numpy](https://numpy.org/) · [Pillow](https://python-pillow.org/) | subtitle-band detection (optional) | BSD / MIT-CMU |
105
+ | [whisper.cpp](https://github.com/ggml-org/whisper.cpp) | audio transcription (optional) | MIT |
106
+ | [Tesseract OCR](https://github.com/tesseract-ocr/tesseract) | OCR (optional) | Apache-2.0 |
107
+ | [yt-dlp](https://github.com/yt-dlp/yt-dlp) | any-platform video download (optional) | Unlicense |
91
108
 
92
109
  ## License
93
110
 
package/README.md CHANGED
@@ -177,7 +177,13 @@ node fisheye.mjs auto BV1xxx --budget 20000 --force # 强制全部重跑
177
177
  | `subs <BV>` | 只生成字幕带(`--count` 行数、`--band auto\|0.22`) |
178
178
  | `refine <BV>` | 挑出值得精读的时间点,**并直接截好原图**(三种模式:模板 / 决策文件 / 几何兜底) |
179
179
  | `grab <BV> <t1,t2>` | 按时间点截原分辨率单帧(手动指定) |
180
- | `selftest [--deep]` | 自检:依赖 / 凭证 / API / 缓存 / 磁盘 |
180
+ | `local <视频文件>` | 本地视频:ffmpeg 抽帧拼图(`--grid`、`--from`/`--to`) |
181
+ | `transcribe <BV>` | 音频转写(whisper.cpp,`--lang zh`) |
182
+ | `ocr <图片>` | OCR 识别图片文字(tesseract,`--lang chi_sim+eng`) |
183
+ | `url <链接>` | 任意平台视频(yt-dlp 下载后走本地流程) |
184
+ | `batch <清单文件\|条目...>` | 批量处理(`--concurrency N` 并发) |
185
+ | `clean [--target cache\|out\|all] [--yes]` | 清理缓存/产物(默认 dry-run) |
186
+ | `selftest [--deep]` | 自检:依赖 / 凭证 / API / OCR / 转写 / yt-dlp / 缓存 / 磁盘 |
181
187
 
182
188
  > `grid` / `subs` / `refine` / `grab` 都要求 `cache/<BV>.mp4` 已存在——第一次用请先跑 `auto`(它会下载)。
183
189
 
@@ -226,6 +232,12 @@ node fisheye.mjs transcribe BV1xxx [--lang zh]
226
232
  模型放 `~/.dsh/surfcore/whisper/`(`ggml-*.bin`)或用 `FISHEYE_WHISPER_MODEL` 指定。
227
233
  转写文本落 `out/<BV>-audio-transcript.txt`。
228
234
 
235
+ ### 字幕翻译
236
+
237
+ 外文视频(英文/日文等)的官方字幕会同时读取 B站 的**中文翻译轨**(l2 机器翻译),
238
+ 转写结果旁会打印翻译行数,翻译文本落盘 `out/<BV>-official-subs-translated.txt`。
239
+ 没有翻译轨的视频不会凭空翻译(不接外部翻译 API)。
240
+
229
241
  ## OCR(图片文字识别)
230
242
 
231
243
  装了 tesseract 后可以识别图片/画面里的文字:
@@ -247,6 +259,23 @@ node fisheye.mjs url "https://www.youtube.com/watch?v=xxx"
247
259
 
248
260
  下载(yt-dlp)→ 自动走本地视频抽帧流程。探测顺序:`FISHEYE_YTDLP` → PATH → 常见安装路径。
249
261
 
262
+ ## 批量处理
263
+
264
+ 一次处理多个视频(每行一个 BV / 本地路径 / URL,支持 `#` 注释):
265
+
266
+ ```bash
267
+ # 从清单文件
268
+ node fisheye.mjs batch list.txt --concurrency 2
269
+
270
+ # 直接传条目
271
+ node fisheye.mjs batch BV1xxx BV2xxx "C:\videos\a.mp4"
272
+
273
+ # 并发处理(默认 1 串行;失败不中断,最后汇总)
274
+ node fisheye.mjs batch list.txt --concurrency 3
275
+ ```
276
+
277
+ 每一项按类型自动分派:BV → auto、路径 → local、链接 → url。
278
+
250
279
  ## 清理
251
280
 
252
281
  ```bash
@@ -254,6 +283,60 @@ node fisheye.mjs clean # 预览将清理的缓存/产物(dr
254
283
  node fisheye.mjs clean --target out --yes # 实际删除 out/
255
284
  ```
256
285
 
286
+ ## MCP server(可选)
287
+
288
+ `mcp-video-server.js` 把 fisheye 包装成 [MCP](https://modelcontextprotocol.io/)(Model Context Protocol)工具,让支持 MCP 的 agent 环境(DSH / Claude Code / Cursor 等)**不必自己拼命令行**就能看视频。
289
+
290
+ 这是**可选组件**:fisheye 核心保持零依赖,不装下面两个 npm 包也能正常用 `auto` / `local` 等命令。
291
+
292
+ ### 安装
293
+
294
+ ```bash
295
+ # 在 fisheye 目录(含 fisheye.mjs 的那层)里执行,会生成 node_modules/
296
+ npm i @modelcontextprotocol/sdk zod
297
+ ```
298
+
299
+ 除此之外还需要同目录的 `fisheye.mjs` + `lib/`、ffmpeg、B站 登录态(见上文「配置 B 站登录态」)。
300
+ `vwatch_deep` 的「独立会话复述」额外需要本机安装 **DeepSeek Harness 桌面版**;没有时会自动降级,直接返回抽帧规划 + 官方字幕原文。
301
+
302
+ ### 配置
303
+
304
+ 把 server 注册到 MCP 客户端(Claude Code 写进项目根的 `.mcp.json`;DSH 用同样的 `mcpServers` 结构):
305
+
306
+ ```json
307
+ {
308
+ "mcpServers": {
309
+ "fisheye": {
310
+ "command": "node",
311
+ "args": ["C:/path/to/fisheye/mcp-video-server.js"]
312
+ }
313
+ }
314
+ }
315
+ ```
316
+
317
+ Windows 路径用正斜杠或双反斜杠。若用 `FISHEYE_HOME` 挪过数据目录,在 `env` 里一并传入:
318
+
319
+ ```json
320
+ {
321
+ "mcpServers": {
322
+ "fisheye": {
323
+ "command": "node",
324
+ "args": ["C:/path/to/fisheye/mcp-video-server.js"],
325
+ "env": { "FISHEYE_HOME": "D:/video-cache" }
326
+ }
327
+ }
328
+ }
329
+ ```
330
+
331
+ ### 工具
332
+
333
+ | 工具 | 作用 | 参数 |
334
+ |---|---|---|
335
+ | `vwatch_scan` | 快速扫一眼:对开头一段抽帧拼成九宫格,**直接返回画面**(不含文字总结) | `bvid`、`grid`(`3x3` / `4x4` / `5x5`) |
336
+ | `vwatch_deep` | 深入看懂:按 token 预算抽帧 + 优先官方字幕 → 交给独立 headless 会话读完 → **只返回完整复述**(不占当前对话上下文) | `bvid`、`from`、`to`、`page`、`budget` |
337
+
338
+ > 工具名沿用旧名 `vwatch_*`,以免破坏已有的 MCP 配置。参数与 CLI 一一对应:`bvid` → BV 号,`from`/`to` → `--from`/`--to`,`page` → `--p`,`budget` → `--budget`。
339
+
257
340
  ## 它怎么工作
258
341
 
259
342
  ```
@@ -352,6 +435,9 @@ Copyright (c) 2026 Derpyu520 and qq-bridge / QSH contributors)。
352
435
  |---|---|---|
353
436
  | [ffmpeg](https://ffmpeg.org/) | 抽帧、拼图、字幕带切片 | LGPL/GPL |
354
437
  | [numpy](https://numpy.org/) · [Pillow](https://python-pillow.org/) | 字幕带位置检测(可选) | BSD / MIT-CMU |
438
+ | [whisper.cpp](https://github.com/ggml-org/whisper.cpp) | 音频转写(可选,`transcribe` / `--audio`) | MIT |
439
+ | [Tesseract OCR](https://github.com/tesseract-ocr/tesseract) | 图片文字识别(可选,`ocr`) | Apache-2.0 |
440
+ | [yt-dlp](https://github.com/yt-dlp/yt-dlp) | 任意平台视频下载(可选,`url`) | Unlicense |
355
441
 
356
442
  ### 思想来源
357
443
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pls-compile-owo/fisheye",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Token-budget-aware video understanding for AI agents: official subtitles -> burned-in subtitle band -> danmaku highlights -> adaptive keyframe grids -> targeted refine.",
5
5
  "type": "module",
6
6
  "bin": {