- Notifications
You must be signed in to change notification settings - Fork1
A containerized FastAPI microservice that exposes FFmpeg capabilities via a REST API. This service supports advanced codecs (VP9, AV1, H.265, etc.), streaming formats (HLS, DASH), API key-based authentication, webhook notifications, and background processing for large jobs. Optionally powered by GenAI.
License
rendiffdev/ffmpeg-api
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
🚀 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 repositorygit clone https://github.com/rendiffdev/ffmpeg-api.gitcd 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 conversionPOST /api/v1/analyze # Quality analysis (VMAF, PSNR, SSIM)POST /api/v1/stream # Generate HLS/DASH streamingPOST /api/v1/estimate # Processing time estimates
GET /api/v1/jobs # List and filter jobsGET /api/v1/jobs/{id} # Job status and progressGET /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 upscalingPOST /api/genai/v1/analyze/scenes # AI scene detectionPOST /api/genai/v1/optimize/parameters # Smart encoding optimizationPOST /api/genai/v1/predict/quality # Quality prediction
GET /api/v1/health # Service health checkGET /api/v1/capabilities # Supported formats and featuresGET /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 domainexport DOMAIN_NAME=api.yourdomain.comexport 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 logsdocker-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 optionsstorage:backends:s3:# AWS S3 or compatibleazure:# Azure Blob Storagegcp:# Google Cloud Storagelocal:# Local filesystem
# Enable hardware acceleration./setup.sh --genai# Supports:# - NVIDIA NVENC/NVDEC# - Intel Quick Sync Video# - AMD VCE/VCN# - Apple VideoToolbox (macOS)
# Scale API instancesdocker-compose up -d --scale api=3# Scale workers based on loaddocker-compose up -d --scale worker-cpu=4docker-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: SeeHTTPS/SSL Configuration
- 📄 License:MIT License
We welcome contributions! Please open an issue or submit a pull request on ourGitHub repository.
This project is licensed under the MIT License - see theLICENSE file for details.
Built with ❤️ by the Rendiff team
Transform your video processing workflow with production-ready FFmpeg API and optional AI enhancement.
About
A containerized FastAPI microservice that exposes FFmpeg capabilities via a REST API. This service supports advanced codecs (VP9, AV1, H.265, etc.), streaming formats (HLS, DASH), API key-based authentication, webhook notifications, and background processing for large jobs. Optionally powered by GenAI.
Topics
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Contributors9
Uh oh!
There was an error while loading.Please reload this page.