A comprehensive video quality analysis system with a modern React frontend and Python Flask backend. Analyze uploaded videos for audio and visual issues including voice glitches, clipping, silences, black frames, and frozen frames using only free and open-source libraries.
- Modern UI: Built with React 18, TypeScript, TailwindCSS, and shadcn/ui components
- Drag & Drop Upload: Intuitive file upload with validation and progress tracking
- Real-time Progress: Live analysis updates via Server-Sent Events (SSE)
- Interactive Video Player: Timeline overlay with clickable issue markers
- Comprehensive Results: Tabbed interface with summary, audio issues, video issues, and metrics
- Export Capabilities: Download reports in Markdown, PDF, and JSON formats
- Responsive Design: Mobile-friendly with dark/light theme support
- Accessibility: ARIA labels, keyboard navigation, and adequate contrast
- Video Analysis Engine: Powered by moviepy, librosa, opencv-python, and pyloudnorm
- Background Processing: Celery + Redis for handling long-running analysis jobs
- RESTful API: Clean endpoints for job management and results retrieval
- Report Generation: Automated Markdown and PDF report creation
- File Management: Secure upload handling with automatic cleanup
- Loudness Analysis: Integrated LUFS measurement with broadcast compliance checking
- Clipping Detection: Identifies audio samples near digital clipping (Β±1.0)
- Silence Detection: Finds gaps longer than 1 second below -40 dBFS
- Voice Glitch Detection: Heuristic detection using zero-crossing rate and RMS analysis
- Black Frame Detection: Identifies frames with mean brightness below threshold
- Frozen Frame Detection: Uses PSNR comparison to detect static sequences
- Technical Metrics: Resolution, frame rate, codecs, file size analysis
- Quality Assessment: Overall quality scoring and recommendations
- Docker & Docker Compose (recommended) OR
- Python 3.11+ and Node.js 18+ for manual setup
- FFmpeg (automatically included in Docker setup)
- β Windows 10/11
- β macOS 10.15+
- β Linux (Ubuntu 20.04+, CentOS 8+, etc.)
git clone <repository-url>
cd video-qa-system
# Production deployment
docker-compose up -d
# Development mode (with hot reload)
docker-compose -f docker-compose.dev.yml up -d
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- API Health Check: http://localhost:5000/api/health
- Navigate to http://localhost:3000
- Drag and drop a video file (MP4, MOV, AVI, WebM, MKV)
- Click "Start Analysis"
- Monitor real-time progress
- View comprehensive results with interactive timeline
- Export reports in multiple formats
- Install Python Dependencies
cd backend
pip install -r requirements.txt
- Install FFmpeg
# Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg
# macOS (with Homebrew)
brew install ffmpeg
# Windows (with Chocolatey)
choco install ffmpeg
- Start Redis
# Using Docker
docker run -d -p 6379:6379 redis:7-alpine
# Or install locally and start
redis-server
- Start Backend Services
# Terminal 1: Flask API
python app.py
# Terminal 2: Celery Worker
celery -A analysis_tasks worker --loglevel=info
- Install Dependencies
cd frontend
npm install
- Start Development Server
npm run dev
- Build for Production
npm run build
npm run preview
video-qa-system/
βββ backend/ # Python Flask backend
β βββ app.py # Main Flask application
β βββ analysis_tasks.py # Celery tasks for video analysis
β βββ video_analyzer.py # Core analysis engine
β βββ report_generator.py # Report generation utilities
β βββ requirements.txt # Python dependencies
β βββ Dockerfile # Backend container config
βββ frontend/ # React TypeScript frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ lib/ # Utilities and API client
β β βββ store/ # Zustand state management
β βββ package.json # Node.js dependencies
β βββ Dockerfile # Frontend container config
βββ docker-compose.yml # Production deployment
βββ docker-compose.dev.yml # Development environment
βββ README.md # This file
POST /api/jobs
Content-Type: multipart/form-data
Body: video file (max 1GB)
Response: { job_id, task_id, status, filename }
GET /api/jobs/{job_id}/status
Response: { job_id, state, progress, stage, timestamp }
GET /api/jobs/{job_id}/result
Response: { job_id, filename, analysis_timestamp, metadata, audio_issues, video_issues, metrics, summary }
GET /api/jobs/{job_id}/stream
Content-Type: text/plain
GET /api/jobs/{job_id}/report.md # Markdown report
GET /api/jobs/{job_id}/report.pdf # PDF report
{
"job_id": "uuid",
"filename": "video.mp4",
"analysis_timestamp": "2024-01-01T12:00:00Z",
"metadata": {
"duration": 120.5,
"fps": 29.97,
"width": 1920,
"height": 1080,
"has_audio": true,
"file_size": 52428800,
"video_codec": "h264",
"audio_codec": "aac",
"sample_rate": 48000
},
"audio_issues": [
{
"type": "clipping",
"timestamp": "00:01:23.456",
"duration": 0.123,
"severity": "high",
"description": "Audio clipping detected",
"suggested_fix": "Reduce input gain"
}
],
"video_issues": [
{
"type": "black_frame",
"timestamp": "00:02:15.789",
"duration": 1.0,
"severity": "medium",
"description": "Black frame detected",
"suggested_fix": "Check encoding settings"
}
],
"metrics": {
"duration_formatted": "00:02:00.500",
"fps": 29.97,
"resolution": "1920x1080",
"aspect_ratio": 1.78,
"file_size_mb": 50.0,
"integrated_lufs": -23.4,
"audio_sample_rate": 48000,
"dynamic_range_db": 12.3
},
"summary": {
"status": "PASS",
"total_issues": 2,
"high_severity_issues": 1,
"points": [
"Found 1 audio issue: clipping",
"Found 1 video issue: black_frame",
"Audio levels acceptable (-23.4 LUFS)"
]
}
}
Create .env
files for configuration:
Backend (.env)
REDIS_URL=redis://localhost:6379/0
FLASK_ENV=development
FLASK_DEBUG=True
# Backend tests (when implemented)
cd backend
python -m pytest
# Frontend tests
cd frontend
npm test
# Backend linting
cd backend
flake8 .
black .
# Frontend linting
cd frontend
npm run lint
# Build and start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Scale workers
docker-compose up -d --scale celery-worker=3
# Update services
docker-compose pull
docker-compose up -d
- Development: Uses
docker-compose.dev.yml
with hot reload - Production: Uses
docker-compose.yml
with optimized builds - Scaling: Celery workers can be scaled based on load
- Frontend: http://localhost:3000 (should load the UI)
- Backend: http://localhost:5000/api/health
- Redis:
docker-compose exec redis redis-cli ping
- Celery:
docker-compose exec celery-worker celery -A analysis_tasks inspect ping
# All services
docker-compose logs -f
# Specific service
docker-compose logs -f backend
docker-compose logs -f celery-worker
- File upload size limited to 1GB
- Uploaded files are automatically cleaned up after processing
- Basic rate limiting implemented
- CORS configured for frontend-backend communication
- No user authentication (add if needed for production)
-
FFmpeg not found
- Ensure FFmpeg is installed and in PATH
- Docker setup includes FFmpeg automatically
-
Redis connection failed
- Check if Redis is running:
docker-compose ps redis
- Verify Redis URL in environment variables
- Check if Redis is running:
-
Video analysis fails
- Check video format compatibility
- Ensure sufficient disk space
- Check Celery worker logs:
docker-compose logs celery-worker
-
Frontend can't connect to backend
- Verify backend is running on port 5000
- Check CORS configuration
- Ensure proxy settings in
vite.config.ts
-
Scale Celery Workers
docker-compose up -d --scale celery-worker=4
-
Increase Worker Concurrency
# In docker-compose.yml command: celery -A analysis_tasks worker --loglevel=info --concurrency=4
-
Optimize Video Analysis
- Reduce frame sampling rate for faster analysis
- Adjust quality thresholds based on requirements
This project uses only free and open-source libraries:
- Backend: Flask, Celery, moviepy, librosa, opencv-python, pyloudnorm
- Frontend: React, TypeScript, TailwindCSS, shadcn/ui
- Infrastructure: Docker, Redis, Nginx
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make changes and test thoroughly
- Commit with clear messages:
git commit -m "Add feature"
- Push and create a Pull Request
For issues and questions:
- Check this README for common solutions
- Review the troubleshooting section
- Check Docker logs for error details
- Create an issue with detailed error information
Built with β€οΈ using only free and open-source technologies