Skip to content

System Architecture & Subsystem Blueprint ​

RUSEON Core is an ultra-high performance video infrastructure engine written in Go. It is architected from the ground up for high throughput, sub-500ms streaming latency, predictable memory usage, and hardware fault resilience.


Architectural Guarantees & Principles ​

  1. Zero Transcoding Overhead: RUSEON Core never decodes video frames into raw RGB/YUV pixel buffers for streaming. It repackages compressed NAL units directly in RAM, reducing CPU usage by >90% compared to traditional VMS software.
  2. Subsystem Fault Isolation: A slow disk write or an unclosed network socket on a single WebRTC viewer can never block the main RTSP ingestion pipeline. The Ring Buffer drops non-keyframe packets per slow subscriber independently.
  3. Memory Safety & Determinism: All packet buffers are managed via bounded pools and ring queues, preventing unbounded heap growth and eliminating memory fragmentation under sustained load.
  4. Crash Resilience: All video archives are stored in Fragmented MP4 (fMP4) with automated startup atom boundary recovery, guaranteeing zero unplayable video files after sudden power loss.

Architecture Subsystems Guide ​

SubsystemCore ResponsibilitiesImplementation FilesDeep Dive
Ring BufferShared memory frame hub, atomic.Pointer[CodecParams], KeyFrame backfill, slow consumer isolationinternal/buffer/ring.goRing Buffer Deep Dive
Stream PipelineRTSP ingestion, NAL unit parsing, SPS/PPS extraction, dial throttlerinternal/stream/Stream Pipeline
Recording PipelinefMP4 box serialization, Linux sync_file_range, FADV_DONTNEED, atomic recoveryinternal/recorder/Recording Pipeline
LL-HLS PipelineOn-demand playlist generation, singleflight caching, lazy muxer lifecycleinternal/api/hls.goHLS Pipeline
WebRTC PipelineWHEP negotiation, Pion WebRTC integration, ICE candidate gatheringinternal/webrtc/WebRTC Pipeline
Storage ArchitectureBadgerDB v4 LSM store, hierarchical disk directory partitioningpkg/storage/Storage Architecture
Concurrency ModelGoroutine lifecycle, channel ownership, mutex contention preventionCore codebaseConcurrency Model
Internal Event BusAsync pub/sub event router, topic matching, drop metricsinternal/events/bus.goEvent Bus
Architecture Decisions (ADR)Why Go, why fMP4, why BadgerDB, why WHEP instead of WHIPArchitectural recordDecisions Log

Released under the MIT License.