ViralShortsAI is an end-to-end automated video generation pipeline designed to create engaging, TikTok-style viral short videos using AI. The project leverages LLMs and audio/video processing techniques to automate content creation for your marketing needs.
ViralShortsAI now includes powerful autonomous features:
- One-Shot Video Generation: Provide a marketing prompt, and the system will automatically generate a complete video
- Continuous Content Generation: Set up automatic video production on a schedule
- Smart Media Analysis: AI-powered analysis of your images and videos to select the best content
- Contextual B-Roll: Automatically selects and inserts B-roll clips that enhance your message
- Dynamic Voiceovers: Generates natural-sounding voiceovers from your marketing context
- Fault Tolerance: Robust error handling ensures the system keeps working even when components fail
- Add your media: Place photos and videos in the
mediadirectory - Set your context: Update
context/marketing.mdwith your marketing message - Run the app: Start the Streamlit app and provide a prompt
- Get results: The system creates a polished video with captions, B-roll, and voiceover
Media Analysis & Enhancement:
- Automatically analyzes images and videos using AI
- Suggests appropriate B-roll and visual enhancements
- Generates voiceovers using ElevenLabs or fallback TTS services
Intelligent Video Editing:
- Detects and trims silence
- Applies dynamic zoom effects based on content
- Inserts B-roll at optimal moments
- Adds captions using Whisper and Remotion
Autonomous Operation:
- Continuous generation mode for ongoing content production
- Progress tracking and status reporting
- Comprehensive error handling and fallback options
- Production logging and history
# Clone the repository
git clone https://github.com/yourusername/ViralShortAI.git
cd ViralShortAI
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install Python dependencies
pip install -r requirements.txt
# Install Node.js dependencies
cd js-scripts
npm install
cd ..Create a .env file in the project root with your API keys:
OPENAI_API_KEY=your_openai_api_key
ELEVEN_LABS_API_KEY=your_elevenlabs_api_key
Ensure you have the following directory structure for your media:
media/
├── videos/ # Place your main video files here
├── images/ # Images for B-roll
├── subs/ # Subtitle files (auto-generated)
├── audio/ # Audio clips (optional)
└── screen_recordings/ # Screen recordings (optional)
streamlit run app.py- Enter your marketing prompt in the text area
- Click "Generate Content Now"
- The system will:
- Update your marketing context based on your prompt
- Analyze all media files
- Generate B-roll suggestions
- Create a voiceover
- Process videos with captions and effects
- Present the final video
- Enter your marketing prompt
- Adjust the content generation interval (hours)
- Click "Start Continuous Generation"
- The system will automatically create new videos at the specified interval
- View the "Recent Productions" section to see generated videos
The final videos are saved in the js-scripts/public directory and can be viewed directly in the Streamlit app or using any video player.
Edit context/marketing.md to change the base marketing message. This file contains the foundational information about your product or service.
- Add your own videos to
media/videos/ - Add images for B-roll to
media/images/ - The system will automatically analyze and incorporate these files
- API Key Issues: Ensure your API keys are correctly set in the
.envfile - Missing Media: Make sure you have videos in the
media/videos/directory - Node.js Errors: Check that you have installed Node.js and the required dependencies
- FFmpeg Issues: Ensure FFmpeg is installed on your system for video processing
- moviepy, opencv-python, pillow, streamlit, openai, pydantic, elevenlabs, etc.
- remotion and related packages for video rendering
- chokidar for file watching
- FFmpeg for media processing
Contributions are welcome! Please feel free to submit a Pull Request.
Happy video creation with ViralShortsAI! 🎬✨