oximedia-distributed
Production-grade distributed video encoding coordinator for OxiMedia, providing horizontally scalable job distribution across worker nodes with fault tolerance and load balancing.
Part of the oximedia workspace — a comprehensive pure-Rust media processing framework.
Version: 0.1.7 — 2026-05-16 — 658 tests
Overview
oximedia-distributed implements a horizontally scalable distributed encoding coordinator capable of managing tens to hundreds of worker nodes with fault tolerance, Raft-based consensus, and low coordination overhead.
Architecture
┌─────────────────┐
│ Coordinator │ ◄─── gRPC ───┐
│ (Central Hub) │ │
└────────┬────────┘ │
│ │
┌────┴────┐ ┌─────┴──────┐
│ │ │ │
┌───▼───┐ ┌──▼────┐ ┌───▼───┐ ┌───▼───┐
│Worker │ │Worker │ │Worker │ │Worker │
│ #1 │ │ #2 │ │ #3 │ │ #N │
└───────┘ └───────┘ └───────┘ └───────┘
Features
- Distributed Coordination — Central coordinator managing the worker pool with Raft consensus
- Job Scheduling — Priority-based, FIFO, EDF, Fair Share, and SJF policies
- Load Balancing — Least-loaded, round-robin, fastest-first, and capability-based strategies
- Fault Tolerance — Automatic job rescheduling, heartbeat monitoring, circuit breakers, checkpointing
- Worker Discovery — Static, mDNS, etcd, and Consul registration methods
- Segmentation — Time-based, tile-based, and GOP-aligned video splitting
- Back-pressure — Flow control to prevent coordinator overload
- Work Stealing — Idle workers steal tasks from overloaded peers
- Leader Election — Raft-based leader election for coordinator HA
- Metrics — Real-time throughput, latency, and utilization tracking
Usage
Add to your Cargo.toml:
[]
= "0.1.7"
use ;
use Duration;
use Uuid;
async
API Overview
Core types:
DistributedEncoder— Main distributed encoding interfaceDistributedConfig— Configuration (coordinator address, timeouts, retries)DistributedJob— Job definition with source, codec, strategy, and outputEncodingParams— Encoding parameters (bitrate, resolution, preset)SplitStrategy— SegmentBased / TileBased / GopBasedJobPriority— Low / Normal / High / Critical
Modules:
coordinator— Central coordinator serviceworker— Worker node implementationscheduler— Advanced job schedulingsegment— Video segmentation and reassemblydiscovery— Worker discovery (static, mDNS, etcd, Consul)cluster— Cluster membership managementconsensus— Raft-based consensus primitivesraft_primitives— Raft log and state machineleader_election— Leader election protocolload_balancer— Load balancing strategiesfault_tolerance— Fault detection and recoveryheartbeat— Worker heartbeat trackingbackpressure— Flow control and back-pressurework_stealing— Work-stealing schedulercheckpointing— State checkpointingreplication— State replicationcircuit_breaker— Circuit breaker patternmessage_bus,message_queue— Inter-node messagingnode_registry,node_health,node_topology— Node managementtask_distribution,task_queue,task_retry— Task lifecycletask_priority_queue— Priority-ordered task queuejob_tracker— Job progress trackingresource_quota— Per-job resource limitspartition,shard,shard_map— Data partitioningsnapshot_store— Cluster snapshot persistencemetrics_aggregator— Metrics collection and aggregationpb— Protocol buffer generated types
License
Apache-2.0 — Copyright 2024-2026 COOLJAPAN OU (Team Kitasan)