Installation Guide

This guide provides instructions for installing the Video Analyzer CLI tool, the optional Web UI, and all required dependencies and services.

System Requirements

Before you begin, ensure your system meets the following requirements:

  • Python: 3.11 or higher.
  • FFmpeg: Required for audio processing.
  • Hardware (for local LLM execution):
    • RAM: At least 16GB (32GB recommended).
    • GPU: At least 12GB of VRAM or an Apple M-series chip with at least 32GB of unified memory.

1. Install FFmpeg

FFmpeg is a critical dependency for extracting audio from video files.

  • Ubuntu/Debian:
sudo apt-get update && sudo apt-get install -y ffmpeg
  • macOS (using Homebrew):
brew install ffmpeg
  • Windows (using Chocolatey):
choco install ffmpeg

2. Install the Video Analyzer CLI Tool

We strongly recommend installing the tool within a Python virtual environment.

  1. Clone the Repository:

    git clone https://github.com/byjlw/video-analyzer.git
    cd video-analyzer
  2. Create and Activate a Virtual Environment:

    python3 -m venv .venv
    source .venv/bin/activate  # On Windows use: .venv\Scripts\activate
  3. Install the Package:

    • For standard use:
      pip install .
    • For development (changes to the code will be reflected immediately):
      pip install -e .

Dependencies

The installation will include the following key Python packages from requirements.txt:

  • opencv-python: For video processing and frame extraction.
  • numpy: For numerical operations.
  • torch: Required by Whisper models.
  • openai-whisper & faster-whisper: For audio transcription.
  • requests: For making API calls to LLM services.
  • Pillow: For image handling.
  • pydub: As a fallback for audio extraction.

For local analysis, you need to install and run Ollama.

  1. Install Ollama: Follow the official instructions on ollama.ai.

  2. Pull the Vision Model: The default model used by the analyzer is llama3.2-vision. Pull it from the Ollama library:

    ollama pull llama3.2-vision
  3. Start the Ollama Service: Before running the analyzer, ensure the Ollama service is running in the background. You can start it with:

    ollama serve

4. Install the Web UI (Optional)

The Web UI is a separate package that provides a user-friendly Flask-based interface for the CLI tool.

  1. Install the UI package:

    pip install ./video-analyzer-ui
    Alternatively, if you're inside the video-analyzer-ui directory: pip install .
  2. Run the UI Server:

    video-analyzer-ui

For more details on using the UI, see the Web UI Usage page.