Skip to content

Archive Playback (Streaming)

While video recordings are written to disk as fMP4 for crash resiliency, web browsers and video players require standard HLS streams for random seeking and scrub bar playback.

RUSEON Core bridges this gap via zero-transcode, in-memory on-the-fly transmuxing.


On-the-Fly Transmuxing Architecture

  1. Box Parsing: When /hls/:id/archive.m3u8?file=... is requested, the indexer parses the fMP4 moov, moof, and mdat atom headers to map all GOPs to segment sequence numbers without loading the whole file into RAM.
  2. Dynamic Segments: When /hls/:id/segment.ts?file=...&seq=... is fetched, the server seeks directly to the target byte offset in the .mp4 file, extracts the raw H.264/H.265 NAL units, and wraps them in MPEG-TS PES packets in a temporary sync.Pool memory buffer.

Endpoints

1. Archive Master Playlist

  • URL: GET /hls/:id/archive.m3u8?file={filename}
  • Query Parameter: file (string, required): Filename in recordings/<id>/ directory.
  • Response: #EXTM3U playlist containing sequence-indexed .ts references.

2. Archive TS Segment

  • URL: GET /hls/:id/segment.ts?file={filename}&seq={index}
  • Query Parameters:
    • file: Recording filename.
    • seq: Segment index (0, 1, 2...).
  • Response: video/mp2t segment data.

Released under the MIT License.