Overview
The AI Video Presentation Generator requires proper configuration of environment variables and directory structure to function correctly. This guide covers all necessary setup steps for both backend and frontend.Environment Variables
All environment variables should be configured in a.env file located in the backend/ directory.
Required API Keys
Google Gemini API key for AI-powered content generation. Used by the ContentGenerator and ScriptGenerator to create presentation content and narration scripts.See API Keys for setup instructions.
Sarvam AI API key for multi-language text-to-speech voice generation. Required for generating audio narration in supported languages.See API Keys for setup instructions.
Unsplash API access key for fetching high-quality images for presentation slides. Used when slides require visual content.See API Keys for setup instructions.
TTS Configuration
Sarvam AI text-to-speech API endpoint URL. Typically does not need to be changed.
Sarvam AI TTS model version. Valid options:
bulbul:v2(recommended, stable)bulbul:v3-beta(latest features, may be unstable)
Server Configuration
Backend server host address. Use
0.0.0.0 to allow connections from any network interface.Backend server port number. Default is 8000 for FastAPI.
Directory Structure
The backend automatically creates the following directory structure inbackend/outputs/:
Output Directories
config.py:25-26.
Configuration File Setup
Step 1: Create .env File
Create a.env file in the backend/ directory:
Step 2: Configure Variables
Edit the.env file with your API keys:
Backend Configuration
The backend configuration is managed byconfig.py which loads environment variables and sets up paths:
Model Configuration
- Gemini Model:
gemini-2.5-flash(configured inconfig.py:29) - Manim Quality:
m(medium quality, can bel/m/h) - Manim FPS: 30 frames per second
Language-Speaker Mapping
The system maps supported languages to Sarvam AI voice speakers:| Language | Speaker | Voice Type |
|---|---|---|
| English | anushka | Indian English Female |
| Hindi | manisha | Hindi Female |
| Kannada | vidya | Kannada Female |
| Telugu | arya | Telugu Female |
Frontend Configuration
The frontend connects to the backend API server. Default configuration:- Frontend URL:
http://localhost:5173 - Backend URL:
http://localhost:8000 - CORS: Enabled for localhost development
CORS Settings
The backend allows CORS requests from:http://localhost:5173http://127.0.0.1:5173
app.py:29.
System Requirements
Required Software
- Python 3.8+ - Backend runtime
- FFmpeg - Video processing and composition
- Manim - Mathematical animation engine
- Node.js 16+ - Frontend development server
Installing FFmpeg
- Windows
- macOS
- Linux
- Download from ffmpeg.org
- Extract the archive
- Add
ffmpeg/binto System PATH - Verify:
ffmpeg -version
Installing Manim
Verification
After configuration, verify your setup:Check Environment Variables
Check Directory Structure
Test Backend Server
http://localhost:8000/health - you should see {"status": "healthy"}.
Troubleshooting
API Key Not Loading
API Key Not Loading
- Verify
.envfile is in thebackend/directory - Check for typos in variable names
- Ensure no extra spaces around the
=sign - Restart the backend server after changes
FFmpeg Not Found
FFmpeg Not Found
- Verify FFmpeg is installed:
ffmpeg -version - On Windows, ensure FFmpeg is added to System PATH
- Restart terminal after PATH changes
Directory Permission Errors
Directory Permission Errors
- Ensure write permissions for
backend/outputs/ - On Linux/macOS:
chmod -R 755 backend/outputs/
CORS Errors
CORS Errors
- Check frontend is running on
localhost:5173 - Add your frontend URL to CORS settings in
app.py - Clear browser cache and restart both servers
Next Steps
Configure API Keys
Learn how to obtain and configure API keys for all services
Language Options
Explore supported languages and voice customization