CMAF

Once you complete your Media Services Live: CMAF Ingest setup, you need to configure your encoder to capture and push streams to the entrypoints.

Common Media Application Format (CMAF) is an MPEG specification that aims to provide a single encoding and packaging of segmented media objects for delivery and decoding on your devices in adaptive multimedia presentations.

Today, HLS specifies use of TS (transport stream) file containers, while DASH, although allowing TS, almost uniformly uses ISO Base Media File Format (ISOBMFF) in practice. To reach an HLS and DASH audience, content distributors must encode and store the same audio and video data twice - once wrapped in TS containers and again wrapped in ISOBMFF. The same files that have the same content, cost twice as much to package, twice as much to store on origin and compete on Akamai​Akamai​ edge caches for space, thus reducing the delivery efficiency. CMAF solves this problem and promotes the use of the same media segments in both HLS and DASH.

For a list of third-party live encoders and the latest software versions qualified with Media Services Live CMAF ingest, see Qualified Encoders (MSL 3.2 & MSL 4.x).

Publish CMAF streams

The encoder publishes primary and backup streams for the CMAF container file format according to this URL syntax.

StreamHostnamePathExample
Primaryp-ep{stream_id}.i.akamaientrypoint.net cmaf/{stream_id}/{event_name} http://p-ep50002.i.akamaientrypoint.net/cmaf/50002/test79/master.m3u8
Backupb-ep{stream_id}.i.akamaientrypoint.net cmaf/{stream_id}-b/{event_name} http://b-ep50002.i.akamaientrypoint.net/cmaf/50002-b/test79/master.m3u8

The stream ID must be identical between your primary and backup streams. You can find the stream ID in PORTAL_NAME on the Media Services Live Streams page.

The MSL system considers a stream as a combination of stream_idand event_name. All ingested content, such as variant playlists, bitrate playlists, and segments, should have a common event_namein the path.

📘

Ensure that you follow this requirement, or it might have an implication on billing.

For example:

http://p-ep50002.i.akamaientrypoint.net/cmaf/50002/test79/master.m3u8

http://p-ep50002.i.akamaientrypoint.net/cmaf/50002/test79/bitrate1234/playlistA.m3u8

http://p-ep50002.i.akamaientrypoint.net/cmaf/50002/test79/bitrate4567/playlistB.m3u8

http://p-ep50002.i.akamaientrypoint.net/cmaf/50002/test79/bitrate7891/playlistC.m3u8

http://p-ep50002.i.akamaientrypoint.net/cmaf/50002/test79/bitrate1234/segment00.ts

📘

To improve security and reduce potential vulnerabilities, ​Akamai​ will support TLS 1.2 and above in accordance with Internet Engineering Task Force recommendations.

Play CMAF streams

To play CMAF streams, construct the URL according to this syntax.

HLS

https://amd-property-hostname/cmaf/live/stream-id/event_name/master.m3u8

DASH

https://amd-property-hostname/cmaf/live/stream-id/event_name/file.mpd

The amd-property-hostname depends on the CDN that you use. For ​Akamai​ CDN, the hostname is origin.akamaized.net, so the Playback URL would be:

http(s)://origin.akamaized.net/cmaf/live/50002/test79/master.m3u8

or

http(s)://origin.akamaized.net/cmaf/live/50002/test79/file.mpd
StreamProtocolPathExample
PrimaryHLScmaf/live/[stream_id]/[event_name]/[filename].m3u8 http(s)://origin.akamaized.net/cmaf/live/50002/test79/master.m3u8
BackupHLScmaf/live/[stream_id]-b/[event_name]/[filename].m3u8 http(s)://origin.akamaized.net/cmaf/live/50002-b/test79/master.m3u8
PrimaryDASHcmaf/live/[stream_id]/[event_name]/[filename].mpd http(s)://origin.akamaized.net/cmaf/live/50002/test79/out.mpd
BackupDASHcmaf/live/[stream_id]-b/[event_name]/[filename].mpd http(s)://origin.akamaized.net/cmaf/live/50002-b/test79/out.mpd

Example .m3u8 file

The playback information is embedded in the variant .m3u8 file.


#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=648224,
RESOLUTION=640x360,CODECS="avc1.4d401e,mp4a.40.2"

http://origin.akamaized.net/cmaf/live/50002/test79/01.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=648224,
RESOLUTION=640x360,CODECS="avc1.4d401e,mp4a.40.2"

http://origin.akamaized.net/cmaf/live/50002-b/test79/01.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=443680,
RESOLUTION=400x224,CODECS="avc1.42e00d,mp4a.40.2"

http://origin.akamaized.net/cmaf/live/500002/test79/02.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=443680,
RESOLUTION=400x224,CODECS="avc1.42e00d,mp4a.40.2"

http://origin.akamaized.net/cmaf/live/50002-b/test79/02.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=956544,
RESOLUTION=640x720,CODECS="avc1.4d401f,mp4a.40.2"

http://origin.akamaized.net/cmaf/live/50002/test79/03.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=956544,
RESOLUTION=640x720,CODECS="avc1.4d401f,mp4a.40.2"

http://origin.akamaized.net/cmaf/live/50002-b/test79/03.m3u8

👍

To validate and test your streaming content, you can use: http://players.akamai.com/players.

Create a merged variant playlist

To create a merged playlist, you must extract the variant playlists from each encoder and manually merge them. For example, assume a primary variant playlist URL of:

http(s)://origin.akamaized.net/cmaf/live/50002/test79/master.m3u8

Start your encoder, and then use the UNIX curl command to acquire the variant playlist's contents.

curl http://origin.akamaized.net/cmaf/live/50002/test79/master.m3u8

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=165135
http://origin.akamaized.net/cmaf/live/50002/test79/iphone110.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=262346
http://origin.akamaized.net/cmaf/live/50002/test79/iphone200.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=481677
http://origin.akamaized.net/cmaf/live/50002/test79/iphone400.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=688301
http://origin.akamaized.net/cmaf/live/50002/test79/ipad600.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=894877
http://origin.akamaized.net/cmaf/live/50002/test79/ipad800.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1308077
http://origin.akamaized.net/cmaf/live/50002/test79/ipad1200.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=40000
http://origin.akamaized.net/cmaf/live/50002/test79/iphone110audio.m3u8

Notice that each line denotes a different bitrate.

Now, do the same for the backup variant playlist URL.

curl http://origin.akamaized.net/cmaf/live/50002-b/test79/master.m3u8

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=165135
http://origin.akamaized.net/cmaf/live/50002-b/test79/iphone110.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=262346
http://origin.akamaized.net/cmaf/live/50002-b/test79/iphone200.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=481677
http://origin.akamaized.net/cmaf/live/50002-b/test79/iphone400.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=688301
http://origin.akamaized.net/cmaf/live/50002-b/test79/ipad600.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=894877
http://origin.akamaized.net/cmaf/live/50002-b/test79/ipad800.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1308077
http://origin.akamaized.net/cmaf/live/50002-b/test79/ipad1200.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=40000
http://origin.akamaized.net/cmaf/live/50002-b/test79/iphone110audio.m3u8

Manually merge the contents of each of these files to produce the following:

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=165135
http://origin.akamaized.net/cmaf/live/50002/test79/iphone110.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=165135
http://origin.akamaized.net/cmaf/live/50002-b/test79/iphone110.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=262346
http://origin.akamaized.net/cmaf/live/50002/test79/iphone200.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=262346
http://origin.akamaized.net/cmaf/live/50002-b/test79/iphone200.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=481677
http://origin.akamaized.net/cmaf/live/50002/test79/iphone400.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=481677
http://origin.akamaized.net/cmaf/live/50002-b/test79/iphone400.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=688301
http://origin.akamaized.net/cmaf/live/50002/test79/ipad600.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=688301
http://origin.akamaized.net/cmaf/live/50002-b/test79/ipad600.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=894877
http://origin.akamaized.net/cmaf/live/50002/test79/ipad800.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=894877
http://origin.akamaized.net/cmaf/live/50002-b/test79/ipad800.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1308077
http://origin.akamaized.net/cmaf/live/50002/test79/ipad1200.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1308077
http://origin.akamaized.net/cmaf/live/50002-b/test79/ipad1200.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=40000
http://origin.akamaized.net/cmaf/live/50002/test79/iphone110audio.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=40000
http://origin.akamaized.net/cmaf/live/50002-b/test79/iphone110audio.m3u8

Notice that each bitrate in the list has a primary and a backup associated with it.

Finally, using the curl command, you post the file to the primary ingress URL. Posting to the backup is unnecessary, as the variant playlist need only be sent once during playback.

curl -T master.m3u8
http://p-ep50002.i.akamaientrypoint.net/cmaf/50002/test79/index.m3u8

Did this page help you?