A video analysis tool that combines vision models like Llama's 11B vision model and Whisper to create a description by taking key frames, feeding them to the vision model to get details. It uses the details from each frame and the transcript, if available, to describe what's happening in the video.
The system operates in three stages:
Handles poor quality audio with confidence checks
Frame Analysis
Uses frame_analysis.txt prompt template
Video Reconstruction

git clone https://github.com/byjlw/video-analyzer.git
cd video-analyzer
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install . # For regular installation
# OR
pip install -e . # For development installation
bash
sudo apt-get update && sudo apt-get install -y ffmpegbash
brew install ffmpegbash
choco install ffmpegInstall Ollama following the instructions at ollama.ai
Pull the default vision model:
ollama pull llama3.2-vision
ollama serve
If you want to use OpenAI-compatible APIs (like OpenRouter or OpenAI) instead of Ollama:
Configure via command line: ```bash # For OpenRouter video-analyzer video.mp4 --client openai_api --api-key your-key --api-url https://openrouter.ai/api/v1 --model gpt-4o
# For OpenAI video-analyzer video.mp4 --client openai_api --api-key your-key --api-url https://api.openai.com/v1 --model gpt-4o ```
Or add to config/config.json:
json
{
"clients": {
"default": "openai_api",
"openai_api": {
"api_key": "your-api-key",
"api_url": "https://openrouter.ai/api/v1" # or https://api.openai.com/v1
}
}
}
Note: With OpenRouter, you can use llama 3.2 11b vision for free by adding :free to the model name
For detailed information about the project's design and implementation, including how to make changes, see docs/DESIGN.md.
For detailed usage instructions and all available options, see docs/USAGES.md.
# Local analysis with Ollama (default)
video-analyzer video.mp4
# Cloud analysis with OpenRouter
video-analyzer video.mp4 \
--client openai_api \
--api-key your-key \
--api-url https://openrouter.ai/api/v1 \
--model meta-llama/llama-3.2-11b-vision-instruct:free
# Analysis with custom prompt
video-analyzer video.mp4 \
--prompt "What activities are happening in this video?" \
--whisper-model large
The tool generates a JSON file (output\analysis.json) containing:
- Metadata about the analysis
- Audio transcript (if available)
- Frame-by-frame analysis
- Final video description
The video begins with a person with long blonde hair, wearing a pink t-shirt and yellow shorts, standing in front of a black plastic tub or container on wheels. The ground appears to be covered in wood chips.\n\nAs the video progresses, the person remains facing away from the camera, looking down at something inside the tub. ........
full sample output in docs/sample_analysis.json
The tool uses a cascading configuration system with command line arguments taking highest priority, followed by user config (config/config.json), and finally the default config. See docs/USAGES.md for detailed configuration options.
The prompts that drive frame analysis and video reconstruction can be automatically optimized for your specific content and use case using video-analyzer-tune.
pip install video-analyzer-tune
Run video-analyzer on a few representative videos, edit the outputs to show what ideal results look like, then let DSPy MIPROv2 find better prompt instructions automatically. The tuned prompts are written as new files you point to via your config — the main package is unaffected.
See video-analyzer-tune/README.md for full instructions.
To uninstall the package:
pip uninstall video-analyzer
Apache License
We welcome contributions! Please see docs/CONTRIBUTING.md for detailed guidelines on how to: - Review the project design - Propose changes through GitHub Discussions - Submit pull requests
$ claude mcp add video-analyzer \
-- python -m otcore.mcp_server <graph>