π Enterprise-Grade FFmpeg Processing API
A high-performance, production-ready FFmpeg API designed to replace complex CLI workflows with a modern, scalable, developer-friendly solution. Built for professional video processing with enterprise features.
- π¬ Complete FFmpeg Capability - Full CLI parity with REST API convenience
- β‘ Hardware Acceleration - NVENC, QSV, VAAPI, VideoToolbox support
- π Quality Metrics - Built-in VMAF, PSNR, SSIM analysis
- π Async Processing - Non-blocking operations with real-time progress
- π‘οΈ Enterprise Security - API keys, rate limiting, input validation
- π Production Monitoring - Prometheus metrics, health checks, alerting
- π Multi-Cloud Storage - S3, Azure, GCP, and local filesystem
- π³ Container Native - Optimized Docker deployment with orchestration
git clone https://github.com/rendiffdev/ffmpeg-api.git
cd ffmpeg-api
# Choose your deployment type
./setup.sh --development # Local development (SQLite)
./setup.sh --standard # Production (PostgreSQL + Redis)
./setup.sh --gpu # Hardware accelerated processing
# API available at
curl http://localhost:8000/api/v1/health
# Interactive documentation
open http://localhost:8000/docs
curl -X POST "http://localhost:8000/api/v1/convert" \\
-H "Content-Type: application/json" \\
-d '{
"input": "/path/to/input.mp4",
"output": "/path/to/output.webm",
"operations": [
{"type": "transcode", "params": {"video_codec": "vp9", "crf": 30}}
]
}'
Type | Use Case | Setup Time | Features |
---|---|---|---|
Development | Local testing | 60 seconds | SQLite, Debug mode, No auth |
Standard | Production CPU | 3 minutes | PostgreSQL, Redis, HTTPS, Monitoring |
GPU | Hardware accelerated | 5 minutes | Everything + NVENC/QSV/VAAPI |
POST /api/v1/convert # Universal media conversion
POST /api/v1/analyze # Quality metrics (VMAF, PSNR, SSIM)
POST /api/v1/stream # HLS/DASH adaptive streaming
POST /api/v1/estimate # Processing time/cost estimation
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
GET /api/v1/health # Health check
GET /api/v1/capabilities # Supported formats and features
GET /docs # Interactive API documentation
- NVIDIA NVENC/NVDEC - GPU encoding and decoding
- Intel Quick Sync Video - Hardware-accelerated processing
- AMD VCE/VCN - Advanced media framework
- Apple VideoToolbox - macOS hardware acceleration
- VMAF - Perceptual video quality measurement
- PSNR - Peak Signal-to-Noise Ratio
- SSIM - Structural Similarity Index
- Bitrate Analysis - Compression efficiency metrics
- API Key Authentication with role-based permissions
- Rate Limiting with configurable thresholds
- Input Validation prevents command injection
- HTTPS/SSL with automatic certificate management
- Security Headers (HSTS, CSP, XSS protection)
- Prometheus Metrics - 50+ metrics tracked
- Grafana Dashboards - Real-time visualization
- Health Checks - Comprehensive system monitoring
- Structured Logging - Centralized log management
- Alerting Rules - Proactive issue detection
Production Stack:
βββ Traefik (SSL/Load Balancer)
βββ KrakenD (API Gateway)
βββ FastAPI (Core API)
βββ Celery Workers (CPU/GPU)
βββ PostgreSQL (Database)
βββ Redis (Queue/Cache)
βββ Prometheus (Metrics)
βββ Grafana (Monitoring)
- Multi-stage builds for optimized images
- Security hardening with non-root users
- Health checks with automatic restarts
- Resource limits and monitoring
- Log rotation and management
Video: MP4, AVI, MOV, MKV, WebM, FLV, WMV, MPEG, TS, VOB, 3GP, MXF Audio: MP3, WAV, FLAC, AAC, OGG, WMA, M4A, Opus, ALAC, DTS
Containers: MP4, WebM, MKV, MOV, HLS, DASH, AVI Video Codecs: H.264, H.265/HEVC, VP9, AV1, ProRes Audio Codecs: AAC, MP3, Opus, Vorbis, FLAC
# Core Configuration
API_HOST=0.0.0.0
API_PORT=8000
DEBUG=false
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/ffmpeg_api
REDIS_URL=redis://localhost:6379/0
# Security
ENABLE_API_KEYS=true
RATE_LIMIT_CALLS=2000
RATE_LIMIT_PERIOD=3600
# FFmpeg
FFMPEG_HARDWARE_ACCELERATION=auto
FFMPEG_THREADS=0
# config/storage.yml - Multi-cloud storage
storage:
backends:
s3:
bucket: my-video-bucket
region: us-west-2
azure:
container: videos
local:
path: /storage
# Scale API instances
docker compose up -d --scale api=4
# Scale workers based on load
docker compose up -d --scale worker-cpu=8
docker compose up -d --scale worker-gpu=2
- Connection pooling for database and Redis
- Async processing with non-blocking I/O
- Hardware acceleration auto-detection
- Caching layers for frequently accessed data
- Resource management with limits and monitoring
# Development environment
./setup.sh --development
# Install development dependencies
pip install -r requirements.txt -r requirements-dev.txt
# Run tests
pytest tests/ -v
# Code formatting
black api/ worker/ tests/
flake8 api/ worker/ tests/
# Unit tests
pytest tests/unit/ -v
# Integration tests
pytest tests/integration/ -v
# Performance tests
pytest tests/performance/ -v
Document | Description |
---|---|
API Reference | Complete API endpoint documentation |
Setup Guide | Detailed installation instructions |
Production Guide | Production deployment best practices |
Monitoring Guide | Observability and alerting setup |
- CPU: 4 cores
- RAM: 8GB
- Storage: 50GB SSD
- Network: 1Gbps
- CPU: 8+ cores
- RAM: 32GB
- GPU: NVIDIA RTX 3080+ (8GB+ VRAM)
- Storage: 200GB NVMe SSD
- Network: 10Gbps
Supports deployment on all major cloud platforms:
- AWS (EC2, ECS, EKS)
- Google Cloud (GCE, GKE)
- Azure (VM, AKS)
- DigitalOcean (Droplets, Kubernetes)
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
Feature | FFmpeg CLI | This API | Advantage |
---|---|---|---|
Batch Processing | Manual scripting | Built-in API | 10x Easier |
Progress Tracking | Parse stderr | Real-time SSE | Real-time |
Error Handling | Exit codes | Structured JSON | Detailed |
Quality Analysis | Separate tools | Integrated | Built-in |
Scaling | Manual | Auto-scaling | Enterprise |
Monitoring | None | Full metrics | Production |
- Complete CLI Parity - No feature compromises
- Production Ready - Battle-tested in enterprise environments
- Developer Friendly - Modern REST API with great docs
- Cost Effective - Self-hosted, no per-minute charges
- Highly Secure - Enterprise-grade security features
Transform your video processing workflow with production-ready FFmpeg API.
Built with β€οΈ by the Rendiff team