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.
-
Clone the Repository:
git clone https://github.com/byjlw/video-analyzer.git cd video-analyzer
-
Create and Activate a Virtual Environment:
python3 -m venv .venv source .venv/bin/activate # On Windows use: .venv\Scripts\activate
-
Install the Package:
- For standard use:
pip install .
- For development (changes to the code will be reflected immediately):
pip install -e .
- For standard use:
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.
3. Set Up a Local LLM with Ollama (Recommended)
For local analysis, you need to install and run Ollama.
-
Install Ollama: Follow the official instructions on ollama.ai.
-
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
-
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.
-
Install the UI package:
Alternatively, if you're inside thepip install ./video-analyzer-ui
video-analyzer-ui
directory:pip install .
-
Run the UI Server:
video-analyzer-ui
For more details on using the UI, see the Web UI Usage page.