Skip to main content

Overview

CMAF (Common Media Application Format) is a standardized media format that enables efficient delivery of streaming content. It uses fragmented MP4 (fMP4) containers that can be packaged for both HLS and DASH, reducing storage and encoding costs.

Key Benefits

  • Unified workflow: Single encode for HLS and DASH
  • Reduced storage: One set of media files for multiple protocols
  • Lower latency: Smaller chunks enable faster delivery
  • Better codec support: Native support for HEVC, AV1, VP9
  • Efficient: Reduced CDN costs and bandwidth usage
  • Standards-based: ISO BMFF/MP4 format

How CMAF Works

CMAF uses fragmented MP4 (fMP4) containers that can be delivered via:
  • HLS with fMP4: Apple devices, browsers
  • DASH: Android, browsers, smart TVs
  • MSE (Media Source Extensions): Modern browsers

Enabling CMAF in Ant Media Server

Configuration

CMAF is enabled through HLS with fMP4 segments:

Publishing for CMAF

Playing CMAF Streams

HLS with fMP4 (CMAF)

DASH (CMAF)

Low Latency CMAF (LL-DASH / LL-HLS)

Configuration for Ultra-Low Latency

LL-DASH Player Configuration

CMAF Structure

File Organization

HLS Playlist (CMAF)

DASH Manifest (CMAF)

Advanced Features

HEVC/H.265 Support

CMAF has excellent HEVC support:

Common Encryption (CENC)

CMAF supports DRM:

Troubleshooting

Playback Issues

Initialization Segment Missing:
Codec Compatibility:
Segment Timing Issues:

Performance Optimization

Best Practices

Production Recommendations

  1. Use fMP4: Set hlsSegmentType=fmp4 for CMAF benefits
  2. Consistent GOP: Set fixed keyframe interval (e.g., 2 seconds)
  3. Short fragments: Use 0.2-0.5s fragments for low latency
  4. CDN optimization: Enable CORS, set appropriate cache headers
  5. Monitor segment generation: Track timing and availability
  6. Test across devices: Verify HLS and DASH playback

Quality Settings

CMAF vs Traditional Formats

Migration Guide

From Traditional HLS to CMAF

Benefits:
  • 30-40% storage reduction
  • Better HEVC support
  • Unified HLS/DASH workflow

Resources