Universal Video Scraper & AI Analysis Platform
https://github.com/sreejagatab/videoprocessing
Universal Video Scraper & AI Analysis Platform
A comprehensive, production-ready web application that automatically scrapes, downloads, processes, and performs AI-powered analysis on videos from any target URL.
π Features
- Universal Video Support: Works with YouTube, Vimeo, Facebook, Twitter, TikTok, direct URLs, and 50+ platforms
- AI-Powered Analysis: Transcription, summarization, sentiment analysis, topic modeling, and more
- Real-time Processing: Live progress updates with WebSocket notifications
- Scalable Architecture: Handle viral content and traffic spikes
- Enterprise Ready: Production-grade security, monitoring, and reliability
ποΈ Architecture
Backend Stack
- FastAPI with SQLAlchemy and Alembic
- Celery + Redis for async video processing
- PostgreSQL for data storage
- MinIO/S3 for object storage
- FFmpeg for video processing
- yt-dlp for universal video downloading
AI/ML Stack
- OpenAI GPT for content analysis
- Whisper/AssemblyAI for transcription
- Transformers for NLP processing
- OpenCV for computer vision
Frontend Stack
- Next.js 14 with TypeScript
- Tailwind CSS for styling
- React Player for video playback
- SWR for data fetching
- Zustand for state management
π Quick Start
Prerequisites
- Docker and Docker Compose
- Node.js 18+ (for frontend development)
- Python 3.11+ (for backend development)
Development Setup
- Clone the repository
git clone <repository-url>
cd videoprocessing
- Start the development environment
docker-compose up -d
- Install dependencies
# Backend
cd backend
pip install -r requirements.txt
# Frontend
cd ../frontend
npm install
- Run database migrations
cd backend
alembic upgrade head
- Start the development servers
# Backend (in one terminal)
cd backend
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# Frontend (in another terminal)
cd frontend
npm run dev
π Project Structure
videoprocessing/
βββ backend/ # FastAPI backend
β βββ app/
β β βββ api/ # API routes
β β βββ core/ # Core configuration
β β βββ models/ # Database models
β β βββ services/ # Business logic
β β βββ tasks/ # Celery tasks
β β οΏ½οΏ½οΏ½ββ utils/ # Utilities
β βββ alembic/ # Database migrations
β βββ tests/ # Backend tests
β βββ requirements.txt
βββ frontend/ # Next.js frontend
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Next.js pages
β β βββ hooks/ # Custom hooks
β β βββ utils/ # Utilities
β β βββ types/ # TypeScript types
β βββ public/ # Static assets
β βββ package.json
βββ docker/ # Docker configurations
βββ k8s/ # Kubernetes manifests
βββ terraform/ # Infrastructure as Code
βββ docs/ # Documentation
βββ docker-compose.yml # Development environment
π§ Configuration
Environment Variables
Create .env files in both backend/ and frontend/ directories:
Backend (.env)
DATABASE_URL=postgresql://user:password@localhost:5432/videoprocessing
REDIS_URL=redis://localhost:6379/0
MINIO_ENDPOINT=localhost:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
OPENAI_API_KEY=your-openai-key
ASSEMBLYAI_API_KEY=your-assemblyai-key
SECRET_KEY=your-secret-key
Frontend (.env.local)
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_WS_URL=ws://localhost:8000
π§ͺ Testing
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test
# E2E tests
npm run test:e2e
π Monitoring
- Health Check:
GET /health - Metrics:
GET /metrics - API Documentation:
http://localhost:8000/docs
π Deployment
Production Deployment
- Build Docker images
docker build -t videoprocessing-backend ./backend
docker build -t videoprocessing-frontend ./frontend
- Deploy with Kubernetes
kubectl apply -f k8s/
- Or deploy with Docker Compose
docker-compose -f docker-compose.prod.yml up -d
π API Documentation
Interactive API documentation is available at:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
π€ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Support
For support, please open an issue on GitHub or contact the development team.