An advanced Python application that automatically creates a complete video story from a single topic. It supports multiple content sources, AI-generated text and images, natural-sounding voiceovers, subtitles, and background music — all combined into a polished final video.
-
Multiple Content Sources Create videos from:
- Wikipedia pages
- Custom topics written by Gemini
- Your own text
-
Flexible Video Formats
- YouTube Shorts (9:16 vertical)
- Long Videos (16:9 horizontal)
-
AI-Powered Production
- Text & Summarization (Gemini): Transforms content into a fluent voiceover script.
- Image Generation (Gemini): Creates custom, context-aware images for each scene.
- Natural Voiceover (OpenAI TTS): High-quality, human-like narration.
- Multi-Language Support: Auto-generates multiple language versions with synchronized
.srtsubtitles.
-
Intelligent Music Selection Detects story atmosphere and picks the most fitting track from your
musicfolder. -
Post-Production Tools
- Automatic Turkish Dubbing for existing videos.
- Centralized configuration with
config.json.
Automatic-Story-Video-Generator/
│
├── main.py # Entry point, orchestrates the workflow
├── config_handler.py # Handles config.json creation & updates
├── ui_handler.py # User interface interactions (menus, inputs)
├── content_handler.py # Fetches text (Wikipedia, Gemini, custom)
├── get_wikipedia.py # Wikipedia content fetcher with fallback
├── summarize_gemini.py # Summarization, translation, and script writing
├── image_handler.py # Image prompt generation & creation
├── text_to_speech_openai.py # Voiceover generation (OpenAI TTS)
├── video_creator.py # Combines audio, visuals & subtitles
├── dubber.py # Turkish dubbing for existing videos
├── music_adder.py # Intelligent background music adder
├── music/ # Folder containing .mp3/.wav background tracks
├── requirements.txt # Project dependencies
└── README.md # Documentation
Create Virtual Environment (recommended):
python -m venv venv
source venv/bin/activate # macOS/Linux
.\venv\Scripts\activate # WindowsInstall Dependencies:
pip install -r requirements.txt-
.env File Create a
.envfile in the project root with your API keys:GEMINI_API_KEY="AIzaSy..." OPENAI_API_KEY="sk-..."
-
Music Folder Add
.mp3or.wavfiles into amusic/folder. -
Config File On the first run, a
config.jsonwill be generated automatically. Edit it to adjust settings (output folders, model names, voices, etc.).
Run the program with:
python main.pyFollow the on-screen menus to create your story video.
- Works with multiple languages.
- Supports both short-form and long-form video creation.
- Easily extensible for new AI models and video formats.
This project is for educational and personal use. Please check licenses of APIs, images, and music before distributing generated content.