Evo video keyframe extraction

From OpenLAIR/OpenSkill · View interactive version

Evo video keyframe extraction is an AI agent skill from the GitHub repository OpenLAIR/OpenSkill. Extracts keyframes from an MP4 video at uniform temporal intervals using OpenCV VideoCapture, saves them with sequential naming (keyframes_001.png, keyframes_002.png, etc.), and converts them in-place from BGR to grayscale.

How to use this skill

Skill file

evo-video-keyframe-extraction

Overview

Extracts keyframes from gameplay video using uniform temporal sampling, saves with zero-padded sequential naming, and converts to grayscale in-place.

Key Concepts

Functions

`get_video_metadata(video_path)`

Returns dict with: fps, frame_count, width, height, duration_seconds

`extract_keyframes(video_path, output_dir, sample_interval_seconds=1.0, name_format="keyframes_{:03d}.png")`

Extracts keyframes at uniform intervals. Returns list of saved file paths in timeline order.

`convert_frames_to_grayscale(frame_paths)`

Converts images to grayscale IN-PLACE (overwrites original files). Returns list of converted paths.

Reads with cv2.IMREAD_GRAYSCALE and writes back with cv2.imwrite.

Usage

import sys
sys.path.insert(0, '/app/environment/skills/evo-video-keyframe-extraction/scripts')
from video_utils import extract_keyframes, convert_frames_to_grayscale, get_video_metadata

# Get video info
meta = get_video_metadata('/root/super-mario.mp4')
print(f"Duration: {meta['duration_seconds']}s, FPS: {meta['fps']}")

# Extract keyframes (1 per second) to /root
paths = extract_keyframes('/root/super-mario.mp4', '/root', sample_interval_seconds=1.0)

# Convert to grayscale in-place
convert_frames_to_grayscale(paths)
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.