Archive Storage & Directory File Layout
RUSEON Core organizes recorded video files in a clean, stream-isolated directory structure. This design enables instantaneous timeline range indexing, robust crash recovery, and efficient retention cleanup.
1. Directory Hierarchy
All recordings are stored under the root recordings/ directory:
text
recordings/
├── cam-entrance-01/
│ ├── 2026-08-23_14-00-00_to_15-00-00.mp4
│ ├── 2026-08-23_15-00-00_to_16-00-00.mp4
│ └── 2026-08-23_16-00-00_ongoing.mp4
└── cam-warehouse-02/
├── 2026-08-23_14-00-00_to_15-00-00.mp4
└── 2026-08-23_15-00-00_ongoing.mp42. Path & Filename Specification
| Segment | Format | Description | Example |
|---|---|---|---|
| Root | recordings/ | Base archive directory | ./recordings |
| Camera Folder | {camera_id}/ | Dedicated directory per camera stream | cam-entrance-01/ |
| Active Recording | {start}_ongoing.mp4 | Live file actively being appended with fMP4 parts | 2026-08-23_16-00-00_ongoing.mp4 |
| Completed Hourly | {start}_to_{end}.mp4 | Rotated standalone fMP4 file | 2026-08-23_14-00-00_to_15-00-00.mp4 |
| Corrupted/Failed | {start}.corrupted | Marked on unrecoverable write failure | 2026-08-23_14-00-00.corrupted |
3. High-Speed In-Memory Indexing (IndexLRUCache)
- Zero Database Dependency: Archive timelines (
GET /api/cameras/:id/archive) are dynamically discovered by scanningrecordings/{camera_id}/usinginternal/archive/indexer.go. - LRU Cache (
IndexLRUCache): Fast seek and playback queries parse fMP4moof+mdatbox offsets directly from files and cache index structures in memory (capacity: 2,000 files). - Direct MP4 Clip Export:
ExportMP4copies theftyp+moovinit header and chosen movie parts directly to HTTP response streams without disk re-encoding.
4. Storage Mount Best Practices
For Linux production deployments, mount your recording storage volume with high-throughput options:
bash
# Recommended /etc/fstab mount options for XFS / ext4 recording volumes
UUID=... /app/recordings ext4 noatime,nodiratime,data=ordered 0 2