Agent skill

ffmpeg-keyframe-extraction

Extract key frames (I-frames) from video files using FFmpeg command line tool. Use this skill when the user needs to pull out keyframes, thumbnails, or important frames from MP4, MKV, AVI, or other video formats for analysis, previews, or processing.

Stars 897
Forks 232

Install this agent skill to your Project

npx add-skill https://github.com/benchflow-ai/skillsbench/tree/main/tasks/mario-coin-counting/environment/skills/ffmpeg

SKILL.md

FFmpeg Keyframe Extraction

Extract key frames (I-frames) from video files using FFmpeg CLI.

Prerequisites

  • FFmpeg installed and available in PATH
  • Input video file (MP4, MKV, AVI, MOV, etc.)

Methods

Method 1: Select Filter (More Control)

bash
ffmpeg -i <input_video> -vf "select='eq(pict_type,I)'" -vsync vfr <output_pattern>
Method 2: Skip Frame (Faster)

ffmpeg -skip_frame nokey -i <input_video> -vsync vfr <output_pattern>
Key Options
Option	Description
-i <file>	Input video file
-vf "select='eq(pict_type,I)'"	Filter selecting only I-frames
-skip_frame nokey	Skip decoding non-keyframes (performance)
-vsync vfr	Variable frame rate, prevents duplicates
-q:v <n>	Quality (1-31, lower = better, for JPEG)
-frame_pts 1	Use presentation timestamp in filename
Output Patterns
frame_%03d.png - PNG sequence (frame_001.png, frame_002.png...)
frame_%03d.jpg - JPEG sequence
frame_%d.bmp - BMP sequence
Examples
Basic PNG extraction:

ffmpeg -i video.mp4 -vf "select='eq(pict_type,I)'" -vsync vfr keyframe_%03d.png High-quality JPEG:


ffmpeg -i video.mp4 -skip_frame nokey -vsync vfr -q:v 2 keyframe_%03d.jpg With timestamps:


ffmpeg -i video.mp4 -vf "select='eq(pict_type,I)'" -vsync vfr -frame_pts 1 keyframe_%d.png


To specific directory:

ffmpeg -i video.mp4 -vf "select='eq(pict_type,I)'" -vsync vfr ./output/keyframe_%03d.png


## Notes
Method 2 (-skip_frame nokey) is faster as it skips decoding non-keyframes
Method 1 offers more filtering flexibility (can combine with other filters)
Keyframe frequency depends on video encoding settings
Use -vsync vfr to avoid duplicate frames in output

Expand your agent's capabilities with these related and highly-rated skills.

benchflow-ai/skillsbench

csv-processing

Use this skill when reading sensor data from CSV files, writing simulation results to CSV, processing time-series data with pandas, or handling missing values in datasets.

897 232
Explore
benchflow-ai/skillsbench

pid-controller

Use this skill when implementing PID control loops for adaptive cruise control, vehicle speed regulation, throttle/brake management, or any feedback control system requiring proportional-integral-derivative control.

897 232
Explore
benchflow-ai/skillsbench

yaml-config

Use this skill when reading or writing YAML configuration files, loading vehicle parameters, or handling config file parsing with proper error handling.

897 232
Explore
benchflow-ai/skillsbench

simulation-metrics

Use this skill when calculating control system performance metrics such as rise time, overshoot percentage, steady-state error, or settling time for evaluating simulation results.

897 232
Explore
benchflow-ai/skillsbench

vehicle-dynamics

Use this skill when simulating vehicle motion, calculating safe following distances, time-to-collision, speed/position updates, or implementing vehicle state machines for cruise control modes.

897 232
Explore
benchflow-ai/skillsbench

web-interface-guidelines

Vercel's comprehensive UI guidelines for building accessible, performant web interfaces. Use this skill when reviewing or building UI components for compliance with best practices around accessibility, performance, animations, and visual stability.

897 232
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results