Skip to content
/ vision Public

Extract frames from videos and analyze them using AI-powered image recognition.

License

Notifications You must be signed in to change notification settings

bdougie/vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VisionFrameAnalyzer πŸ“ΉπŸ–ΌοΈ

Extract frames from videos and analyze them using AI-powered image recognition.

πŸš€ Overview

VisionFrameAnalyzer is a Go-based tool that:
βœ… Extracts frames from a video at set intervals using ffmpeg
βœ… Uses an AI-powered vision model to analyze and describe each frame
βœ… Provides a structured pipeline for video-to-image processing

✨ Features

  • 🎞 Frame Extraction – Converts video frames into images
  • πŸ–Ό AI-Powered Analysis – Describes each frame using an LLM vision model
  • ⚑ Multi-Frame Processing – Handles multiple frames efficiently
  • πŸ“ Detailed Logging – Provides structured logs for debugging

πŸ›  Tech Stack

  • Go (Golang)
  • FFmpeg (Frame Extraction)
  • Ollama (LLM-powered image analysis)
  • Slog + Tint (Logging)
  • Kubernetes Ready (Optional Multi-Cluster Support)

πŸ“¦ Installation & Setup

Option 1: Local Installation

MacOS (Homebrew)

brew install ffmpeg
brew install ollama
go mod tidy

Option 2: Docker Installation

# Build the container
docker build -t vision-analyzer .

# Run the container
docker run -v $(pwd):/data vision-analyzer --video /data/input.mp4 --output /data/frames

πŸ”§ Configuration & Usage

Ollama Setup

  1. Ensure Ollama is running locally on port 11434
  2. The tool uses llama3.2-vision:11b model by default

Command Line Flags

  • --video: Path to input video file (required)
  • --output: Output directory for frames (default: "output_frames")

Basic Usage

# Basic usage
go run main.go --video path/to/video.mp4

# Specify custom output directory
go run main.go --video path/to/video.mp4 --output custom_output

# Show help
go run main.go --help

πŸ“‚ Output Structure

output_frames/
└── video_name/
    β”œβ”€β”€ frame_0001.jpg
    β”œβ”€β”€ frame_0002.jpg
    β”œβ”€β”€ analysis_results.json
    └── ...

Analysis Results Format

The analysis_results.json file contains frame-by-frame analysis:

[
  {
    "frame": "frame_0001.jpg",
    "content": "Detailed analysis of frame contents..."
  }
]

πŸ“Œ Use Cases

πŸ“½οΈ Automated Video Analysis – Extract insights from video feeds
πŸ” Content Moderation – Detect and describe images in video content
πŸ›  Machine Learning Pipelines – Pre-process video datasets for AI models

πŸ“œ License

MIT License. See LICENSE for details.

About

Extract frames from videos and analyze them using AI-powered image recognition.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published