🎓 Lecture Video Maker
An AI-powered tool that converts any topic into a full lecture video with voiceover, stock visuals, and subtitles — all from a beautiful web UI or the terminal.
✨ Features
- AI Script Generation — Uses your local Ollama model to write a multi-segment lecture script
- Natural Voiceover — Microsoft Edge-TTS synthesizes speech (no API costs)
- Stock Visuals — Automatically fetches relevant videos and images from Pexels
- Subtitle Bar — Pillow renders animated subtitle overlays (no libass needed)
- Web UI — Full browser-based interface with live progress tracking and video preview
- CLI Mode — Fully interactive terminal alternative
📋 Requirements
System
- Python 3.8+
- FFmpeg (must be in PATH)
- Ollama running locally with at least one model pulled
Python Packages
pip install edge-tts requests pillow numpy
🚀 Quick Start
1. Clone the repo
git clone https://github.com/YOUR_USERNAME/lecture-video-maker.git
cd lecture-video-maker
2. Install Python dependencies
pip install edge-tts requests pillow numpy
3. Start Ollama and pull a model
ollama serve # in a separate terminal
ollama pull llama3 # or mistral, gemma2, etc.
4. Get a free Pexels API key
Sign up at https://www.pexels.com/api/ — it's free.
5. Launch the Web UI
python lecture_gen.py
Opens automatically at http://localhost:8080
Or use CLI mode
python lecture_gen.py --cli
🖥️ Web UI Walkthrough
- Settings Card — Enter your Pexels API key, Ollama URL, and select a voice
- Topic & Parameters — Set your lecture topic, choose duration and media preference
- Edit Script — Review/edit the AI-generated narration per segment before rendering
- Render — Watch live progress with log output
- Download — Preview and download the final
.mp4
📁 Output Structure
lecture_output/
├── _.mp4 ← final lecture video
└── /
├── script.txt ← full generated script
├── audio/seg_00.mp3 … ← TTS audio per segment
├── media/visual_00.mp4 … ← downloaded Pexels media
├── subs/seg_00/frame_*.png ← subtitle frames
└── segments/se