Evo video frame extraction

From OpenLAIR/OpenSkill · View interactive version

Evo video frame extraction is an AI agent skill from the GitHub repository OpenLAIR/OpenSkill. Extract and encode sampled frames from video files for vision AI analysis. Use when you need to process surveillance or other video files by extracting frames at regular intervals, converting them to base64-encoded JPEG images suitable for sending to vision LLM APIs. Handles video file discovery, te

How to use this skill

Skill file

Video Frame Extraction

Extracts sampled frames from video files using MoviePy 2.x and encodes them as base64 JPEG strings for downstream vision API consumption.

When to Use

Core Functions

The skill provides these functions in scripts/frame_extraction.py:

`discover_video_files(directory: str) -> list[str]`

Finds all video files (mp4, avi, mov, mkv) in a directory and returns them in deterministic sorted order.

`extract_sampled_frames(video_path: str, interval_seconds: float = 3.0, max_frames: int = 10) -> list[np.ndarray]`

Extracts frames from a video at the specified interval. Returns a list of RGB NumPy arrays. Properly closes MoviePy resources to prevent memory leaks.

`numpy_to_base64_jpeg(frame_array: np.ndarray, quality: int = 80, max_size: tuple = (1024, 1024)) -> str`

Converts a NumPy RGB array to a base64-encoded JPEG string. Resizes large frames to fit within max_size to reduce payload size.

`extract_and_encode_frames(video_path: str, interval_seconds: float = 3.0, max_frames: int = 10, jpeg_quality: int = 80) -> list[str]`

Convenience function that combines extraction and encoding. Returns a list of base64 JPEG strings ready for API consumption.

Usage Example

from scripts.frame_extraction import discover_video_files, extract_and_encode_frames

# Find all videos in a directory
videos = discover_video_files("/path/to/videos")

# Extract and encode frames from each video
for video_path in videos:
    b64_frames = extract_and_encode_frames(video_path, interval_seconds=3.0, max_frames=10)
    # Send b64_frames to a vision API...

Important Notes

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.