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:Performance Optimization
Best Practices
Production Recommendations
- Use fMP4: Set
hlsSegmentType=fmp4for CMAF benefits - Consistent GOP: Set fixed keyframe interval (e.g., 2 seconds)
- Short fragments: Use 0.2-0.5s fragments for low latency
- CDN optimization: Enable CORS, set appropriate cache headers
- Monitor segment generation: Track timing and availability
- Test across devices: Verify HLS and DASH playback
Quality Settings
CMAF vs Traditional Formats
| Feature | CMAF | HLS (TS) | DASH (TS) |
|---|---|---|---|
| Container | fMP4 | MPEG-TS | MPEG-TS or fMP4 |
| Storage | Single | Separate | Separate |
| HEVC Support | Excellent | Limited | Good |
| Latency | Low | Medium | Medium |
| Browser Support | Good | Excellent | Good |
| Unification | Yes | No | No |
Migration Guide
From Traditional HLS to CMAF
- 30-40% storage reduction
- Better HEVC support
- Unified HLS/DASH workflow
Resources
- CMAF Specification
- Apple HLS Authoring
- DASH Industry Forum
- Ant Media Server Enterprise Edition for LL-CMAF support
