In June of 2016, the committee draft of the Common Media Application Format (CMAF) specification was released, bringing the promise of a single format for use in the encoding and packaging of media. Around the same time, Apple announced that fragmented MP4 (fMP4) support would be part of their new HTTP Live Stream (HLS) specification.

Although these two events are interrelated, they are not exactly the same. We wrote about CMAF in an earlier blog, explaining that our Unified Origin and Unified Packager software solutions are already compatible with CMAF. We will use this blog to get into more detail about CMAF, how the Apple HLS announcement relates to it and how CMAF can be used within the Unified Streaming Platform.

What CMAF is and what it isn’t

An important thing to understand about CMAF is that it is a combination of currently available and tested tools from the MPEG body of technologies. The biggest advancement that’s part of CMAF isn’t technological, but political’: the biggest players in the industry, that used to advocate their own video protocols like HDS (Adobe), Smooth (Microsoft), HLS (Apple) and MPEG DASH, have agreed on the set of tools that CMAF consists of.

CMAF is a move towards a future with one video streaming format. Although that step is to be applauded, CMAF isn’t the uniform video streaming nirvana that some had hoped for. However, with software like Unified Origin, which takes a single source and seamlessly streams it to a wide a variety of playout formats, the lack of a truly uniform format is less of a burden than one might think.

With CMAF, the use of M2TS for video streaming is deprecated. This may be CMAF’s biggest step forward.

Like most current implementations of protocols like HDS, Smooth and MPEG DASH, the application format CMAF takes fragmented MP4 (fMP4) as its core. While the specifications of a protocol like MPEG DASH still allowed for the use of MPEG2 transport streams (M2TS), CMAF only leaves room for fMP4. Thus, the use of M2TS for video streaming is deprecated. This may be the biggest step forward that is taken with CMAF.

Although fMP4 has been the favored format for everyone but Apple for some time now, the user base of Apple’s iOS, macOS and tvOS remained too big to ignore. Now that Apple has finally embraced fMP4 for HLS, we can start to say a long goodbye to M2TS (M2TS will stick around for some time to support streaming to legacy Apple devices, as HLS with fMP4 is only supported from iOS 10, macOS 10.12 and tvOS 10 onwards).

Besides settling on the use of fMP4, CMAF prescribes some relatively explicit restrictions for authoring fMP4. Apart from specific video codecs, these restrictions call for the use of Common Encryption (CENC), audio in AAC, and subtitles in both WebVTT and ISMC1 formats. These standards are all supported by the Unified Streaming Platform. Overall, the restrictions that CMAF defines for authoring fMP4 concern the use of:

  • Segment format (fMP4)
  • Media profiles (specify codecs and their settings, like color subspace, bit-depth, resolution and frame/​sample rate)
  • Non-multiplexed and precisely aligned (synchronized) streams
  • Video codecs (AVC or HEVC)
  • Audio codecs (AAC, or optionally multi-channel)
  • Encryption (CENC: CBC or CTR)
  • Captions, subtitles (WebVTT or ISMC1)

Why it still won’t be one serves all

Like current video streaming protocols, the approach of CMAF consists of several layers. The encoded video forms the base of these layers (as displayed in Figure 1). In the case of CMAF, the video codec used can either be AVC or, with high resolution content like 4KHEVC.

The encryption forms the second layer. If encryption is used, CMAF offers the choice between CBC (Cipher Block Chain) or CTR (Counter Mode), both of which are part of the Common Encryption standard (CENC). The possibility to choose between these two options is also the most important factor in what makes CMAF less of a uniform format.

If you work with encrypted content and want to stream it to a wide audience, despite using CMAF, you will still need to stream out at least two varieties.

Like with the fMP4 versus M2TS battle from before CMAF, the need for two encryption options comes down to Apple choosing a different path than everyone else. DRM systems such as Widevine, PlayReady and Marlin all use CTR, while Apple’s FairPlay calls for CBC. The fact that both are part of CENC may make it seem like CBC and CTR are easily interchangeable, but they’re not, because both represent fundamentally different ways of encrypting content.

The choice between CTR and CBC regarding encryption means that, if you work with encrypted content and want to stream it to a wide audience, despite using CMAF, you will still need to stream out at least two varieties. One variety for Apple devices using FairPlay DRM with CBC encryption, another using a DRM of your choice with CTR encryption. Not taking on the fly encryption into consideration for the moment (as is possible with Unified Origin), this means storing all of your content on disk twice.

Figure 1: Layers of CMAF

A part of the CMAF specification that we already discussed comes in the form of the third layer in Figure 1: a single container format, fMP4 (and thus, the deprecation of M2TS for video streaming). While fMP4 has been widely used as a container for video streaming for some time, by protocols like the aforementioned Adobe’s HDS, Microsoft’s Smooth and MPEG DASH, it’s only with CMAF that all of these parties have settled on a set of specific restrictions to author it (along with Apple, who just joined the fMP4 bandwagon).

The fourth and last layer is the Adaptive Protocol, which comes in the form of a manifest (or playlist). This small file is downloaded by the client on the user side when the user starts streaming a video, and informs the client about the location of the video segments and other details concerning the video. It’s a technique that is used by all current video streaming protocols.

CMAF doesn’t specify a specific manifest, but is built to work with an MPEG DASH-manifest or HLS-playlist. As these files are very small, the need to use both isn’t a problem storage-wise, but it’s further proof that, although CMAF certainly is big step forward, it’s less of a uniform format than some may make it seem to be.

Unified Streaming’s compatibility with CMAF

Because the core of the CMAF specification consists of fMP4, which is the preferred ingest format for Unified Packager and Unified Origin, the Unified Streaming Platform will have no problem working with CMAF and will stream it for playout in all of the different protocols that we support.

As we are currently working on the implementation of the newest HLS specification, playout to all Apple devices will still take the form of M2TS encoded HLS. This is true whether or not CMAF is used as the ingest media format. Considering the fact that such a stream is needed to support Apple legacy devices and because the end user will notice no discernible difference, we do not think that this is a big concern.

With its capacity to decrypt and re-encrypt content on the fly, Unified Origin takes care of CMAF’s DRM disadvantages. 

Besides its general compatibility with CMAF, there’s a huge benefit of using Unified Origin to stream encrypted content when working with CMAF. This benefit comes in the form of the ability to TransDRM content while streaming. This means that the Origin will decrypt the content on the fly, and re-encrypt it again in the encryption format of your choice (doing this on the fly as well).

As explained earlier on in this blog, one of the down sides of CMAF is that you will still need to offer at least two varieties of your stream when working with encrypted content. In the most straightforward scenario, this would force you to store all of your content on disk twice. Using Unified Origin with TransDRM, this isn’t necessary as you will be able to stream CBC encrypted CMAF as well as CTR encrypted CMAF using only one source.

Furthermore, as Unified Packager is compatible with CMAF as well, you can use it to repackage your current content into CMAF. Although we offer this possibility, it’s not something that we advise you to do at the moment, as the CMAF specification won’t be finalized before the third quarter of 2017 and changes may still be implemented.

To sum up, CMAF offers some interesting and important advancements in the realm of video streaming. Its main advantage is that it offers greater compatibility by bringing together all of the big players in video streaming to actually support one container storage format: fMP4. It may not be truly uniform for the reasons explained in this blog, but for the parts that it isn’t, Unified Origin’s compatibility with CMAF will make sure that this won’t cause you any trouble.

Unified Streaming is a leading supplier of video streaming and packaging software worldwide and part of the Dutch delegation to the MPEG consortium that is currently defining the CMAF specification.