/optimus-media:media-analyzefrom optimus-media
Use when user wants to inspect a media file's codec, resolution, bitrate, frame rate, or duration — 分析视频、分析音频、查看编码格式、查看分辨率码率帧率、这个视频什么编码、ffprobe。Not for editing, converting, compressing, or trimming media.
Ships in optimus-media. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
分析单个音视频文件,输出容器格式、视频/音频编码、分辨率、帧率、码率、时长、文件大小。仅支持单文件分析,不支持批量目录扫描。
处理用户请求的第一步:对比本 skill 需要的信息与用户在触发语句或上下文中已提供的信息,一次性列出缺失项统一询问,不逐个 Step 反应式追问。
🔴 CHECKPOINT:输入文件路径缺失时,必须在此处停下一次性询问用户,禁止带着缺失信息继续往下执行。
本步骤不做实际系统调用,仅做信息是否齐全的静态比对。
执行 ../media-ffmpeg-common/REFERENCE.md 中的环境检测命令,确认 ffprobe 可用。
⛔ STOP:检查失败(命令不存在)时,引导用户参考 ../media-ffmpeg-common/INSTALL.md 安装,返回错误信息并终止任务,不进入后续步骤。
检查用户提供的输入文件路径是否存在。
⛔ STOP:路径不存在时,返回错误信息告知用户核对路径,终止任务,不进入后续步骤。
ffprobe -v quiet -print_format json -show_format -show_streams <input>
参数说明见 ../media-ffmpeg-common/CLI-REFERENCE.md。
⛔ STOP:命令返回非零退出码,或输出 JSON 中 streams 为空数组(文件已损坏、格式不受支持、非媒体文件)时,返回错误信息告知用户该文件无法被 ffprobe 解析,终止任务,不进入 Step 4。
解析上一步的 JSON 输出,提取以下字段整理为表格展示给用户,不直接把原始 JSON 贴给用户:
| 项目 | 值 |
|---|---|
| 容器格式 | 从 format.format_name 提取 |
| 视频编码 | 从视频流 codec_name 提取 |
| 分辨率 | 从视频流 widthxheight 提取 |
| 帧率 | 从视频流 r_frame_rate 计算(如 30000/1001 → 29.97 fps) |
| 视频码率 | 从视频流或 format.bit_rate 提取,换算为 kbps |
| 音频编码 | 从音频流 codec_name 提取 |
| 音频码率 | 从音频流 bit_rate 提取,换算为 kbps |
| 时长 | 从 format.duration 提取,格式化为 HH:MM:SS |
| 文件大小 | 从 format.size 提取,换算为可读单位(KB/MB/GB) |
各字段的含义与换算规则(bps→kbps 的 1000 进制、文件大小 KB/MB/GB 的 1024 进制等)见
ffprobe-field-map.md;分辨率/帧率/码率概念详解见media-parameters.md。
无视频流(纯音频文件)时省略视频相关行;无音频流同理。
流本身存在但某个字段缺失(如 PCM 等无损编码的音频流通常不提供 bit_rate 字段)时,与"无该流"是两种不同情况:该字段对应值展示为"未知",不展示 undefined/null,也不因单个字段缺失判定为整体解析失败——判定解析失败仅适用于 Step 3 中 streams 为空数组的场景。
参见 ../media-ffmpeg-common/REFERENCE.md 的通用报错处理表。
本 skill 为只读查询,可在组合请求(分辨率转换/压缩/截取的组合)中随时按需先行调用以确认原始参数,不参与 ../media-ffmpeg-common/REFERENCE.md "组合请求处理约定"中的顺序编排。
streams 为空时继续解析,应立即返回错误信息并终止(Step 3)bit_rate)误判为整体解析失败或展示为 undefined/null,应展示"未知"(Step 4)What SKILL.md sets; muted values are Claude Code's defaults
11 skills in this plugin
/media-audio-convertUse when user wants to convert an audio file to another audio format or change its bitrate, sample rate, or channel count — 音频格式转换、wav转mp3、flac转aac、音频转码、改音频码率、改采样率、音频转单声道、无损转有损。Not for extracting audio from video (that is media-audio-extract), video container conversion, or codec/format inspection./media-audio-extractUse when user wants to pull the audio track out of a video file — 提取音频、提取音轨、视频转音频、扒音频、从视频里提取声音、视频转mp3、只要声音不要画面。Not for audio-to-audio format conversion (that is media-audio-convert), video container conversion, or codec/format inspection./media-compressUse when user wants to reduce a media file's size while keeping the same resolution — 压缩视频、压缩音频、音视频压缩、减小文件体积、CRF调画质、压缩到指定大小、压缩到多少MB。Not for resolution changes, clip trimming, or pure codec/format inspection.Other plugins' skills for the same job
npx claudepluginhub glepooek/optimus-plugins --plugin optimus-media