I built a pipeline that turns a topic into a 20-30 minute documentary
Description and use
AI Video Factory automates the creation of a 20‑30 minute documentary from a topic, handling research, script, visuals, TTS narration, music, captions, FFmpeg assembly, QC, and YouTube metadata, with citation verification and runtime tuning.
Problem
Creating a full-length documentary from a single topic quickly and reliably requires automating research, scriptwriting, visual sourcing, narration, music, captions, and video assembly while ensuring quality and consistency.
Outcome
The pipeline produces a near‑ready 20‑30 minute documentary with verified citations, consistent runtime, high‑quality visuals, and professional audio, while caching intermediate stages for rapid iteration.
Workflow
- 1. Input a topic string
- 2. Research topic and generate a script with citations
- 3. Verify each cited URL via HTTP 200 check
- 4. Write script in timed beats to meet target runtime
- 5. Pull per‑scene visuals from Pexels, Pixabay, NASA, or generate local stills
- 6. Narrate script using local TTS
- 7. Lay down a music bed and add karaoke captions
- 8. Assemble video, audio, captions, and transitions with FFmpeg
- 9. Run QC gate to detect dark frames, silence, or wrong resolution
- 10. Output final video, thumbnail, and YouTube metadata
Evidence
You give it a topic. It researches the topic, writes a script with citations, pulls per-scene visuals from Pexels/Pixabay/NASA, narrates it with local TTS, lays down a music bed, burns in karaoke captions, assembles everything in FFmpeg, runs a QC gate, and outputs a thumbnail plus YouTube metadata.
LLM-written scripts invent citations that look completely legit. The first scripts came back with references that sounded real but pointed nowhere. Now every cited URL gets a real HTTP check against a 200 response.
A "25 minute" video kept coming out at 14 minutes. Runtime drift is a real problem with generated scripts. Scripts are now written in timed beats, and underweight beats get extended at roughly 150 wpm until the target runtime holds.
Real stock footage beats AI visuals for most scenes. This one honestly surprised me. AI-generated visuals look impressive frame by frame but feel off across a 20-minute runtime.
- Record date: 2026-09-22T07:30:35.664Z