Streaming Formats¶
MediaX supports multiple video encoding formats for different use cases.
Format Comparison¶
| Encoder | Format | AMD | Intel | Jetson | ARM64 | Notes |
|---|---|---|---|---|---|---|
| RGB24 | Uncompressed | ✅ | ✅ | ✅ | ✅ | RFC 4175 |
| YUV422 | Uncompressed | ✅ | ✅ | ✅ | ✅ | RFC 4175 |
| Mono8 | Uncompressed | ✅ | ✅ | ✅ | ✅ | RFC 4175 |
| Mono16 | Uncompressed | ✅ | ✅ | ✅ | ✅ | RFC 4175 |
| OpenH264 | H.264 | ✅ | ✅ | ✅ | ✅ | Cisco software encoder |
| VAAPI | H.264/H.265 | ✅ | ✅ | ❌ | ❌ | Intel/AMD hardware only |
| NVENC | H.264 | ✅ | ✅ | ❌ | ❌ | NVIDIA desktop GPUs (GTX/RTX) |
| Jetson V4L2 | H.264 | ❌ | ❌ | ✅ | ❌ | Jetson Orin AGX/NX native V4L2 M2M |
| AV1 (VAAPI) | AV1 | ✅ | ✅ | ❌ | ❌ | Intel 12th gen+ / AMD RDNA2+ |
GigE Vision Pixel Formats¶
GigE Vision uses pixel format codes defined in the GVSP specification (Appendix A). All formats below are supported by mediax::gige::GigEDevice and mediax::gige::GigEReceiver.
GvspPixelFormat |
Code | Description | Bytes/px | Standard |
|---|---|---|---|---|
kMono8 |
0x01080001 |
8-bit monochrome | 1 | GigE Vision 2.x / PFNC |
kMono16 |
0x01100007 |
16-bit monochrome (big-endian) | 2 | GigE Vision 2.x / PFNC |
kRgb8 |
0x02180014 |
24-bit RGB, 8 bits/channel | 3 | GigE Vision 2.x / PFNC |
kBayerGr8 |
0x01080008 |
8-bit Bayer, GR phase | 1 | GigE Vision 2.x / PFNC |
kBayerRg8 |
0x01080009 |
8-bit Bayer, RG phase | 1 | GigE Vision 2.x / PFNC |
kBayerGb8 |
0x0108000A |
8-bit Bayer, GB phase | 1 | GigE Vision 2.x / PFNC |
kBayerBg8 |
0x0108000B |
8-bit Bayer, BG phase | 1 | GigE Vision 2.x / PFNC |
kYcbcr422_8 |
0x0210003B |
YCbCr 4:2:2, 8-bit YUYV | 2 | GigE Vision 2.x / PFNC |
See the GigE Vision user guide for full device and receiver API details.
Uncompressed Formats¶
Best for low-latency, high-quality video where bandwidth is available.
RGB24¶
24-bit RGB color, 8 bits per channel.
stream_info.encoding = mediax::rtp::ColourspaceType::kColourspaceRgb24;
Bandwidth: ~221 Mbps at 1080p30
YUV422¶
YCbCr 4:2:2 color sampling, commonly used in broadcast.
stream_info.encoding = mediax::rtp::ColourspaceType::kColourspaceYuv422;
Bandwidth: ~166 Mbps at 1080p30
Mono8¶
8-bit grayscale, used for thermal and infrared cameras.
stream_info.encoding = mediax::rtp::ColourspaceType::kColourspaceMono8;
Bandwidth: ~50 Mbps at 1080p30
Mono16¶
16-bit grayscale, higher dynamic range for scientific imaging.
stream_info.encoding = mediax::rtp::ColourspaceType::kColourspaceMono16;
Bandwidth: ~99 Mbps at 1080p30
Compressed Formats¶
Use when bandwidth is limited or for storage efficiency.
H.264¶
Most widely supported compressed format.
// Using Intel VAAPI
mediax::RtpSapTransmit<mediax::rtp::h264::vaapi::RtpH264VaapiPayloader> rtp(...);
// Using OpenH264 software encoder
mediax::RtpSapTransmit<mediax::rtp::h264::openh264::RtpH264OpenH264Payloader> rtp(...);
Bandwidth: 2-20 Mbps (configurable)
H.265 (HEVC)¶
Better compression than H.264, requires more processing.
mediax::RtpSapTransmit<mediax::rtp::h265::vaapi::RtpH265VaapiPayloader> rtp(...);
Bandwidth: 1-10 Mbps (configurable)
AV1¶
Newest codec, excellent compression, royalty-free. Native VAAPI backend (Intel 12th gen+ / AMD RDNA2+):
#include "av1/vaapi/rtp_av1_vaapi_payloader.h"
mediax::rtp::av1::vaapi::RtpAv1VaapiPayloader payloader;
Runtime Codec Discovery¶
Use the CodecQuery API to discover available codecs at runtime:
#include "rtp/codec_query.h"
#include <iostream>
int main() {
// Print a summary of all codecs
mediax::rtp::CodecQuery::PrintCodecSummary();
// Check what is actually usable on this machine
auto available = mediax::rtp::CodecQuery::GetAvailableCodecs();
std::cout << "Available codecs: " << available.size() << "\n";
// Quick backend check before creating a payloader
if (mediax::rtp::CodecQuery::IsBackendAvailable("vaapi")) {
std::cout << "VAAPI hardware acceleration is available\n";
}
// List only hardware encoders
for (const auto& c : mediax::rtp::CodecQuery::GetHardwareCodecs()) {
std::cout << c.name << " [" << (c.available ? "ready" : "unavailable") << "]\n";
}
return 0;
}
See the C++ API Reference for the full CodecQuery API.
Choosing a Format¶
| Use Case | Recommended Format |
|---|---|
| Low latency (<10ms) | Uncompressed (RGB24/YUV422) |
| Bandwidth limited | H.264 or H.265 |
| Thermal cameras | Mono8 or Mono16 |
| Scientific imaging | Mono16 |
| Long-term storage | H.265 or AV1 |
| Maximum compatibility | H.264 |
| Industrial cameras | GigE Vision (RGB8, Mono8, Bayer, YCbCr422) |
Support¶
Need help choosing a format?
- Website: https://astutesys.com/support
- Email: support@astutesys.com