mcpbeat Sign in

Native Subtitle Quote Image Agent Skill

将自带画面内嵌中文字幕的视频,按真实字幕出现的精确帧裁切并拼成社交平台长图。用户要求保留原视频字幕、原生字幕拼图、字幕帧截图、不要重绘字幕、主画面加字幕条,或要把这种样式做成固定模板时使用;也用于修改既有原生字幕拼图的时间点、字幕区域、比例和画面数量。

3k tokens
context cost
the whole folder, loaded on every use
4
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
117
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/chengyi-ai/native-subtitle-quote-image --skill native-subtitle-quote-image

What comes with it

8 328 bytes besides the instruction
agents/openai.yaml
requirements.txt
scripts/native_subtitle_stitch.py

The instruction itself

as written by the author

原生字幕拼图

只处理画面中已经存在字幕的视频。不要重写、翻译或覆盖字幕;成品中的文字必须来自原视频帧。

路径与依赖

  • 将下文的 <SKILL_DIR> 解析为当前 SKILL.md 所在目录的绝对路径。不要假设 Agent 的工作目录就是 Skill 目录。
  • 使用 Python 3.10+。运行前检查 Pillow 与 FFmpeg:
  python3 -c "from PIL import Image; import imageio_ffmpeg; print(imageio_ffmpeg.get_ffmpeg_exe())"
  • 依赖缺失时,先向用户说明并取得安装授权,再运行:
  python3 -m pip install -r "<SKILL_DIR>/requirements.txt"

固定样式

  • 默认输出 3:4、1440×1920。
  • 每张图默认使用 5 个时间点:第一帧作为主画面,其余 4 帧裁成字幕画面条。
  • 主画面和字幕条都保留原字幕,按字幕底部向上裁切。
  • 默认字幕区域为画面高度的 0.68–0.96;实际位置不符时先预览再调整。
  • 保存时间点 manifest、总览图和逐张 JPG。
  • 不覆盖用户已有成品,使用新的输出目录。

工作流

  • 确认输入是本地视频,且字幕烧录在画面内。若只有外部字幕或没有字幕,改用 $video-quote-image
  • 抽取候选区间的缩略图,选择字幕完整显示的中间帧。相邻时间点必须对应不同句字幕,避免空字幕、同句重复和字幕切换瞬间。
  • 先预览字幕区域:
   python3 "<SKILL_DIR>/scripts/native_subtitle_stitch.py" band VIDEO -t 60 \
     --band-top 0.68 --band-bottom 0.96 --out band-preview.jpg
  • 在任务输出目录创建 manifest:
   {
     "images": [
       {"title": "热爱让创作发生", "times": [12, 16, 18, 22, 24]}
     ]
   }
  • 渲染整套:
   python3 "<SKILL_DIR>/scripts/native_subtitle_stitch.py" render VIDEO \
     --manifest manifest.json --out-dir OUTPUT_DIR \
     --aspect 3:4 --width 1440 --band-top 0.68 --band-bottom 0.96
  • 使用图像查看工具逐张检查最终 JPG 和 final_contact_sheet.jpg。检查字幕完整、无重复、无人脸被异常切断、画面条之间无黑边或空白。
  • 有问题时只调整对应 manifest 时间点 0.5–3 秒,重新渲染并再次检查。

选帧规则

  • 优先选择字幕稳定显示后的中间帧,不取刚出现或即将消失的帧。
  • 一张图内的 5 句应能构成连续表达,但允许跨过没有信息量的过渡句。
  • 主画面优先人物、环境或关键动作清楚的帧;字幕条允许画面重复,但字幕文字不能重复。
  • 原字幕位置较高或有两行字幕时,增大裁切区域,例如 0.60–0.97
  • 原视频分辨率较低时仍输出 1440×1920,但明确这是放大尺寸,不宣称提升真实清晰度。

资源

  • scripts/native_subtitle_stitch.py:精确取帧、裁切、拼图和总览图生成器。
  • requirements.txt:运行脚本所需的 Python 依赖。

交付

向用户提供输出目录、总览图、时间点 manifest 和 ZIP(若用户需要)。直接展示总览图。不得把未经逐张检查的图片报告为完成。

How to use it

Copy the folder

Take chengyi-ai/native-subtitle-quote-image from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference pip. Without those the skill loads but fails at the first command.