Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

NotificationsYou must be signed in to change notification settings

rendiffdev/ffmpeg-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MITPython VersionDockerFFmpegPostgreSQLRedis

🚀 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.

✨ Core Features

  • 🎬 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

🚀 Quick Start

Choose Your Setup Type

# 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)

🏃‍♂️ Development (60 seconds)

Perfect for testing and local development:

./setup.sh --development

Features: SQLite, local storage, no auth required, debug mode

🏭 Standard Production

Enterprise-ready deployment:

./setup.sh --standard

Features: PostgreSQL, Redis, monitoring, API keys, HTTPS by default, 2 CPU workers

🤖 AI-Enhanced Production

GPU-accelerated AI features:

./setup.sh --genai

Features: Everything in Standard + GPU workers, AI models, upscaling, scene analysis

📋 Deployment Comparison

FeatureDevelopmentStandardGenAI
Setup Time1 minute3 minutes10 minutes
DatabaseSQLitePostgreSQLPostgreSQL
QueueRedisRedisRedis
AuthenticationDisabledAPI KeysAPI Keys
HTTPS/SSL✅ (Self-signed + Let's Encrypt)✅ (Self-signed + Let's Encrypt)
MonitoringBasicFull (Prometheus/Grafana)Full
Workers1 CPU2 CPU2 CPU + 1 GPU
AI Features
GPU Support
Production Ready

🎯 API Endpoints

Core Processing

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

Job Management

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

AI Features (GenAI Setup)

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

System & Health

GET /api/v1/health       # Service health checkGET /api/v1/capabilities # Supported formats and featuresGET /docs                # Interactive API documentation

🔧 Configuration & Management

API Key Management

# 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/SSL Setup

🔒 HTTPS is enabled by default in ALL production deployments with self-signed certificates.

SSL Certificate Options:

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

Monitoring & Health

# 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

📊 What's Included

🔧Core Infrastructure

  • 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

🛡️Security & Production

  • 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

📈Monitoring & Observability

  • Prometheus metrics collection
  • Grafana dashboards and visualizations
  • Structured Logging with correlation IDs
  • Health Checks for all services
  • Real-time Progress via Server-Sent Events

🤖AI Features (Optional)

  • 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

🏗️ Architecture

┌─────────────────┐    ┌──────────────┐    ┌─────────────────┐│   Traefik       │────│   KrakenD    │────│   FastAPI       ││   (SSL/Proxy)   │    │   (Gateway)  │    │   (Core API)    │└─────────────────┘    └──────────────┘    └─────────────────┘                                                     │┌─────────────────┐    ┌──────────────┐    ┌─────────────────┐│   PostgreSQL    │    │    Redis     │    │   Celery        ││   (Database)    │    │   (Queue)    │    │   (Workers)     │└─────────────────┘    └──────────────┘    └─────────────────┘                                                     │┌─────────────────┐    ┌──────────────┐    ┌─────────────────┐│   Prometheus    │    │   Grafana    │    │   GPU Workers   ││   (Metrics)     │    │ (Dashboards) │    │   (AI/GenAI)    │└─────────────────┘    └──────────────┘    └─────────────────┘

📖 Documentation

DocumentDescription
Setup GuideComplete setup documentation for all deployment types
API ReferenceDetailed API endpoint documentation
Installation GuideAdvanced installation and configuration
Production SetupProduction deployment best practices
HTTPS/SSL SetupSecurity configuration and best practices

🎯 Use Cases

🎬Media Companies

  • Automated video transcoding pipelines
  • Quality analysis and optimization
  • Multi-format delivery (HLS, DASH, MP4)
  • AI-enhanced upscaling for archive content

📺Streaming Platforms

  • Adaptive bitrate ladder generation
  • Real-time encoding for live streams
  • Content analysis for recommendation engines
  • Automated thumbnail generation

🏢Enterprise

  • Internal video processing workflows
  • Compliance and quality monitoring
  • Cost optimization through intelligent encoding
  • Integration with existing media management systems

🔬Research & Development

  • Video analysis and metrics collection
  • A/B testing for encoding parameters
  • Machine learning dataset preparation
  • Performance benchmarking

🛠️ Advanced Features

Storage Backends

# Configure multiple storage optionsstorage:backends:s3:# AWS S3 or compatibleazure:# Azure Blob Storagegcp:# Google Cloud Storagelocal:# Local filesystem

GPU Acceleration

# Enable hardware acceleration./setup.sh --genai# Supports:# - NVIDIA NVENC/NVDEC# - Intel Quick Sync Video# - AMD VCE/VCN# - Apple VideoToolbox (macOS)

Horizontal Scaling

# 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

🚀 Production Deployment

Minimum Requirements

  • CPU: 4 cores
  • RAM: 8GB
  • Storage: 50GB SSD
  • Network: 1Gbps

Recommended (GenAI)

  • CPU: 8+ cores
  • RAM: 32GB
  • GPU: NVIDIA RTX 3080/4080 (8GB+ VRAM)
  • Storage: 200GB NVMe SSD
  • Network: 10Gbps

Cloud Deployment

Supports deployment on:

  • AWS (EC2, ECS, EKS)
  • Google Cloud (GCE, GKE)
  • Azure (VM, AKS)
  • DigitalOcean (Droplets, Kubernetes)
  • Self-hosted infrastructure

📞 Support & Community

🤝 Contributing

We welcome contributions! Please open an issue or submit a pull request on ourGitHub repository.

📄 License

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors9


[8]ページ先頭

©2009-2025 Movatter.jp