A Credit Frame Labeling & Training Tool for video analysis
Phase A of the VideoVault project — build the algorithm first, then the full metadata extraction app.
This project builds on and extends closing-credits-recognizer by Farbod Faghihi (© 2019), licensed under the MIT License.
The core idea — framing closing-credit detection as a binary image classification problem — originated from that project. We extend it with:
- A full interactive web-based frame labeling UI
- A configurable heuristic scorer (brightness, grayscale ratio, edge density, text line count)
- A training pipeline with model evaluation
- Session resumption and per-video progress tracking
- Timestamp hints from users to accelerate labeling
VideoAnalyzerAlgo is a training data collection and model building tool. The goal is to generate a lightweight, accurate classifier that can detect credit frames (opening titl cards and end credits) in movie and TV files — without relying on cloud API calls at runtime.
- Load a video file → the app reads it read-only and extracts frame metadata
- Label frames → use the web UI to classify each frame as End Credit / Opening Credit / Not Credit / Skip
- Provide timestamp hints → optionally tell the app where credits start/end to speed up labeling
- Train → use your labeled frames to train a Random Forest classifier
- Evaluate → review accuracy, F1 score, and confusion matrix
- Export → the trained model is saved to
./models/for use in Phase B (VideoVault)
⚠️ This application will NEVER:
- Modify any video file contents
- Delete any file
- Rename any file
It is a read-only analysis and labeling tool in Phase A. All file modification features (title/metadata writing, rename) are disabled by default and, when enabled in Phase B, always require explicit user confirmation with before/after preview.
- Python 3.11+
ffmpegon your system PATH (for video metadata)
run.batchmod +x run.sh
./run.shThe app will open at http://localhost:8765
python -m venv venv
# Windows:
venv\Scripts\activate
# Linux/macOS:
source venv/bin/activate
pip install -r requirements.txt
python run.pyVideoAnalyzerAlgo/
├── app/
│ ├── main.py # FastAPI entry point
│ ├── config.py # App configuration + safety rules
│ ├── core/
│ │ └── frame_extractor.py # OpenCV frame extraction + heuristic scoring
│ ├── db/
│ │ ├── models.py # SQLAlchemy models
│ │ └── crud.py # DB operations
│ ├── api/
│ │ ├── schemas.py # Pydantic schemas
│ │ ├── routes_library.py # Video and label API
│ │ ├── routes_training.py # Training pipeline API
│ │ └── routes_settings.py # Settings API
│ └── ui/
│ ├── templates/ # Jinja2 HTML pages
│ └── static/css/ # Dark-mode stylesheet
├── data/
│ └── videovault.db # SQLite — persists across updates
├── models/ # Trained model files (.pkl)
├── config.json # User configuration
├── requirements.txt
├── run.py # Main launcher
├── run.bat # Windows launcher
└── run.sh # Linux/macOS launcher
| Key | Action |
|---|---|
E |
Label as End Credit |
O |
Label as Opening Credit |
N |
Label as Not Credit |
S |
Skip frame |
→ |
Next frame |
← |
Previous frame |
MIT License. See LICENSE.
Original work by Farbod Faghihi — parallel-places/closing-credits-recognizer.