# Clone or navigate to the project
cd VideoCraft1
# Run the setup script
python setup.py --setup
# Start the backend
python setup.py --backend
# In another terminal, start the frontend
python setup.py --frontend# Install Python dependencies
pip install -r requirements.txt
# Navigate to backend directory
cd backend
# Start the FastAPI server
uvicorn main:app --host 0.0.0.0 --port 8000 --reload# Navigate to frontend directory
cd frontend
# Install Node.js dependencies
npm install
# Start the React development server
npm start# Start all services
docker-compose up --build
# Start only backend and database
docker-compose up backend db redis
# Start in background
docker-compose up -d# Start with production profile
docker-compose --profile production up -dVideoCraft1/
βββ backend/ # FastAPI Backend
β βββ main.py # Application entry point
β βββ app/
β β βββ core/ # Core configuration
β β βββ api/ # API endpoints
β β βββ models/ # Data models
β β βββ services/ # Business logic
β β βββ utils/ # Utilities
β βββ requirements.txt # Python dependencies
βββ frontend/ # React Frontend
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ utils/ # Utilities
β βββ package.json # Node.js dependencies
βββ uploads/ # Uploaded files
βββ processed/ # Processed videos
βββ temp/ # Temporary files
βββ logs/ # Application logs
βββ models_cache/ # AI models cache
βββ static/ # Static assets
- Object Detection: DETR model for detecting objects in video frames
- Scene Classification: Image classification for scene understanding
- Quality Assessment: Video quality metrics and analysis
- Scene Change Detection: Automatic detection of scene transitions
- Facial Emotions: Real-time facial emotion recognition
- Audio Sentiment: Speech emotion analysis
- Text Sentiment: Script and subtitle emotion analysis
- Multi-modal Fusion: Combined emotion insights
- Speech Recognition: Whisper for accurate transcription
- Audio Enhancement: Noise reduction and quality improvement
- Feature Extraction: Audio characteristics analysis
- Silence Detection: Automatic silence removal
- AI Segmentation: rembg and MediaPipe for background removal
- Background Replacement: Custom background options
- Real-time Processing: Fast processing for video frames
- Mood Analysis: AI-driven mood detection from content
- Music Matching: Intelligent music recommendation
- Tempo Synchronization: Beat matching with video rhythm
- API Development: Create new endpoints in
backend/app/api/ - Model Integration: Add AI models in respective service files
- Testing: Use FastAPI's automatic documentation at
/api/docs - Logging: Comprehensive logging configured in
logging_config.py
- Component Creation: Build reusable components in
frontend/src/components/ - Page Development: Create pages in
frontend/src/pages/ - API Integration: Use services in
frontend/src/services/ - Styling: Material-UI components and custom CSS
- HuggingFace Models: Download and cache models automatically
- Custom Models: Add custom models in appropriate service files
- GPU Support: Configure GPU usage in environment variables
- Model Optimization: Use quantization and optimization techniques
Create a .env file in the project root:
# Application
DEBUG=True
HOST=0.0.0.0
PORT=8000
# File Upload
MAX_UPLOAD_SIZE=524288000 # 500MB
# AI Models
USE_GPU=False
HF_CACHE_DIR=./models_cache
# API Keys (Optional)
OPENAI_API_KEY=your_openai_key
HUGGINGFACE_API_KEY=your_hf_key
# Database
DATABASE_URL=sqlite:///./videocraft.db
# Security
SECRET_KEY=your-secret-keyModels are automatically downloaded and cached. Configure in config.py:
# Video Analysis Models
VIDEO_ANALYSIS_MODEL = "facebook/detr-resnet-50"
SCENE_CLASSIFICATION_MODEL = "google/vit-base-patch16-224"
# Emotion Models
FACIAL_EMOTION_MODEL = "j-hartmann/emotion-english-distilroberta-base"
AUDIO_EMOTION_MODEL = "ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition"
# Audio Models
SPEECH_RECOGNITION_MODEL = "openai/whisper-base"cd backend
pytest tests/cd frontend
npm test- Use the interactive documentation at
http://localhost:8000/api/docs - Test endpoints with curl or Postman
- Check logs in the
logs/directory
# Build and run with Docker
docker-compose --profile production up -d- AWS/GCP/Azure: Use container services
- Heroku: Deploy with buildpacks
- DigitalOcean: Use App Platform or Droplets
- Kubernetes: Use provided Kubernetes manifests
- GPU Support: Enable GPU for AI models
- Caching: Use Redis for model and result caching
- CDN: Serve static assets via CDN
- Load Balancing: Use multiple backend instances
- Logs: Structured logging with rotation
- Health Checks: Built-in health check endpoints
- Metrics: Performance and usage metrics
- Model Loading Time: Monitor model initialization
- Inference Speed: Track processing times
- Resource Usage: Monitor CPU/GPU/Memory usage
- CORS: Configured for frontend domain
- Rate Limiting: Prevent API abuse
- File Validation: Strict file type checking
- Size Limits: Configurable upload limits
- Temporary Storage: Files cleaned up after processing
- No Data Retention: Files deleted after processing
- Secure Upload: Validated file uploads
- Access Control: Future user authentication
# Check Python version
python --version # Should be 3.8+
# Check dependencies
pip install -r requirements.txt
# Check port availability
netstat -an | grep 8000# Check Node.js version
node --version # Should be 14+
# Clear npm cache
npm cache clean --force
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install# Check HuggingFace cache directory
ls -la models_cache/
# Clear model cache
rm -rf models_cache/
# Models will re-download on next startup
# Check internet connection for model downloads
ping huggingface.co# Install FFmpeg
# Windows: Download from https://ffmpeg.org/
# macOS: brew install ffmpeg
# Linux: sudo apt-get install ffmpeg
# Check FFmpeg installation
ffmpeg -versionEnable debug mode for detailed error information:
DEBUG=True
LOG_LEVEL=DEBUG- Memory Usage: Monitor RAM usage during video processing
- GPU Memory: Check GPU memory for AI models
- Disk Space: Ensure sufficient space for uploads and processing
- Network: Check bandwidth for model downloads
POST /api/upload/video- Upload video filesPOST /api/upload/audio- Upload audio files
POST /api/analyze/video- Comprehensive video analysisPOST /api/emotion/video- Emotion detection in videoPOST /api/emotion/audio- Audio emotion analysisPOST /api/audio/analyze- Audio processing and transcription
POST /api/background/remove- Background removalPOST /api/music/recommend- Music recommendationPOST /api/edit/trim- Video trimmingPOST /api/edit/merge- Video merging
GET /api/health- Health checkGET /api/supported-formats- Supported file formats
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- HuggingFace: For pre-trained AI models
- FastAPI: For the high-performance backend framework
- React: For the modern frontend framework
- OpenCV: For computer vision capabilities
- MoviePy: For video processing
- Whisper: For speech recognition
For support and questions:
- Check the Issues page
- Read the documentation
- Join our community discussions
Happy Coding! π¬β¨