CMAF
After completing your MSL5: CMAF Ingest setup, configure your encoder to capture and push streams to the entry points.
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 the 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 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.
CMAF Publishing URL
URL Syntax for publishing primary and backup streams
The encoder publishes primary and backup streams for the CMAF container file format according to this URL syntax. The {stream_id}
and {event_name}
placeholders correspond to the stream_id
and event_name
configured in the Stream entity.
Stream | Hostname | Path | Example |
---|---|---|---|
Primary | p-ep{stream_id}.i.harmonicincentrypoint.net | {stream_id}/{event_name} | http(s)://p-ep50002.i.harmonicincentrypoint.net/9dbd53ba-ac76-45a1-9581-a4c1737f85c5/event1/master.m3u8 |
Backup | b-ep{stream_id}.i.harmonicincentrypoint.net | {stream_id}-b/{event_name} | http(s)://b-ep50002.i.harmonicincentrypoint.net/9dbd53ba-ac76-45a1-9581-a4c1737f85c5-b/event1/master.m3u8 |
In Backup URLs, note the -b
in the path.
URL Syntax for publishing segments
Segment type | Naming convention |
---|---|
Initialization Segments | Contains `$RepresentationID$` and `init` |
Media Segments | Contains `$RepresentationID$` and `$Number$` |
Stream | Hostname | Path | Example |
---|---|---|---|
Primary | p-ep{stream_id}.i.harmonicincentrypoint.net | {stream_id}/{event_name} | http(s)://p-ep50002.i.harmonicincentrypoint.net/9dbd53ba-ac76-45a1-9581-a4c1737f85c5/event1/$RepresentationID$_Segment-$Number$.mp4 |
Backup | b-ep{stream_id}.i.harmonicincentrypoint.net | {stream_id}-b/{event_name} | http(s)://b-ep50002.i.harmonicincentrypoint.net/9dbd53ba-ac76-45a1-9581-a4c1737f85c5-b/event1/$RepresentationID$_Segment-$Number$.mp4 |
In Backup URLs, note the -b
in the path.
Authentication
The Stream entity's publishing.authentication
configuration object dictates the authentication requirements for publishing. If enabled, the encoder MUST include appropriate HTTP Digest Authentication headers with each request.
Transport considerations
- PUT or POST requests: Encoders should be capable of uploading generated content, video segments, and playlist/manifest files using multiple PUT or POST requests. Each segment should be uploaded in a separate request. Use a persistent connection for these requests.
- Chunked Transfer Encoding: With chunked transfer encoding (CTE), the encoder sends data to the origin in a series of chunks instead of waiting until the complete segment is available. CTE is available in HTTP 1.1. In CTE, each chunk is preceded by its size in bytes. The transmission ends when a zero-length chunk is received. To upload files more efficiently use HTTP chunked transfer encoding.
CMAF Playback URL
URL Syntax for playing primary and backup streams
The following URLs are used for playback. The {stream_id}
and {event_name}
placeholders correspond to the stream's configuration.
Stream | Protocol | Path | Example |
---|---|---|---|
Primary | HLS | cmaf/live/{stream_id}/{event_name}/{filename}.m3u8 | http(s)://origin.harmonicinczed.net/cmaf/live/9dbd53ba-ac76-45a1-9581-a4c1737f85c5/event1/index.m3u8 |
Backup | HLS | cmaf/live/{stream_id}-b/{event_name}/{filename}.m3u8 | http(s)://origin.harmonicinczed.net/cmaf/live/9dbd53ba-ac76-45a1-9581-a4c1737f85c5-b/event1/index.m3u8 |
Primary | DASH | cmaf/live/{stream_id}/{event_name}/{filename}.mpd | http(s)://origin.harmonicinczed.net/cmaf/live/9dbd53ba-ac76-45a1-9581-a4c1737f85c5/event1/index.mpd |
Backup | DASH | cmaf/live/{stream_id}-b/{event_name}/{filename}.mpd | http(s)://origin.harmonicinczed.net/cmaf/live/9dbd53ba-ac76-45a1-9581-a4c1737f85c5-b/event1/index.mpd |
In Backup URLs, note the -b
in the path.
Authentication
Playback authentication is controlled by the Stream entity's playback
configuration. Currently, only Akamai G2O authentication is supported. If enabled, downstream CDN must include valid G2O tokens when requesting content.
Archiving
The Stream entity's archiving
configuration manages content archiving:
- Automatic Purge: If set, content is automatically purged after the specified number of
retention_days
.
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
2 http://p-ep50002.i.akamaientrypoint.net/cmaf/50002/test79/index.m3u8
Updated about 1 month ago