--- title: AI Video Editor V2 emoji: 🤖 colorFrom: purple colorTo: blue sdk: docker pinned: false license: mit --- # 🤖 AI Video Editor V2 Transform any reference reel into your personalized video using AI-powered code generation. ## 🎬 How It Works 1. **Upload** your reference video and photos 2. **AI Analysis** - Gemini analyzes video structure, transitions, and timing 3. **Generate** - Review each 3-second segment with human-in-the-loop 4. **Download** - Get your final professional video ## 🔑 Getting Started ### 1. Get Your Free Gemini API Key Visit: [https://aistudio.google.com/apikey](https://aistudio.google.com/apikey) **Free Tier Limits:** - ✅ 10 requests/minute - ✅ 250 requests/day - ✅ 250K tokens/minute - ✅ Completely FREE - No credit card required ### 2. Use the App 1. Enter your API key in the sidebar 2. Upload a reference video (10-60 seconds) 3. Upload 5-20 photos 4. Let AI analyze and generate segments 5. Approve or regenerate each segment 6. Download your final video ## ✨ Features - 🎥 **Video Analysis**: AI understands transitions, effects, timing - 🤖 **Code Generation**: Gemini writes MoviePy code for each segment - 👤 **Human-in-the-Loop**: Review and approve each 3-second segment - 🔄 **Iterative Refinement**: Provide feedback to regenerate - 📹 **Professional Output**: 1080x1920 (9:16) portrait videos ## 🛠️ Tech Stack - **Frontend**: Streamlit - **AI Model**: Google Gemini 2.5 Flash - **Video Processing**: MoviePy - **Image Processing**: Pillow, OpenCV ## 📊 API Usage With 250 requests/day on free tier: - Video analysis: ~5-10 requests - Segment generation: ~20-30 segments - Regenerations: ~10-15 retries - **Total: ~50-70 requests per video** - **Can create 3-4 complete videos per day** ## 💡 Tips - Use high-quality photos (1080x1920 ideal) - Keep reference videos under 60 seconds - Provide specific feedback for better regenerations - Approve segments progressively to save API calls ## 🔒 Privacy - Your API key is never stored - All processing happens in your session - Files are temporary and auto-deleted ## 📝 License MIT License - Free to use and modify! ## 🤝 Support Having issues? Check that: - Your API key is valid - Reference video is under 100MB - Photos are in JPG/PNG format - You're within the free tier limits ## 📦 File Structure ``` velocity-video-editor-v2/ ├── app.py # Main Streamlit application ├── ai_video_analyzer.py # Video analysis with Gemini ├── code_generator.py # AI code generation ├── video_executor.py # Safe code execution ├── requirements.txt # Python dependencies ├── Dockerfile # Container configuration ├── README.md # This file └── .streamlit/ └── config.toml # Streamlit configuration ``` ## 🚀 Local Development ```bash # Install dependencies pip install -r requirements.txt # Run the app streamlit run app.py # Open browser at http://localhost:8501 ``` ## 🐳 Docker Deployment ```bash # Build Docker image docker build -t ai-video-editor . # Run container docker run -p 7860:7860 ai-video-editor ``` ## 🌐 Hugging Face Spaces Deployment 1. Create new Space with Docker SDK 2. Upload all files 3. HF automatically builds and deploys 4. Share with users! --- Made with ❤️ using Gemini 2.5 Flash **Creator**: PPV Productions **Version**: 2.0 **Last Updated**: February 2026