Skip to main content

Build & Setup Guide

Complete guide for building, installing, and setting up the Video-to-Knowledge Pipeline.


Quick Start (One Command)

# Clone or navigate to project directory
cd video_analysis_pipeline

# Run interactive build
python build.py

This will:

  1. ✅ Check system requirements
  2. 📦 Install dependencies (with virtual environment)
  3. 📥 Download Whisper models
  4. 🔑 Configure API keys
  5. 🚀 Create launcher script

Option 2: Makefile

# Using make
make install

# Or specific targets
make check # Check requirements
make quick # Quick setup
make models # Download models

Option 3: One-line Installer

# Using curl (when published)
curl -sSL https://your-domain.com/install.sh | bash

# Or local install script
./install.sh

Manual Setup

Step 1: Prerequisites

Required:

  • Python 3.9 or higher
  • FFmpeg

macOS:

brew install python ffmpeg

Ubuntu/Debian:

sudo apt update
sudo apt install python3 python3-pip python3-venv ffmpeg

Windows:

  • Install Python from python.org
  • Install FFmpeg and add to PATH

Step 2: Install Dependencies

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements-local.txt

# Install package in development mode
pip install -e .

Step 3: Download Whisper Models

# Interactive model manager
python -m src.model_manager

# Or download specific model
python -m src.pipeline models --download small

Step 4: Configure API Keys

Option A: Environment Variables

# Add to ~/.bashrc or ~/.zshrc
export KIMI_API_KEY="your-kimi-key"
export ANTHROPIC_API_KEY="your-claude-key" # Optional alternative
export OPENAI_API_KEY="your-openai-key" # Optional for API transcription

Option B: Interactive Setup

python build.py
# Follow prompts to enter API keys

Build Commands

Python Build Script

# Full interactive setup
python build.py

# Quick setup with defaults
python build.py --quick

# Check system only
python build.py --check

# Clean build artifacts
python build.py --clean

# Download specific models
python build.py --models small medium

Makefile Targets

CommandDescription
make installFull interactive installation
make quickQuick setup with defaults
make checkCheck system requirements
make modelsDownload Whisper models
make cleanClean build artifacts
make runRun interactive mode
make testRun tests
make lintRun linters

Configuration

Configuration File

Location: ~/.config/video-pipeline/config.json

Generated automatically during setup. Edit manually or use:

# View current config
vp config

# Or interactive setup
vp quickstart

Environment Variables

VariablePurposeRequired
KIMI_API_KEYKimi Vision APIYes (or Claude)
MOONSHOT_API_KEYAlternative Kimi keyOptional
ANTHROPIC_API_KEYClaude Vision APIAlternative
OPENAI_API_KEYOpenAI Whisper/LLMOptional
SERPER_API_KEYWeb searchOptional

Whisper Model Selection

Models are downloaded to: ~/.cache/whisper/

ModelSizeRAMSpeedCommand
tiny39M0.5GB32xvp models --download tiny
base74M1GB16xvp models --download base
small244M2GB6xvp models --download small
medium769M5GB2xvp models --download medium
large-v31550M10GB1xvp models --download large-v3

Post-Installation

Verify Installation

# Check all components
vp --help

# Check models
vp models

# Run interactive mode
vp

First Video Processing

# Quick process
vp process "https://youtube.com/watch?v=..."

# With specific model
vp process "video.mp4" --whisper-model small

# Generate deck
vp process "video.mp4" --deck

# Interactive mode (guided)
vp

Troubleshooting

FFmpeg Not Found

# macOS
brew install ffmpeg

# Ubuntu/Debian
sudo apt install ffmpeg

# Verify
ffmpeg -version

CUDA/GPU Not Available

# Install PyTorch with CUDA (optional)
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

# Or use CPU (slower but works)
# Whisper will automatically use CPU if CUDA unavailable

Model Download Fails

# Manual download
python -c "import whisper; whisper.load_model('small')"

# Check cache
ls -la ~/.cache/whisper/

API Key Issues

# Check if set
echo $KIMI_API_KEY

# Set temporarily
export KIMI_API_KEY="your-key"
vp process "video.mp4"

# Set permanently (add to ~/.bashrc)
echo 'export KIMI_API_KEY="your-key"' >> ~/.bashrc
source ~/.bashrc

Development Setup

# Clone repository
git clone <repository-url>
cd video_analysis_pipeline

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install dev dependencies
pip install -r requirements-local.txt
pip install -e ".[dev]"

# Run checks
make check
make test
make lint

# Start development
make dev

Uninstallation

# Clean build artifacts
make clean

# Remove virtual environment
rm -rf .venv

# Remove config and cache
rm -rf ~/.config/video-pipeline
rm -rf ~/.cache/whisper

# Remove installed package
pip uninstall video-to-knowledge-pipeline

System Requirements

ComponentMinimumRecommended
Python3.93.11+
RAM4GB8GB+
Disk5GB20GB+
CPU2 cores4+ cores
GPUOptionalCUDA-enabled
OSLinux/macOS/WindowsLinux/macOS

Getting Help

# General help
vp --help

# Command help
vp process --help
vp models --help

# Interactive help
vp
# Then select "Help" option

For more information, see README.md and PROJECT_SUMMARY.md