Archive & Recording Overview
The archiving subsystem in RUSEON Core is an enterprise-grade recording engine designed to continuously store hundreds of high-bitrate IP camera streams without degrading system responsiveness, exhausting RAM, or losing media integrity during sudden hardware crashes.
Operating as a zero-copy consumer of the Ring Buffer, the recorder transmuxes incoming H.264/H.265 NAL units directly into standard Fragmented MP4 (fMP4) containers without CPU-heavy transcoding.
Core Archival Capabilities
| Subsystem | Architecture & Implementation | Primary Technical Benefit |
|---|---|---|
| fMP4 Recording | Segmented ISO Base Media File Format (moov + repeating moof/mdat pairs) | Instant crash resilience; each fragment is self-contained and playable immediately |
| Linux Kernel I/O | sync_file_range + FADV_DONTNEED in pkg/storage/localfs | Eliminates Page Cache thrashing, prevents kernel OOM killer on heavy 4K camera writes |
| Hierarchical File Layout | Year / Month / Day / Hour subdirectories partitioned by camera ID | Rapid directory scans, zero inode contention, filesystem-agnostic compatibility |
| Retention & Lifecycle | Scheduled background cleaner tracking retention days and max disk usage percentage | Automated disk quota enforcement and pruning of oldest segment folders |
| Crash Recovery | Atom-level box parser (ValidateFMP4File) repairing interrupted trailing boxes | Zero video loss up to the last flushed keyframe upon unexpected power outage |
| Archive Playback | On-demand fMP4 transmuxing to HLS with frame-accurate timeline seeking | Seamless seeking across multi-day recordings in web and mobile players |
Subsections in this Guide
- Recording Mechanics & Linux I/O: Deep dive into fragment generation, GOP alignment, and kernel write optimization.
- Storage Directory Layout: Directory naming conventions, timestamp formatting, and metadata sidecars.
- Retention Policies & Pruning: Time-based and storage quota-based retention algorithms.
- Crash Resilience & Recovery: Box validation, truncated fragment repair, and startup integrity checks.
- Playback & Timeline API: HLS archive streaming, Range requests, and UI timeline integration.