π Production-Ready FFmpeg API with AI Enhancement
A comprehensive, containerized FFmpeg processing API with optional AI features. Deploy with a single command - everything from development to enterprise production with GPU acceleration.
- π¬ Complete FFmpeg API - Process video/audio with RESTful endpoints
- β‘ Async Processing - Background jobs with real-time progress tracking
- π€ AI Enhancement - Optional GPU-accelerated AI features (upscaling, analysis)
- βοΈ Multi-Cloud Storage - S3, Azure, GCP, and local filesystem support
- π Quality Analysis - VMAF, PSNR, SSIM metrics and AI-powered insights
- π‘οΈ Production Security - API keys, HTTPS, rate limiting, monitoring
- π Observability - Prometheus metrics, Grafana dashboards, health checks
- π³ Docker Native - Complete containerization with auto-scaling
# Clone repository
git clone https://github.com/rendiffdev/ffmpeg-api.git
cd ffmpeg-api
# Single command setup - choose your deployment type:
./setup.sh --development # Quick local development
./setup.sh --standard # Production (PostgreSQL, Redis, monitoring)
./setup.sh --genai # AI-enhanced (GPU support, AI models)
./setup.sh --interactive # Interactive setup wizard
That's it! Your API will be running at:
- Development:
http://localhost:8000
- Production:
https://localhost
(HTTPS with self-signed certificate)
Perfect for testing and local development:
./setup.sh --development
Features: SQLite, local storage, no auth required, debug mode
Enterprise-ready deployment:
./setup.sh --standard
Features: PostgreSQL, Redis, monitoring, API keys, HTTPS by default, 2 CPU workers
GPU-accelerated AI features:
./setup.sh --genai
Features: Everything in Standard + GPU workers, AI models, upscaling, scene analysis
Feature | Development | Standard | GenAI |
---|---|---|---|
Setup Time | 1 minute | 3 minutes | 10 minutes |
Database | SQLite | PostgreSQL | PostgreSQL |
Queue | Redis | Redis | Redis |
Authentication | Disabled | API Keys | API Keys |
HTTPS/SSL | β | β (Self-signed + Let's Encrypt) | β (Self-signed + Let's Encrypt) |
Monitoring | Basic | Full (Prometheus/Grafana) | Full |
Workers | 1 CPU | 2 CPU | 2 CPU + 1 GPU |
AI Features | β | β | β |
GPU Support | β | β | β |
Production Ready | β | β | β |
POST /api/v1/convert # Universal media conversion
POST /api/v1/analyze # Quality analysis (VMAF, PSNR, SSIM)
POST /api/v1/stream # Generate HLS/DASH streaming
POST /api/v1/estimate # Processing time estimates
GET /api/v1/jobs # List and filter jobs
GET /api/v1/jobs/{id} # Job status and progress
GET /api/v1/jobs/{id}/events # Real-time progress (SSE)
DELETE /api/v1/jobs/{id} # Cancel job
POST /api/genai/v1/enhance/upscale # Real-ESRGAN 2x/4x upscaling
POST /api/genai/v1/analyze/scenes # AI scene detection
POST /api/genai/v1/optimize/parameters # Smart encoding optimization
POST /api/genai/v1/predict/quality # Quality prediction
GET /api/v1/health # Service health check
GET /api/v1/capabilities # Supported formats and features
GET /docs # Interactive API documentation
# Generate secure API keys
./scripts/manage-api-keys.sh generate
# List current keys (masked)
./scripts/manage-api-keys.sh list
# Test API access (development)
curl -H "X-API-Key: your-key" http://localhost:8000/api/v1/health
# Test API access (production - HTTPS)
curl -k -H "X-API-Key: your-key" https://localhost/api/v1/health
π HTTPS is enabled by default in ALL production deployments with self-signed certificates.
Self-signed (Default) - Works immediately:
./setup.sh --standard # HTTPS ready with self-signed cert
Let's Encrypt (Production) - Free trusted certificates:
# Configure your domain
export DOMAIN_NAME=api.yourdomain.com
export CERTBOT_EMAIL=admin@yourdomain.com
# Setup with Let's Encrypt
./setup.sh --interactive # Choose HTTPS option during setup
Commercial SSL - EV/OV certificates:
# Install commercial certificate
./scripts/enhanced-ssl-manager.sh install-commercial cert.crt private.key
Comprehensive SSL Management:
# Show all SSL management options
./scripts/enhanced-ssl-manager.sh --help
# Monitor SSL certificates
./scripts/enhanced-ssl-manager.sh monitor-start
# Test SSL configuration
./scripts/enhanced-ssl-manager.sh test-ssl yourdomain.com
# Check deployment status
./setup.sh --status
# Validate configuration
./setup.sh --validate
# Health check all services
./scripts/health-check.sh
# View logs
docker-compose logs -f api
- FastAPI - Modern async web framework
- Celery - Distributed task processing
- PostgreSQL 15 - Production database with optimizations
- Redis 7 - Queue and caching layer
- FFmpeg 6.0 - Latest video processing capabilities
- API Key Authentication with rotation support
- Rate Limiting at gateway and application level
- HTTPS/SSL with automatic Let's Encrypt certificates
- Security Headers (HSTS, CSP, XSS protection)
- Network Isolation via Docker networks
- Resource Limits and health monitoring
- Prometheus metrics collection
- Grafana dashboards and visualizations
- Structured Logging with correlation IDs
- Health Checks for all services
- Real-time Progress via Server-Sent Events
- Real-ESRGAN - Video/image upscaling (2x, 4x)
- VideoMAE - Scene detection and analysis
- VMAF Integration - Perceptual quality metrics
- Smart Encoding - AI-optimized compression settings
- Content Analysis - Complexity and scene classification
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β Traefik ββββββ KrakenD ββββββ FastAPI β
β (SSL/Proxy) β β (Gateway) β β (Core API) β
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β PostgreSQL β β Redis β β Celery β
β (Database) β β (Queue) β β (Workers) β
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β Prometheus β β Grafana β β GPU Workers β
β (Metrics) β β (Dashboards) β β (AI/GenAI) β
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
Document | Description |
---|---|
Setup Guide | Complete setup documentation for all deployment types |
API Reference | Detailed API endpoint documentation |
Installation Guide | Advanced installation and configuration |
Production Setup | Production deployment best practices |
HTTPS/SSL Setup | Security configuration and best practices |
- Automated video transcoding pipelines
- Quality analysis and optimization
- Multi-format delivery (HLS, DASH, MP4)
- AI-enhanced upscaling for archive content
- Adaptive bitrate ladder generation
- Real-time encoding for live streams
- Content analysis for recommendation engines
- Automated thumbnail generation
- Internal video processing workflows
- Compliance and quality monitoring
- Cost optimization through intelligent encoding
- Integration with existing media management systems
- Video analysis and metrics collection
- A/B testing for encoding parameters
- Machine learning dataset preparation
- Performance benchmarking
# Configure multiple storage options
storage:
backends:
s3: # AWS S3 or compatible
azure: # Azure Blob Storage
gcp: # Google Cloud Storage
local: # Local filesystem
# Enable hardware acceleration
./setup.sh --genai
# Supports:
# - NVIDIA NVENC/NVDEC
# - Intel Quick Sync Video
# - AMD VCE/VCN
# - Apple VideoToolbox (macOS)
# Scale API instances
docker-compose up -d --scale api=3
# Scale workers based on load
docker-compose up -d --scale worker-cpu=4
docker-compose up -d --scale worker-genai=2
- CPU: 4 cores
- RAM: 8GB
- Storage: 50GB SSD
- Network: 1Gbps
- CPU: 8+ cores
- RAM: 32GB
- GPU: NVIDIA RTX 3080/4080 (8GB+ VRAM)
- Storage: 200GB NVMe SSD
- Network: 10Gbps
Supports deployment on:
- AWS (EC2, ECS, EKS)
- Google Cloud (GCE, GKE)
- Azure (VM, AKS)
- DigitalOcean (Droplets, Kubernetes)
- Self-hosted infrastructure
- π Documentation: Complete guides in
/docs
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Security: See HTTPS/SSL Configuration
- π License: MIT License
We welcome contributions! Please open an issue or submit a pull request on our GitHub repository.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by the Rendiff team
Transform your video processing workflow with production-ready FFmpeg API and optional AI enhancement.