Extract Video Frame logo

Extract Video Frame

Community
JianhuiWei7
extract-video-frame

【视频抽帧工具】从指定的视频中提取特定位置的单帧画面并保存为图片。支持提取首帧(first)、中间帧(middle)、尾帧(last)、指定帧号(如 100)或指定秒数(如 2.5)。当用户要求从视频中截取画面、保存视频截图、提取某一帧图片时,必须立即调用此技能。

Overview

PublisherJianhuiWei7
RepositoryVideoWeaver
Skill nameextract-video-frame
Stars
48
Forks
1
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by JianhuiWei7 on GitHub. Read the source before you install it.

Installation

Install the Extract Video Frame AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/JianhuiWei7/VideoWeaver/tree/main/skills/extract-video-frame
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/JianhuiWei7/VideoWeaver.git /tmp/VideoWeaver
mkdir -p .claude/skills
cp -r /tmp/VideoWeaver/skills/extract-video-frame .claude/skills/extract-video-frame
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Extract Video Frame in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Extract Video Frame on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Extract Video Frame is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

前置依赖

  1. 安装依赖包:pip install opencv-python

支持模式

  1. 相对位置抽帧 支持通过关键词快速提取视频的关键节点画面:
  • first: 第一帧
  • middle: 中间帧
  • last: 最后一帧(默认行为)
  1. 精确位置抽帧 支持精准定位提取:
  • 按帧号:传入整数(例如 150 代表第 150 帧)
  • 按时间(秒):传入浮点数(例如 3.5 代表第 3.5 秒处的帧)

典型使用案例

  1. 提取视频的最后一帧(自动生成路径) 如果用户只要求从视频提取一帧或明确要求最后一帧,不用指定输出路径,会自动在基于 session 生成的特定输出目录下生成 {视频文件名}_last.jpeg:
bash
python extract-video-frame/scripts/extract_frame.py \
  --video_path "/path/to/video.mp4" \
  --session-key "agent:{agent_id}:{session_id}"
  1. 提取视频的第一帧或中间帧(自动生成路径) 通过 --position 参数指定相对位置,会自动生成如 {视频文件名}_first.jpeg:
bash
python extract-video-frame/scripts/extract_frame.py \
  --video_path "/path/to/video.mp4" \
  --position "first" \
  --session-key "agent:{agent_id}:{session_id}"
  1. 按指定时间(秒)或帧号提取并指定输出路径 通过 --position 参数指定数字(小数代表秒,整数代表帧号),可自主决定输出路径:
bash
# 提取第 2.5 秒的画面

**环境依赖:** `opencv-python`

python extract-video-frame/scripts/extract_frame.py \
  --video_path "/path/to/video.mp4" \
  --output_path "/path/to/output_2_5s.jpg" \
  --position "2.5" \
  --session-key "agent:{agent_id}:{session_id}"
  1. 指定输出的 JPEG 图片质量 默认质量为 95,可通过 --quality 参数调节(0-100):
bash
python extract-video-frame/scripts/extract_frame.py \
  --video_path "/path/to/video.mp4" \
  --output_path "/path/to/output_high_res.jpg" \
  --position "middle" \
  --quality 100 \
  --session-key "agent:{agent_id}:{session_id}"

运行模式与日志监控

默认行为: 该脚本为前台同步执行(Blocking),直接在终端输出执行结果。

完成状态:

  • 成功:日志末尾会输出 ✅ 帧已保存至: [输出路径] (目标帧位置: X / 总帧数: Y)。
  • 失败:日志会输出 读取帧失败 或 无法打开视频文件,并且脚本会以非零状态码退出。

参数说明

参数名说明
--video_path(必填)需要提取帧的输入视频文件绝对路径。
--output_path(选填)提取出图片的保存绝对路径(通常为 .jpg 或 .png)。如果不填,默认在基于 session 生成的特定输出目录下自动生成形如 {视频名}_last.jpeg,{视频名}_frame_100.jpeg 的文件。
--position(选填)要提取的帧位置。支持字符串 "first", "middle", "last",也支持传入整数(代表帧号)或浮点数(代表秒数)。默认为 "last"。
--quality(选填)当输出为 JPEG 格式时,指定图片保存质量(0-100),默认为 95。
--session-key(Optional; OpenClaw Required) 输出目录 session-key。CodeX/Claude Code 环境会自动识别,不需要传入内容;OpenClaw 环境必须运行 session_status 获取session-key并且传入, 格式通常为 agent:{agent_id}:{session_id}。

执行规范

  • 路径检查:确保传入的 --video_path 在本地确实存在。
  • 参数类型处理:脚本会自动处理 --position 参数的类型判断,Agent 只需要将用户的意图(如“第5秒”转化为 5.0,或“第100帧”转化为 100)以字符串形式传入即可。
  • 结果反馈:提取成功后,向用户汇报:"✅ 视频帧提取成功!已保存至:[输出路径]"。如果用户需要在聊天窗口查看,可以引导用户打开该文件。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Extract Video Frame AI skill do?

【视频抽帧工具】从指定的视频中提取特定位置的单帧画面并保存为图片。支持提取首帧(first)、中间帧(middle)、尾帧(last)、指定帧号(如 100)或指定秒数(如 2.5)。当用户要求从视频中截取画面、保存视频截图、提取某一帧图片时,必须立即调用此技能。

Why use Extract Video Frame on TypingMind?

Because you install it once and use it with any model. Extract Video Frame is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Extract Video Frame in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/JianhuiWei7/VideoWeaver/tree/main/skills/extract-video-frame. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Extract Video Frame?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Extract Video Frame?

As many as you like. As long as a model supports skills, you can use Extract Video Frame with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Extract Video Frame AI skill free?

It is published on GitHub by JianhuiWei7. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇