Video keyframe extraction
Extract key frames (I-frames) from video files using FFmpeg. Use this skill when the user needs to pull out keyframes from MP4, MKV, AVI, or other video formats for analysis or processing.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill video-keyframe-extractionAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.2 KB, 264 tokens by cl100k_base, as published. Nobody here has run it
Video Keyframe Extraction
Extract I-frames (keyframes) from video files using FFmpeg's select filter.
Command
ffmpeg -i <input_video> -vf "select=eq(pict_type\,I)" -vsync vfr <output_pattern>
-vf "select=eq(pict_type\,I)"selects only I-frames (intra-coded frames, the "key" frames in video compression)-vsync vfruses variable frame rate to avoid duplicating frames- Output pattern uses
%03dfor sequential numbering: e.g.,keyframes_%03d.png
Example
ffmpeg -i /root/video.mp4 -vf "select=eq(pict_type\,I)" -vsync vfr /root/keyframes_%03d.png
This produces /root/keyframes_001.png, /root/keyframes_002.png, etc., one per I-frame in timeline order.
Notes
- I-frames are complete images (not predicted from other frames), making them ideal for analysis
- The number of keyframes depends on the video's encoding settings (typically every 1-2 seconds)
- Output is in timeline order by default
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.