Overview

MediaX is a real-time video streaming library implementing industry-standard protocols for defence and industrial applications.

Architecture

MediaX Architecture

Standards Compliance

MediaX implements the following standards:

Standard Description
RFC 4421 RTP Payload Format for Uncompressed Video (RGB24, YUV422, Mono8/16)
RFC 3984 RTP Payload Format for H.264 Video
RFC 7798 RTP Payload Format for H.265/HEVC Video
RFC 2435 RTP Payload Format for JPEG-compressed Video (libjpeg)
RFC 2326 Real Time Streaming Protocol (RTSP) client for IP cameras
RFC 8216 HTTP Live Streaming (HLS) client, MPEG-TS segments with H.264, AES-128 and audio
draft-sharabayko-srt Secure Reliable Transport (SRT) for lossy links such as drones
Google Cast (CASTv2) Chromecast discovery (mDNS) and casting of H.264 as live HLS
RFC 3550 RTP / RTCP receiver reports, jitter and loss statistics
RFC 2974 Session Announcement Protocol (SAP)
RFC 4566 Session Description Protocol (SDP)
AIA GigE Vision 2.x Industrial camera discovery (GVCP) and streaming (GVSP)
EMVA GenICam 3.x Camera XML device description (SFNC)
DEF STAN 00-082 VIVOE — Video and Imagery over Ethernet for Defence (GVA/GSA)

Key Components

RTP Payloader/Depayloader

Handles packetization and depacketization of video frames for network transmission.

  • Supports multiple colorspaces (RGB24, YUV422, Mono8, Mono16)
  • Hardware acceleration for H.264/H.265
  • Configurable packet sizes and timing

RTSP Receiver

Pulls video from IP cameras and RTSP servers (see the RTSP Receiver guide).

  • RTSP control plane (RtspClient) with UDP, multicast and TCP interleaved transport
  • Basic and Digest authentication, RTCP receiver reports, keep-alive and automatic reconnect
  • RtspDepayloader is a drop-in RtpDepayloader that decodes the stream
  • ProbeRtspStream() checks whether a stream is live without playing it

HLS Receiver

Plays HLS streams (see the HLS Receiver guide).

  • HlsDepayloader is a drop-in RtpDepayloader for .m3u8 master and media playlists with MPEG-TS H.264 segments
  • Variant selection, live playlist refresh, redirects, buffering and real-time pacing
  • AES-128 encrypted streams (EXT-X-KEY) are decrypted, which needs OpenSSL
  • Audio (AAC, MP3, AC-3) is passed to RegisterAudioCallback() as PCM or encoded data, speaker output is up to the application. hls-player is an SDL2 example with sound

SRT Video

Sends and receives H.264, H.265 and AV1 video over SRT, a UDP protocol that recovers lost packets within a fixed latency (see the SRT guide). Suited to drone and other radio links.

  • Latency from 100 to 500 ms, constant while the link is healthy, with retransmission, too-late packet drop and paced sending
  • Caller, listener and rendezvous modes, automatic reconnect
  • Optional AES-128/192/256 encryption (OpenSSL)
  • SrtDepayloader is a drop-in RtpDepayloader, SrtTransmitter sends access units from any encoder
  • AV1 is carried in MPEG-TS as private PES data (AV01 registration descriptor), between MediaX endpoints; the RTP to SRT gateway is H.264 and H.265 only
  • Native implementation with no libsrt dependency, interoperable with libsrt based tools

Chromecast Casting

Detects Chromecasts on the network and casts H.264 video to them (see the Chromecast guide).

  • CastDiscovery lists the devices found with multicast DNS, CastSender casts to one
  • The video is served to the device as live HLS by a built-in HTTP server, which only talks to the device being cast to
  • Casts MediaX encoder output (so test cards), any Annex B H.264 source, or a SAP announced RTP stream
  • Native implementation with no Cast SDK, OpenSSL is used only for the TLS control connection

SAP/SDP Announcer/Listener

Automatic stream discovery on the network.

  • Periodic SAP announcements (1 second interval)
  • SDP session descriptions with stream metadata
  • Multicast group management

Video Renderer

Display video using various backends:

  • SDL2 (recommended, cross-platform)
  • GTK4 (Linux desktop)
  • Frame buffer (headless systems)

Language Bindings

  • C++17 - Native API
  • Python - SWIG bindings for AI/ML integration
  • Qt6 - GUI application development

Colourspace Conversion

Convert between pixel formats with CPU scalar, AVX2 SIMD (auto-detected), and CUDA GPU implementations:

  • RGB24 ↔ YUV422, RGBA, BGRA, Mono8
  • Bayer demosaic (RGGB / GRBG / GBRG / BGGR) → RGB24
  • RGB24 → Bayer raw (CFA packing)
  • Image scaling (bilinear)

Use Cases

  • Defence vehicle video systems (GVA/VIVOE)
  • Industrial machine vision with GigE Vision cameras
  • Broadcast and surveillance
  • AI/ML video processing pipelines

Support