In the rapidly evolving landscape of video streaming, content providers face the challenge of delivering high-quality video across various devices and network conditions. The emergence of Common Media Application Format (CMAF) has revolutionized video delivery by providing a single format that can be efficiently streamed to both HLS and MPEG-DASH compatible devices. This article explores the benefits, limitations, market presence, and legacy device support of CMAF format, along with a practical example of its implementation using Bento4 and Shaka Packager.

What is CMAF?

Common Media Application Format (CMAF) is a unified media format developed by the industry to simplify video streaming. It combines the best of both HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (MPEG-DASH) into a single format. CMAF achieves this by utilizing fragmented MP4 (fMP4) files, which are compatible with both HLS and MPEG-DASH players. By using CMAF, content providers can reduce storage costs and streamline their encoding and packaging workflows.

Benefits of CMAF

  1. Simplicity and Efficiency: CMAF simplifies video delivery by eliminating the need for separate HLS and MPEG-DASH formats. It allows content providers to store and deliver a single set of media files, reducing storage costs and complexity in the content preparation pipeline.
  2. Improved Streaming Experience: CMAF optimizes video streaming by supporting chunked transfer encoding, which enables faster start times and reduced latency. It also facilitates more efficient adaptive streaming, ensuring smooth playback across varying network conditions.
  3. Compatibility: CMAF’s compatibility with both HLS and MPEG-DASH enables content providers to reach a wide range of devices, including smartphones, tablets, smart TVs, and web browsers. This compatibility simplifies cross-platform content delivery and enhances the user experience.

CMAF Implementation with Bento4 and Shaka Packager

Bento4 and Shaka Packager are widely adopted tools for implementing CMAF workflows. Bento4 is an open-source C++ class library that enables the generation and manipulation of fragmented MP4 files, while Shaka Packager is also an open-source media packaging and encryption tool.

Bento4 Example:

mp4dash --use-segment-timeline --hls 1080.mf4 720.mf4 480.mf4 360.mf4

Description
The above example will take inputs of 4 resolutions fragmented mp4 and pack them in cmaf format.

Shaka Example:

./shakapackager   in=1080.mf4,stream=audio,init_segment=output/audio/init.mp4,playlist_name=output/audio/stream.m3u8,iframe_playlist_name=output/audio/iframe.m3u8,segment_template='output/audio/$Number$.m4s' \ in=144.mf4,stream=video,init_segment='output/144/init.mp4',playlist_name=output/144/stream.m3u8,iframe_playlist_name=output/144/iframe.m3u8,segment_template='output/144/segment_$Number$.m4s' \
in=240.mf4,stream=video,init_segment='output/240/init.mp4',playlist_name=output/240/stream.m3u8,iframe_playlist_name=output/240/iframe.m3u8,segment_template='output/240/segment_$Number$.m4s' \
in=480.mf4,stream=video,init_segment='output/480/init.mp4',playlist_name=output/480/stream.m3u8,iframe_playlist_name=output/480/iframe.m3u8,segment_template='output/480/segment_$Number$.m4s' \
in=720.mf4,stream=video,init_segment='output/720/init.mp4',playlist_name=output/720/stream.m3u8,iframe_playlist_name=output/720/iframe.m3u8,segment_template='output/720/segment_$Number$.m4s' \
in=1080.mf4,stream=video,init_segment='output/1080/init.mp4',playlist_name=output/1080/stream.m3u8,iframe_playlist_name=output/1080/iframe.m3u8,segment_template='output/1080/segment_$Number$.m4s' \
--segment_duration 6 \
--generate_static_live_mpd \
--mpd_output output/stream.mpd \
--hls_master_playlist_output output/master.m3u8

Description
Takes 1 audio input and 5 video as input and produce cmaf output.

Note. Both example will produce non-drm versions, that means no encryption is applied to segments. Please comment/contact if you need to know about DRM encryption and its packaging.

Pros and Cons of CMAF

Pros:

  • Simplifies video delivery with a single format for HLS and MPEG-DASH.
  • Reduces storage costs by eliminating the need for separate formats.
  • Optimizes video streaming through chunked transfer encoding, leading to faster start times and reduced latency.
  • Enables efficient adaptive streaming, ensuring smooth playback across varying network conditions.
  • Enhances cross-platform compatibility, allowing content providers to reach a wide range of devices and browsers.
  • Simplifies content preparation workflows by streamlining encoding and packaging processes.
  • Supports Common Encryption (CENC) and Digital Rights Management (DRM) for content protection.

Cons:

  • Limited support on legacy devices: Some older devices or outdated versions of players may not fully support CMAF, requiring fallback mechanisms or additional transcoding for compatibility.
  • Increased complexity in implementation: While CMAF offers streamlined video delivery, its adoption may require adjustments to existing encoding and packaging workflows, necessitating familiarity with CMAF specifications and tools like Bento4 and Shaka Packager.

Market Presence

CMAF has gained significant traction in the streaming industry since its introduction. Major content providers, including Netflix, Apple, and Microsoft, have embraced CMAF as a standardized format for their streaming services. This wide adoption ensures compatibility across a diverse range of devices and platforms, contributing to a consistent streaming experience for viewers.

Furthermore, leading media streaming frameworks, such as Google’s Shaka Player and Apple’s AVFoundation, have integrated CMAF support, making it easier for developers to implement CMAF-based solutions.

CMAF’s market presence is further strengthened by the support of industry consortia, including the Streaming Video Alliance and the DASH Industry Forum, which actively promote CMAF and contribute to its evolution.

Legacy Device Support

While CMAF offers broad compatibility, legacy device support can pose challenges. Older devices or outdated player versions may lack full CMAF support, requiring fallback mechanisms. Content providers must consider these devices in their target audience and implement alternative delivery methods for compatibility.

To address legacy device support, adaptive streaming technologies like Dynamic Adaptive Streaming over HTTP (DASH) or HTTP Live Streaming (HLS) can be utilized as fallback options alongside CMAF. This approach ensures that older devices can still access the content, albeit with a potentially reduced streaming experience.

Content providers should analyze their audience demographics and device usage statistics to determine the extent of legacy device support required. It’s crucial to strike a balance between optimizing for modern devices using CMAF and accommodating older devices through fallback mechanisms.

Conclusion

CMAF, with its ability to deliver video content efficiently across multiple platforms, has emerged as a pivotal format in the streaming industry. It simplifies workflows, improves streaming performance, and enhances cross-device compatibility. By leveraging tools like Bento4 and Shaka Packager, content providers can easily adopt CMAF and benefit from its features. While legacy device support remains a consideration, CMAF’s market presence continues to grow, driven by industry-wide adoption and the support of key players. As the future of video streaming unfolds, CMAF’s role in delivering high-quality content seamlessly across devices is set to become increasingly prominent.

Thanks for reading

Leave a Reply

Your email address will not be published. Required fields are marked *