Vitor Chagas
Vitor Chagas
Data & DevOps Engineer
Project screenshot

AI Video Frame

Year

2024

Stack
Python FFmpeg OpenCV
Contributions
Backend CLI Algorithm
Links

Overview

ai-video-frame is a tool for extracting meaningful frames from video files using AI-powered scene change detection.

Instead of dumping every N-th frame, ai-video-frame analyzes the video stream and picks frames at semantically significant moments — scene cuts, motion peaks, and visual changes.

What it does

  • Scene-change detection via perceptual hashing
  • Configurable sensitivity threshold
  • Outputs as JPEG/PNG with timestamps in filenames
  • CLI and Python API

Usage

ai-video-frame extract input.mp4 --output ./frames --threshold 0.3

Configuration

OptionDefaultDescription
--threshold0.3Scene change sensitivity (0–1)
--formatjpegOutput format (jpeg or png)
--max-framesunlimitedCap on extracted frames

How it works

  1. Decode video with FFmpeg
  2. Compute perceptual hash (pHash) for each frame
  3. Compare consecutive hashes — flag frames above threshold as scene boundaries
  4. Write flagged frames to disk
Share