Skip to content

Core Architectural Concepts & Terminology ​

To get the most out of RUSEON Core, it helps to understand the fundamental video engineering and systems architecture concepts powering its engine.


1. Transmuxing vs. Transcoding ​

  • Transcoding: Decompresses compressed video into raw uncompressed pixels (YUV/RGB), modifies/rescales them, and recompresses them using an encoder. Requires massive CPU/GPU power.
  • Transmuxing (Zero-Transcoding): Takes existing compressed video packets (NAL units) and changes only the outer container envelope (e.g. from RTSP RTP payloads into MP4 atoms or WebRTC RTP packets) without touching pixel data. Reduces CPU overhead by over 90%.

2. NAL Units & Codec Parameter Sets (SPS / PPS / VPS) ​

Compressed video is structured as a sequence of NAL (Network Abstraction Layer) Units:

  • SPS (Sequence Parameter Set): Describes video dimensions, profile, level, and aspect ratio.
  • PPS (Picture Parameter Set): Contains entropy coding and slice group parameters.
  • VPS (Video Parameter Set): Used in H.265 (HEVC) for multi-layer video sequences.

RUSEON Core intercepts and caches these parameter sets using atomic.Pointer[CodecParams] inside the Ring Buffer, ensuring newly connected WebRTC and HLS clients can initialize their hardware decoders instantly without waiting for the camera's next periodic parameter broadcast.


3. GOP (Group of Pictures) & KeyFrames (I-Frames vs. P-Frames) ​

  • I-Frame (KeyFrame / IDR): A complete, self-contained standalone image. Decodable without reference to any other frame.
  • P-Frame (Predicted Frame): Contains only the difference (delta motion vectors) relative to previous frames. Much smaller in size.
  • GOP (Group of Pictures): The distance between two consecutive I-Frames. A 25 fps stream with a 2-second GOP sends 1 I-Frame followed by 49 P-Frames.
text
[ I-Frame ] ---> [ P-Frame ] ---> [ P-Frame ] ---> ... ---> [ Next I-Frame ]
  ▲
  └── Client playback and recording segments ALWAYS start on an I-Frame!

4. Fragmented MP4 (fMP4) Architecture ​

Unlike monolithic MP4 files that store index metadata in a trailing moov atom at the very end of the file, Fragmented MP4 (fMP4) divides the recording into independent self-contained movie fragments (moof + mdat pairs):

  • Crash Resilience: If a server loses power during recording, all flushed fragments are already valid.
  • Zero Finalization Overhead: Files are closed instantly without rewriting the header.

5. WHEP (WebRTC HTTP Egress Protocol) ​

WHEP (IETF RFC draft) is a standardized lightweight HTTP signaling protocol for consuming WebRTC media streams:

  • The browser sends a simple HTTP POST containing an SDP Offer.
  • The server responds with HTTP 200 OK containing its SDP Answer and ICE candidates.
  • Media begins flowing immediately over UDP with sub-500ms latency.

Released under the MIT License.