FAQ

Frequently asked questions about MediaX.

General

What is MediaX?

MediaX is a C++ library for real-time video streaming over RTP networks. It supports uncompressed and compressed video formats with optional hardware acceleration.

What standards does MediaX support?

  • DEF STAN 00-082 - UK Defence Standard for video over IP
  • RFC 4175 - RTP Payload Format for Uncompressed Video
  • RFC 6184 - RTP Payload Format for H.264 Video
  • RFC 7798 - RTP Payload Format for HEVC Video
  • RFC 5371 - RTP Payload Format for JPEG 2000
  • RFC 2327 - Session Description Protocol (SDP)
  • RFC 2974 - Session Announcement Protocol (SAP)

What platforms are supported?

  • Ubuntu 22.04 LTS (AMD64)
  • Ubuntu 24.04 LTS (AMD64)
  • Raspbian (ARM64 - Raspberry Pi 4/5)
  • Other Linux distributions (build from source)

Is MediaX open source?

Yes, MediaX is open source. See the LICENSE file for details.

Video Formats

Which video format should I use?

Use Case Recommended Format
Lowest latency Uncompressed (RGB24, YUV422)
Limited bandwidth H.264 or H.265
Best compression AV1
Frame-accurate editing JPEG 2000
Grayscale sensors Mono8 or Mono16

What's the difference between RGB24 and YUV422?

  • RGB24: 3 bytes per pixel, best for computer graphics
  • YUV422: 2 bytes per pixel (33% smaller), standard for video

Most cameras output YUV. RGB is better for rendering and display.

How much bandwidth do I need?

Uncompressed video bandwidth formula:

Bandwidth = Width × Height × Bytes_per_pixel × FPS × 8 bits

Examples:

Format Resolution FPS Bandwidth
RGB24 1920×1080 30 1.49 Gbps
YUV422 1920×1080 30 995 Mbps
H.264 1920×1080 30 5-10 Mbps

Networking

What IP addresses should I use?

For multicast streaming, use addresses in these ranges:

  • 239.192.0.0/16 - Organization-local (recommended)
  • 239.255.0.0/16 - Site-local

Example: 239.192.1.1

For unicast, use the receiver's IP address directly.

What ports should I use?

Use even-numbered ports above 1024. Common choices:

  • 5004 (default for many RTP applications)
  • 5006, 5008, 5010 (additional streams)

RTP uses even ports; RTCP uses the next odd port.

Does MediaX support unicast?

Yes. Set the hostname to the receiver's IP address instead of a multicast address.

Can multiple receivers view the same stream?

Yes, using multicast. All receivers join the same multicast group and receive the same stream without additional bandwidth on the sender.

Hardware Acceleration

What hardware acceleration is supported?

Technology Vendor Codecs
VAAPI Intel, AMD H.264, H.265, AV1
NVENC NVIDIA H.264, H.265
V4L2 Raspberry Pi H.264

How do I enable hardware acceleration?

Hardware acceleration is automatic when available. Verify with:

# VAAPI
vainfo

# NVIDIA
nvidia-smi

What if hardware acceleration isn't available?

MediaX falls back to software encoding/decoding. This uses more CPU but works on any system.

Python Bindings

How do I install Python bindings?

Python bindings are included when building with -DBUILD_PYTHON=ON.

They install to /usr/local/lib/python3/dist-packages/mediax/.

Why do I need sys.path.append?

The install location isn't in Python's default path. Add it before importing:

import sys
sys.path.append('/usr/local/lib/python3/dist-packages')
import mediax

Can I use MediaX with NumPy?

Yes. Convert NumPy arrays to bytes for transmission:

import numpy as np
frame = np.zeros((480, 640, 3), dtype=np.uint8)
payloader.Transmit(frame.tobytes(), True)

Convert received bytes back to NumPy:

frame = np.frombuffer(buffer, dtype=np.uint8).reshape((480, 640, 3))

Qt6 Integration

What Qt6 modules are required?

  • Qt6 Widgets
  • Qt6 Multimedia

Can I use MediaX with QML?

The current bindings are for Qt Widgets. QML integration requires wrapping the C++ classes as QML types.

SAP/SDP

What is SAP?

Session Announcement Protocol (SAP) broadcasts stream availability on the network. Receivers can discover streams automatically without manual configuration.

How often are SAP announcements sent?

By default, every 1 second. This is configurable.

Can I disable SAP?

Yes. Simply don't create a SapAnnouncer. Receivers will need manual stream configuration instead.

Performance

What's the maximum resolution supported?

MediaX has no hard limit. Practical limits depend on:

  • Network bandwidth
  • CPU/GPU processing power
  • Memory for frame buffers

4K (3840×2160) and 8K (7680×4320) are achievable with appropriate hardware.

What's the typical latency?

Format Typical Latency
Uncompressed < 1 frame (33ms @ 30fps)
JPEG 2000 1-2 frames
H.264 2-5 frames
H.265 3-6 frames

Actual latency depends on network conditions and buffering.

How many streams can run simultaneously?

Limited by:

  • Network bandwidth
  • CPU/GPU resources
  • File descriptors (OS limit)

Tens of streams are typical on modern hardware.

Support

Have more questions?