Rendiff Probe is a professional video analysis platform built on a clean, layered architecture designed for scalability, maintainability, and production-grade reliability. The system provides both REST API and CLI interfaces for comprehensive media file analysis using FFprobe and FFmpeg.
┌─────────────────────────────────────────────────────────────────────────────────┐
│ CLIENT LAYER │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ REST API │ │ GraphQL API │ │ CLI Tool │ │
│ │ (HTTP/JSON) │ │ (Queries) │ │ (rendiffprobe) │ │
│ └────────┬────────┘ └────────┬────────┘ └────────┬────────┘ │
└───────────┼─────────────────────┼─────────────────────┼──────────────────────────┘
│ │ │
┌───────────▼─────────────────────▼─────────────────────▼──────────────────────────┐
│ API GATEWAY LAYER │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Gin Router │ │ Auth/JWT │ │ Rate Limiter │ │ CORS/Headers │ │
│ │ Middleware │ │ Middleware │ │ Middleware │ │ Middleware │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘ │
└───────────────────────────────────┬──────────────────────────────────────────────┘
│
┌───────────────────────────────────▼──────────────────────────────────────────────┐
│ HANDLER LAYER │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Probe │ │ Batch │ │ HLS │ │ GraphQL │ │ WebSocket │ │
│ │ Handler │ │ Handler │ │ Handler │ │ Handler │ │ Handler │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
└─────────┼───────────────┼───────────────┼───────────────┼───────────────┼────────┘
│ │ │ │ │
┌─────────▼───────────────▼───────────────▼───────────────▼───────────────▼────────┐
│ SERVICE LAYER │
│ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Analysis Service │ │ Report Service │ │ Secret Rotation │ │
│ │ - CreateAnalysis │ │ - PDF Generation │ │ - API Key Mgmt │ │
│ │ - ProcessAnalysis│ │ - JSON Export │ │ - JWT Rotation │ │
│ └────────┬─────────┘ └────────┬─────────┘ └──────────────────┘ │
└───────────┼─────────────────────┼────────────────────────────────────────────────┘
│ │
┌───────────▼─────────────────────▼────────────────────────────────────────────────┐
│ ANALYSIS ENGINE │
│ ┌────────────────────────────────────────────────────────────────────────────┐ │
│ │ FFmpeg Integration Layer │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
│ │ │ FFprobe │ │ Content │ │ HDR │ │ Enhanced │ │ │
│ │ │ Runner │ │ Analyzer │ │ Analyzer │ │ Analyzers │ │ │
│ │ │ │ │ (26 parallel│ │ │ │ (19 QC │ │ │
│ │ │ │ │ goroutines) │ │ │ │ categories) │ │ │
│ │ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │ │
│ └─────────┼───────────────┼───────────────┼───────────────┼─────────────────┘ │
│ │ │ │ │ │
│ ┌─────────▼───────────────▼───────────────▼───────────────▼─────────────────┐ │
│ │ FFmpeg/FFprobe Binaries │ │
│ │ (signalstats, idet, ebur128, astats, blackdetect, freezedetect, etc.) │ │
│ └────────────────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────────────┘
│
┌───────────────────────────────────▼──────────────────────────────────────────────┐
│ DATA LAYER │
│ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ │
│ │ SQLite Database │ │ Valkey/Redis │ │ File Storage │ │
│ │ - Analysis Store │ │ - Rate Limiting │ │ - Temp Files │ │
│ │ - Job Queue │ │ - API Key Cache │ │ - Uploads │ │
│ │ - Audit Logs │ │ - Session Cache │ │ - Reports │ │
│ └──────────────────┘ └──────────────────┘ └──────────────────┘ │
└──────────────────────────────────────────────────────────────────────────────────┘
- Technology: Gin Web Framework
- Protocol: HTTP/HTTPS
- Formats: JSON, multipart/form-data
- Endpoints:
POST /api/v1/probe/file- Analyze uploaded filePOST /api/v1/probe/url- Analyze URLPOST /api/v1/probe/hls- Analyze HLS streamPOST /api/v1/batch/analyze- Batch analysisGET /api/v1/batch/status/:id- Batch status
- Schema: Type-safe queries and mutations
- Playground: Interactive GraphiQL interface
- Features: Flexible field selection, nested queries
- Commands:
analyze,info,categories,version - Formats:
report,json,text - Features: Local analysis without server
Middleware Pipeline:
├── Recovery (panic handling)
├── RequestID (tracing)
├── Logging (structured logs)
├── CORS (cross-origin)
├── RateLimit (per-user/tenant)
├── Authentication (JWT/API Key)
└── Validation (request validation)- Per-minute, per-hour, per-day windows
- Tenant-aware limits
- Role-based quotas (admin, premium, pro, user)
- Graceful cleanup with TTL-based expiration
- JWT tokens with rotation support
- API key authentication
- Multi-tenant isolation
- RBAC (Role-Based Access Control)
Handlers translate HTTP requests into service calls:
| Handler | Responsibility |
|---|---|
ProbeHandler |
Single file/URL analysis |
BatchHandler |
Parallel batch processing |
HLSHandler |
HLS stream analysis |
GraphQLHandler |
GraphQL query resolution |
WebSocketHandler |
Real-time progress updates |
APIKeyHandler |
API key management |
Business logic encapsulation:
Service Layer:
├── AnalysisService
│ ├── CreateAnalysis()
│ ├── ProcessAnalysis()
│ ├── GetAnalysis()
│ └── ListAnalyses()
├── ReportService
│ ├── GeneratePDFReport()
│ ├── GenerateJSONReport()
│ └── ExportAnalysis()
├── SecretRotationService
│ ├── GenerateAPIKey()
│ ├── RotateAPIKey()
│ ├── RotateJWTSecret()
│ └── CleanupExpiredKeys()
└── VMAFModelService
└── Quality assessment modelsThe core of Rendiff Probe - a sophisticated FFmpeg integration layer.
- Process management with context cancellation
- Structured output parsing (JSON format)
- Timeout handling
- Error recovery
All analyzers run concurrently using goroutines with proper cleanup:
Content Analyzers:
├── Video Quality
│ ├── Baseband Analysis (signalstats)
│ ├── Video Quality Score
│ ├── Blockiness Detection
│ ├── Blurriness Analysis
│ ├── Noise Analysis
│ └── Line Error Detection
├── Video Content
│ ├── Black Frame Detection (blackdetect)
│ ├── Freeze Frame Detection (freezedetect)
│ ├── Letterbox Detection (cropdetect)
│ ├── Color Bars Detection
│ ├── Safe Area Analysis
│ ├── Temporal Complexity
│ ├── Field Dominance (idet)
│ ├── Differential Frames
│ └── Interlace Analysis
├── Audio Analysis
│ ├── Loudness Metering (ebur128)
│ ├── Audio Clipping (astats)
│ ├── Silence Detection (silencedetect)
│ ├── Phase Correlation (aphasemeter)
│ ├── Channel Mapping
│ ├── Audio Frequency
│ └── Test Tone Detection
└── Additional
├── HDR Analysis
├── Timecode Continuity
└── Dropout Detection| Category | Standards | Purpose |
|---|---|---|
| AFD Analysis | ITU-R BT.1868 | Active Format Description |
| Dead Pixel Detection | Computer Vision | Camera QC |
| PSE Flash Analysis | ITC/Ofcom, ITU-R BT.1702 | Epilepsy safety |
| HDR Analysis | HDR10, Dolby Vision, HLG | HDR validation |
| Audio Wrapping | BWF, RF64, AES3 | Professional audio |
| Endianness Detection | - | Cross-platform |
| Codec Analysis | - | Format validation |
| Container Validation | MP4, MKV, MOV | Structure analysis |
| Resolution Analysis | - | Display optimization |
| Frame Rate Analysis | Broadcast standards | Temporal accuracy |
| Bitdepth Analysis | 8/10/12-bit | Color depth |
| Timecode Analysis | SMPTE 12M | TC continuity |
| MXF Analysis | SMPTE ST 377 | Broadcast format |
| IMF Compliance | SMPTE ST 2067 | Distribution |
| Transport Stream | MPEG-TS | Broadcast transmission |
| Content Analysis | Multiple | 26 sub-analyzers |
| Enhanced Analysis | - | Quality metrics |
| Stream Disposition | Section 508 | Accessibility |
| Data Integrity | CRC32, MD5 | Error detection |
- Embedded, zero-configuration
- Analysis storage with full-text search
- Migration support
- Transaction handling
- Rate limit counters
- API key validation cache
- Session storage
- Result caching
- Temporary upload handling
- Report output storage
- Configurable paths
The system uses a structured concurrency model:
// Pattern: WaitGroup + Context + Buffered Channels
func (ca *ContentAnalyzer) AnalyzeContent(ctx context.Context, filePath string) {
analyzeCtx, cancel := context.WithTimeout(ctx, 120*time.Second)
defer cancel()
var wg sync.WaitGroup
resultChan := make(chan func(), numAnalyzers)
errorChan := make(chan error, numAnalyzers)
// Launch analyzers with proper cleanup
launchAnalyzer := func(name string, analyze func(context.Context, string) (func(), error)) {
wg.Add(1)
go func() {
defer wg.Done()
select {
case <-analyzeCtx.Done():
return
default:
}
// ... analysis logic
}()
}
// Close channels when done
go func() {
wg.Wait()
close(resultChan)
close(errorChan)
}()
}- Mutex protection for shared state
- Read-write locks where appropriate
- Lock ordering to prevent deadlocks
- Channel-based communication
1. Client Request
│
▼
2. Gin Router
│
▼
3. Middleware Chain
├── Recovery
├── RequestID
├── Logging
├── RateLimit
└── Auth
│
▼
4. Handler
└── Request validation
│
▼
5. Service
└── Business logic
│
▼
6. FFmpeg Runner
└── Execute ffprobe/ffmpeg
│
▼
7. Content Analyzers (parallel)
└── 26 concurrent analyses
│
▼
8. Result Aggregation
│
▼
9. Response
services:
rendiff-probe:
image: rendiff-probe:latest
environment:
- PORT=8080
- DB_PATH=/data/rendiff.db
- VALKEY_URL=valkey:6379
volumes:
- ./data:/data
ports:
- "8080:8080"
depends_on:
- valkey
valkey:
image: valkey/valkey:latest
volumes:
- valkey-data:/dataapiVersion: apps/v1
kind: Deployment
metadata:
name: rendiff-probe
spec:
replicas: 3
selector:
matchLabels:
app: rendiff-probe
template:
spec:
containers:
- name: rendiff-probe
image: rendiff-probe:latest
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "2Gi"
cpu: "2000m"| Operation | Typical Time | Notes |
|---|---|---|
| Basic Probe | 1-3s | Metadata extraction |
| Standard QC | 10-30s | All content analyzers |
| Full Analysis | 30-60s | All 121 parameters |
| Batch (10 files) | 2-5min | Parallel processing |
Client → API Key/JWT → Middleware → Handler → Service
│
▼
Rate Limit Check
│
▼
Permission Check
│
▼
Tenant Isolation
- Input validation at all boundaries
- Path traversal prevention
- SQL injection protection
- XSS prevention in reports
- Request latency histograms
- Error rates by endpoint
- Analysis completion rates
- QC failure rates by category
- Structured JSON logs
- Request/response tracing
- Error stack traces
- Audit logging
/health- Service health- Database connectivity
- FFprobe availability
- Cache connectivity
ErrorCode:
├── BadRequest (400)
│ ├── InvalidInput
│ └── ValidationError
├── Unauthorized (401)
│ └── AuthenticationFailed
├── Forbidden (403)
│ └── PermissionDenied
├── NotFound (404)
│ └── ResourceNotFound
├── TooManyRequests (429)
│ └── RateLimitExceeded
└── InternalError (500)
├── AnalysisFailed
└── SystemError- QC failures don't prevent basic analysis
- Partial results returned with clear status
- Circuit breakers for external services
- Fallback to basic analysis when advanced features unavailable
- Horizontal scaling with shared cache
- Worker pool for batch processing
- Message queue for async jobs
- VMAF quality assessment
- Machine learning insights
- Real-time streaming analysis
- Multi-region deployment
This architecture is designed for professional video analysis workflows in broadcast, streaming, and post-production environments.