Overview
media_overviewGenerate a readable overview of a local video, audio recording, or document—storyboard grids, timestamped transcripts, page thumbnails, and page-aligned text—so you can inspect it without guessing.
Instructions
Build an overview of a local media file so you can read it without guessing. (生成媒体总览:视频出分镜宫格图与按时间对齐的文本清单;录音出带时间轴的转写;文档出页面缩略图与每页文字。)
What you get depends on the media:
video : one or more numbered storyboard grids (each cell carries its cell number) plus a time-aligned text index of the cells
audio : a timestamped transcript, segment by segment
document : a grid of page thumbnails plus page text, when a document parser is configured
For DOCUMENTS, ocr: "auto" (default) uses the PDF text layer where one exists and calls the OCR provider only for pages without one; ocr: "force" re-recognizes every requested page with the OCR provider, even pages that already have a text layer, and tags them (ocr). Use force when media_probe says "text layer: looks unreliable" or when the extracted text is visibly garbled. Forced results are cached separately from auto. (文档:ocr: "force" = 强制重新 OCR / 重新识别文字层)
Pass images: 0 for a text-only, zero-pixel overview: no grid is rendered and no frame is decoded (a video costs no ffmpeg work at all), so you get only the transcript — or the page text for a document — and the reported budget is all zeros. Use it when you only need the words.
TEXT SOURCE ORDER — subtitles first, ASR only as a fallback:
a subtitle you select explicitly (external subtitle file, track index or language code),
the subtitle track embedded in the container,
a subtitle file with the same base name in the same directory (a.srt next to a.mp4),
ASR — only when none of the above exists and an ASR provider is configured. Every segment is tagged with its source. subtitle = from a subtitle file/track; usually the author's words, but may be auto-generated: check names and numbers against the frame. asr = machine transcription: names, numbers and jargon are often wrong, so do NOT quote an ASR segment verbatim and do not present it as the speaker's exact words. visual = there is no text at all, only the picture.
The storyboard grid is for FINDING things, not for reading them: cells are small, so text inside a cell is usually unreadable. To read text on screen, call media_zoom on that moment and read the cropped single frame.
The full text is NOT inlined. It is written to disk, and the text of the result ends with a line like "full text: /abs/path/content.md (segments.jsonl, manifest.json in the same directory)". That absolute path is what you read: content.md is the readable full text, segments.jsonl has one segment per line, manifest.json records what was produced and how. Read those files section by section and summarise them in chunks yourself — do not ask for the same range again just to get more inline text. If the export could not be written, the line reads "full text: NOT written — " instead.
The inline text is a PREVIEW with three tiers. (1) WHOLE: the requested range fits, and the result says "complete text ... nothing omitted". (2) SKIM (documents only, when the document parser exposes block structure): every heading plus the first complete sentence of each paragraph, tables as "[table: caption]", with captions/footnotes/equations left out; each page is labelled like "[page 4 · skim: 12 of 210 sentences]". A skim built from the built-in heuristic blocks is best-effort — section structure may be wrong; read content.md for the authoritative text. (3) SAMPLED: complete units — document sentences, video/audio transcript segments — are sampled evenly, with a line like "preview: sampled 84 of 312 sentences across pages 1-28; not represented: 2-6, 8-12". In a skim that still does not fit, all headings are kept and sentences are sampled; only when even the headings do not fit are the headings sampled. Sampling never drops a whole page silently: pages that could not be represented are listed, and a single over-long unit is truncated with a trailing "…[+N chars]". Read content.md when you need the complete text.
VIEW — the view parameter controls the inline text (default "auto"). The result carries ONE outline from the first available source: the bookmark sidecar (".mmgrep.bookmark.json", written by media_bookmark) when one exists, otherwise the file's own outline (PDF bookmarks, or chapter markers in video/audio); a document without bookmarks may get an outline GENERATED FROM ITS HEADINGS when the range has at least 5 headings, labelled "outline: generated from headings" (best-effort). (1) "auto": if the requested range fits, you get the full text; if it does not fit and there is an outline, the outline comes first (ids b1…bN with page numbers for PDFs, timestamps for chapters) and the rest of the budget goes to the text preview; if there is no outline, you get the normal skim/sampled preview. (2) "outline": return only the outline — generated from headings for a document without bookmarks; for video/audio without chapters you get an explicit "no chapters" message and NOTHING is generated, because this server never invents an outline from content. In that case read the overview (or a start/end window) and write your own outline from the time-aligned text and storyboard grids. (3) "text": ignore the outline and force the text pipeline. The full outline (entries, source, sidecar path) is always in structuredContent.outline and, for an overview that writes an export, in manifest.json. When a sidecar exists its last outline line is "full detail: " — read that file for the complete bookmark detail. (目录:sidecar 优先,其次文件自带目录,最后才是 heading 生成;view:auto 放不下时先出目录;view:outline 只出目录;view:text 只出文本)
The result also carries the ANNOTATIONS of the requested range, right next to the page / time range they belong to: the annotation sidecar (".mmgrep.annotation.json", written by media_annotate) when one exists, otherwise the file's own annotations (PDF annotation objects). One annotation per line, in the same shape media_annotate writes ("n3 (p.12): note" for PDFs, "n3 (00:12:34–00:12:39): note" for video/audio). The line starts with the annotation id (n1, n2, …) — these are the ids media_annotate accepts. The author is in structuredContent.annotations only; the note text is shown as written. (批注按请求范围展示:行首 n1…nN 就是 media_annotate 的 id)
Always call media_probe first: it tells you how long the file is, whether a subtitle source exists, which transcript source applies, and which outline applies (bookmark sidecar first, then the file's own PDF bookmarks / video-audio chapters, or headings for a document), for free. Long media must be narrowed with start/end (video, audio) or pages (document) — one giant grid of a two-hour film gives you illegible cells and spoils the ending. Follow the continuation hint in the result to page through the rest.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "media_overview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Window end in seconds (closed interval, both ends included). Applicable to video and audio only. Defaults to the end of the media; a value past the end is clipped and reported. (终点,秒) | |
| ocr | No | Document media only: how to obtain page text. "auto" (default) uses the PDF text layer where one exists and OCR only for pages without one. "force" re-recognizes every requested page with the OCR provider even if it already has a text layer, and tags those pages (ocr); use it when media_probe says "text layer: looks unreliable" or the extracted text is garbled. Forced results are cached separately from "auto". Requires a configured OCR provider; not applicable to video or audio. (文档:ocr auto 默认;force = 强制重新 OCR / 重新识别文字层) | |
| path | Yes | Absolute path to a LOCAL file: video, audio recording, or document. URLs and relative paths are rejected — this server never downloads anything. (本地文件绝对路径) | |
| view | No | What to put in the inline text. "auto" (default): the full text of the requested range when it fits; otherwise, when there is an outline (the bookmark sidecar when it exists, otherwise PDF bookmarks / video-audio chapters, or ≥ 5 document headings), the outline comes first and the remaining budget goes to a text preview; files without an outline use the normal skim/sampled preview. "outline": return only that same single outline (generated from headings for a document without bookmarks; an explicit "no chapters" message for video/audio — this server never invents an outline from content). "text": force the text pipeline and ignore any outline. The sidecar wins over the file's own outline, and its last outline line is "full detail: <sidecar path>". (返回内容:auto 自动;outline 只出目录(sidecar 优先);text 只出文本) | |
| cells | No | Cells per puzzle image: storyboard shots for video, page thumbnails for document. 1-16; default 9 for video and 6 for document. Applicable to video and document only. (每张拼图的格数) | |
| pages | No | Page range for document media: comma-separated 1-based page numbers and closed ranges, e.g. "3-10,15". Not applicable to video or audio. (页码范围) | |
| start | No | Window start in seconds (closed interval, both ends included). Applicable to video and audio only; document media uses "pages" instead. Default 0. (起点,秒) | |
| images | No | How many puzzle images to return: 0-4, default 2. Use 0 for the text-only mode: zero pixels — for video nothing is scanned and no frame is decoded, for audio no waveform is drawn, for document no page is rendered; only the transcript (or page text) comes back and the budget is all zeros. Applicable to video and document; audio accepts 0 only. (返回几张拼图;0 = 纯文本模式) | |
| maxEdge | No | Longest edge of each image in pixels: 256-1600. Default 1280 for overview, 1600 for zoom. Applicable to video and document only. (单张图最长边) | |
| segment | No | Window length in seconds (30-3600, default 300), used when only "start" is given. Applicable to video and audio only. | |
| envelope | No | Attach an audio envelope waveform image (default false). Applicable to audio recordings only. (音频包络图) | |
| subtitle | No | Choose the subtitle source explicitly (video and audio only, one parameter for all forms). An absolute path to a local subtitle file (.srt, .vtt, .ass, .ssa); a non-negative integer = the ffprobe stream index of a text subtitle track; any other string = a language code matched against track tags.language (case-insensitive; "zh" also matches "chi"/"zho", "en" matches "eng"). An explicit choice never falls back: if it cannot be used, media_probe only reports the reason and the other tools fail with INVALID_ARGUMENT. Omit it for the automatic order (embedded text track, then a sibling subtitle file, then ASR). (显式选择字幕来源:文件路径 / 字幕轨序号 / 语言码) | |
| transcript | No | "auto" (default): use subtitles first (explicit subtitle selection, embedded track, sibling file), ASR only as a fallback. "subtitle": read subtitles only and never call ASR; if there is no subtitle source the result is empty and says why. "off": no transcription at all, neither subtitles nor ASR; visuals only. Applicable to video and audio only. |