AV1 Video

AV1 royalty-free video codec for next-generation streaming.

Overview

AV1 is a modern, open-source video codec offering:

  • Better compression than H.265
  • Royalty-free licensing
  • Growing hardware support
  • HDR and wide color gamut support

Trade-offs

Aspect H.264 H.265 AV1
Compression Good Better Best
Encoding Speed Fast Medium Slow
Royalties Yes Yes No
Hardware Support Universal Common Emerging

Backend

MediaX provides a native VAAPI AV1 backend:

Backend Dependency Encode Decode Hardware Required
Native VAAPI libva only Intel 12th gen+ / AMD RDNA2+

Native VAAPI Backend

Direct libva integration. Uses VAProfileAV1Profile0 for hardware encode/decode.

Requirements:

  • libva development libraries (libva-dev)
  • Intel 12th gen+ (decode & encode) or Intel 11th gen (decode only)
  • AMD RDNA2+ (decode) or RDNA3+ (encode)
  • Build with LIBVA_FOUND detected by CMake

Note

Check hardware support with vainfo 2>&1 | grep -i av1. If no AV1 entries appear, your GPU does not support AV1 VAAPI.

Transmit (Native VAAPI)

#include "av1/vaapi/rtp_av1_vaapi_payloader.h"

mediax::rtp::av1::vaapi::RtpAv1VaapiPayloader payloader;

mediax::rtp::StreamInformation stream_info;
stream_info.session_name = "av1-vaapi-stream";
stream_info.hostname = "239.192.1.1";
stream_info.port = 5004;
stream_info.width = 1920;
stream_info.height = 1080;
stream_info.framerate = 30;
stream_info.encoding = mediax::rtp::ColourspaceType::kColourspaceAv1;

payloader.SetStreamInfo(stream_info);

// Optional: configure encoder
mediax::rtp::av1::vaapi::VaapiAv1EncoderConfig config;
config.bitrate = 4000000;
config.keyframe_interval = 30;
config.qp = 30;
payloader.SetEncoderConfig(config);

payloader.Open();
payloader.Start();

std::vector<uint8_t> rgb_buffer(1920 * 1080 * 3);
// Fill buffer with video frame...
payloader.Transmit(rgb_buffer.data(), true);

payloader.Stop();
payloader.Close();

Receive (Native VAAPI)

#include "av1/vaapi/rtp_av1_vaapi_depayloader.h"

mediax::rtp::av1::vaapi::RtpAv1VaapiDepayloader depayloader;

mediax::rtp::StreamInformation stream_info;
stream_info.hostname = "239.192.1.1";
stream_info.port = 5004;
stream_info.width = 1920;
stream_info.height = 1080;
stream_info.encoding = mediax::rtp::ColourspaceType::kColourspaceAv1;

depayloader.SetStreamInfo(stream_info);
depayloader.Open();
depayloader.Start();

mediax::rtp::RtpFrameData frame_data;
if (depayloader.Receive(&frame_data, 1000)) {
  // frame_data.cpu_buffer contains decoded RGB24 data
  // frame_data.resolution.width / height contain actual dimensions
}

depayloader.Stop();
depayloader.Close();

Runtime Detection

Check whether the hardware supports AV1 VAAPI before opening:

if (mediax::rtp::av1::vaapi::RtpAv1VaapiPayloader::IsVaapiAvailable()) {
  // Use native VAAPI AV1
} else {
  // Fall back to another codec
}

Bandwidth Requirements

AV1 provides excellent compression:

Resolution Quality H.265 Bitrate AV1 Bitrate
1920x1080 Good 4 Mbps 2-3 Mbps
1920x1080 High 10 Mbps 6-8 Mbps
3840x2160 Good 15 Mbps 10-12 Mbps
3840x2160 High 30 Mbps 20-25 Mbps

Hardware Acceleration

Intel (12th gen+)

# Intel media drivers with AV1 support
sudo apt install intel-media-va-driver-non-free libva-dev

# Verify AV1 support
vainfo 2>&1 | grep -i av1

Intel AV1 VAAPI support:

Generation Decode Encode
11th gen (Tiger Lake)
12th gen (Alder Lake)
13th gen (Raptor Lake)
14th gen+
Arc GPUs

AMD RDNA2+ / RDNA3+

# AMD drivers
sudo apt install mesa-va-drivers libva-dev

# Verify
vainfo 2>&1 | grep -i av1

AMD AV1 VAAPI support:

Generation Decode Encode
RDNA2 (RX 6000)
RDNA3 (RX 7000)
RDNA3.5+

Use Cases

AV1 is ideal for:

  • 4K/8K streaming: Best compression for ultra-high resolution
  • Cloud gaming: Low bandwidth, high quality
  • Archival: Royalty-free long-term storage
  • WebRTC: Browser-native support

Limitations

  • Encoding is computationally intensive
  • Hardware support is limited to newer devices
  • Higher latency than H.264/H.265

For real-time, low-latency applications, consider H.264 or uncompressed video.

Support