Stream using a CMAF live stream repeater in Wowza Streaming Engine

With Wowza Streaming Engine™ media server software version 4.7.8 or later, you can stream using a CMAF live stream repeater (origin/edge) configuration. A live stream repeater uses origin and edge servers to deliver a live stream at scale to viewers. 

If you aren't familiar with the general concepts of a Wowza Streaming Engine live stream repeating system, see Scale with Wowza Streaming Engine live stream repeater. This workflow supports streaming Low-Latency HLS content over the live stream repeater.

Configure the CMAF live application on the origin server


The steps in this section can be used to create and configure the CMAF live stream repeater application on the origin server. We recommend using Wowza Streaming Engine Manager to accomplish this task. The user interface approach reduces complexity and the need to manipulate values manually in the Application.xml file. However, if you prefer a more programmatic approach, you can use the XML instructions.

Set up the origin server application with Wowza Streaming Engine Manager

Follow these steps to set up a CMAF live stream repeater application on the origin server with the Wowza Streaming Engine Manager user interface.

  1. In Wowza Streaming Engine Manager, create a Live origin application named liveorigin. See Create applications
  2. When creating your application, select MPEG-DASH and/or Apple HLS from Playback Types to enable playback from the origin server. Additionally, enable the CMAF Packetizer, then save your application settings.
  3. (Optional) If you plan to enable CMAF packetization for LL-HLS delivery, add this custom property to your application:
    • Set Name to cmafLLEnableLowLatency.
    • Set Type to Boolean.
    • Set Value to true.
  4. Save the custom property and restart your application for changes to take effect.
  5. In Wowza Streaming Engine, go to Server > Source Authentication and ensure you've added a source username and password. This action establishes authentication to secure RTMP-based and RTSP-based source connections to the server.
  6. Restart Wowza Streaming Engine.

Set up the origin server application using XML

Follow these steps to set up a CMAF live stream repeater application on the origin server using XML.

  1. On the origin server, create the application folder [install-dir]/applications/liveorigin.
  2. Create the configuration folder [install-dir]/conf/liveorigin and copy [install-dir]/conf/Application.xml to this new folder.
  3. Open the application-level Application.xml file in the [install-dir]/conf/liveorigin directory.
  4. Set the Name and AppType properties:
<Name>liveorigin</Name>
<AppType>Live</AppType>
  1. Set the StreamType property to live:
<StreamType>live</StreamType>
 
  1. Add the cmafstreamingpacketizer to the LiveStreamPacketizers property. You can add it to the prepopulated comma-separated list, or you can add it as the only packetizer specified. For a workflow that delivers only CMAF streams, the XML looks like this:
<Streams>
    ...
    <LiveStreamPacketizers>cmafstreamingpacketizer</LiveStreamPacketizers>
    ...
</Streams>
 
  1. (Optional) If you plan to enable CMAF packetization for LL-HLS delivery, see Enable LL-HLS in Wowza Streaming Engine XML.

  1. (Optional) If you want to enable playback from the origin server, set the HTTPStreamers property, to one or both of the following playback types you'd like to use: HLS (cupertinostreaming) and MPEG-DASH (mpegdashstreaming). If using both, the XML looks like this:
<HTTPStreamers>cupertinostreaming, mpegdashstreaming</HTTPStreamers>
 
  1. Save your changes.
  2. Edit the [install-dir]/conf/publish.password file and add a publisher user name and password that will be used to control RTMP and RTSP publishing access. The following example shows the file with myPublisherName and myPassword:
# Publish password file (format [username][space][password])
# username password
myPublisherName myPassword
 
  1. Restart Wowza Streaming Engine.

Configure the CMAF live edge application on the edge servers


The steps in this section can be used to create and configure the CMAF live stream repeater application on each edge server. We recommend using Wowza Streaming Engine Manager to accomplish this task. The user interface approach reduces complexity and the need to manipulate values manually in the Application.xml file. However, if you prefer a more programmatic approach, you can use the XML instructions.

Set up the edge server application with Wowza Streaming Engine Manager

Follow these steps to set up a CMAF live stream repeater application on each edge server with the Wowza Streaming Engine Manager user interface.

  1. In Wowza Streaming Engine Manager, create a Live Edge application named liveedge. See Create applications.
  2. When creating your application, select MPEG-DASH and/or Apple HLS from Playback Types to enable playback from the origin server. Additionally, enable the CMAF Packetizer and add a Primary Origin URL for the origin server. For redundancy, you can also define a Secondary Origin URL. Then, save your application settings.
  3. (Optional) If you plan to enable CMAF packetization for LL-HLS delivery, add this custom property to your application:
    • Set Path to /Root/Application/LiveStreamPacketizer.
    • Set Name to cmafLLEnableLowLatency.
    • Set Type to Boolean.
    • Set Value to true.
  4. Save the custom property and restart your application for changes to take effect.
  5. In Wowza Streaming Engine, go to Server > Source Authentication and ensure you've added a source username and password. This action establishes authentication to secure RTMP-based and RTSP-based source connections to the server.
  6. Restart Wowza Streaming Engine.

Set up the edge server application using XML

Follow these steps to set up a CMAF live stream repeater application on each edge server using XML.

  1. Create the application folder [install-dir]/applications/liveedge.
  2. Create the configuration folder [install-dir]/conf/liveedge and copy [install-dir]/conf/Application.xml to this new folder.
  3. Open the application-level Application.xml file in the [install-dir]/conf/liveedge directory.
  4. Set the Name and AppType properties:
<Name>liveedge</Name>
<AppType>LiveEdge</AppType>
  1. Set the StreamType property to liverepeater-edge:
<StreamType>liverepeater-edge</StreamType>
 
  1. Specify the cmafstreamingrepeater repeater packetizer on each Wowza Streaming Engine edge server. This enables CMAF live stream repeater for iOS-based devices and DASH-compatible players. To specify the repeater packetizer, add cmafstreamingrepeater to the LiveStreamPacketizers property:​​
<Streams>
    ...
    <LiveStreamPacketizers>cmafstreamingrepeater</LiveStreamPacketizers>
    ...
</Streams>
	

  1. (Optional) If you plan to enable CMAF packetization for LL-HLS delivery, see Enable LL-HLS in Wowza Streaming Engine XML.

  1. For the HTTPStreamers property, specify one or both of the following playback types you'd like to use: HLS (cupertinostreaming) and MPEG-DASH (mpegdashstreaming). If using both, the XML looks like this:
<HTTPStreamers>cupertinostreaming, mpegdashstreaming</HTTPStreamers>
 
  1. Locate the Repeater/OriginURL element and add the origin server URL:
<Repeater>
    <OriginURL>wowz://[wowza-origin-address]:1935/liveorigin</OriginURL>
    <QueryString><![CDATA[]]></QueryString>
</Repeater>

For redundancy, you can define multiple Wowza Streaming Engine origin servers for a single stream by specifying two origin URLs separated by the pipe ( | ) character. For example:

<Repeater>
    <OriginURL>wowz://[wowza-origin-address]:1935/liveorigin|wowz://[wowza-alternate-origin-address]:1935/backuporigin</OriginURL>
    <QueryString><![CDATA[]]></QueryString>
</Repeater>

All origin URLs must use the wowz, wowzs, rtmp, or rtmps prefix.

  1. Restart Wowza Streaming Engine.

Important: If you use wowzs to address the origin server, be aware of the following requirements for SSL encryption:

  • The SSL certificate must be from a certificate authority (see Request an SSL certificate for Wowza Streaming Engine from a certificate authority). Self-signed certificates aren't supported. Wowza StreamLock™ certificates are fully supported (see Get SSL certificates for Wowza Streaming Engine from the StreamLock service).
  • You must specify the domain name when addressing the origin server. The origin IP address can't be used.
  • If you don't specify a port value when addressing the origin server, port 443 is used.
  • The live stream repeater will fail to connect to a non-SSL-protected destination port on the origin server. It will repeatedly try to connect. Connection failures like the following will be reported in the Wowza Streaming Engine logs:

    WARN server comment - LiveMediaStreamReceiver.secureConnectionValidation: SSL Connection was not established: wowzs://[address]:1935/liveedge/_definst_/myStream

The above setup defines a single Wowza Streaming Engine origin server per application. Each stream that's played through that application uses the OriginURL value to locate the Wowza Streaming Engine origin server for the stream.

Notes:
  • If the primary Wowza Streaming Engine origin server fails, clients may experience up to a 12-second timeout before failover to the backup origin server is completed. Use the above method only for failover purposes.
     
  • WOWZ is a TCP-based messaging protocol used for Wowza Streaming Engine server-to-server communication. It's enabled by default. If one of the Wowza Streaming Engine servers in the origin/edge configuration is running an earlier version of the software, an RTMP connection is established between the servers instead.
     
  • The origin server must have the Adobe RTMP playback type enabled so that edge server(s) can connect using WOWZ, WOWZS, RTMP or RTMPS.

Test playback from a CMAF live stream repeater


When the camera or encoder is connected to the liveorigin application on the origin server and the live stream is active, you can preview CMAF playback using a supported test player.

Test CMAF HLS stream playback

To test CMAF-packetized HLS live streams generated from CMAF live repeater applications, use the Akamai HLS test player.

Specify the stream playback URL using the format: 

http://[wowza-edge-address]:[port]/[application-name]/[application-instance]/[stream-name]/playlist.m3u8

Where:

  • [wowza-edge-address] is the IP address or domain of the Wowza Streaming Engine edge server (default port 1935)
  • [application-name] is the application name
  • [application-instance] is the name of the application instance (if omitted, defaults to _definst_)
  • [stream-name] is the stream name

For example, the playlist URL for a CMAF HLS stream that uses the Wowza Streaming Engine edge server address example.com/edge, an application named liveedge, and the default stream name myStream is:

http://example.com/edge:1935/liveedge/myStream/playlist.m3u8

Note: You can also test playback from the origin server by substituting [wowza-origin-address]  and liveorigin in the playback URLs.

Test CMAF MPEG-DASH stream playback

To test CMAF-packetized MPEG-DASH live streams generated from CMAF live repeater applications, you can use the MPEG-DASH test player on the Video Test Players webpage, which is based on the Shaka Player library.

Note: Alternatively, you can test CMAF DASH playback using Akamai's DASH.js test player.

  1. On the Video Test Players webpage, click the MPEG-DASH tab.
  2. Enter the CMAF DASH playback URL for your stream using the format:

http://[wowza-edge-address]:[port]/[application-name]/[application-instance]/[stream-name]/manifest.mpd

Where:

  • [wowza-edge-address] is the IP address or domain of the Wowza Streaming Engine edge server (default port 1935)
  • [application-name] is the application name
  • [application-instance] is the name of the application instance (if omitted, defaults to _definst_)
  • [stream-nameis the stream name

For example, the playback URL for an MPEG-DASH stream that uses the Wowza Streaming Engine edge server address example.com/edge, an application named liveedge, and the default stream name myStream is: 

http://example.com/edge:1935/liveedge/myStream/manifest.mpd 

  1. Click Start.

Secure encryption keys for MPEG-DASH CENC live repeater


Wowza Streaming Engine supports MPEG-DASH streaming in a live repeater configuration. Common Encryption (CENC) can be applied to CMAF MPEG-DASH streams.

When MPEG-DASH streams are encrypted with CENC in a live repeater configuration, the origin instance is configured to acquire the encryption keys, and the DASH chunks are built and encrypted on the edge instances. This requires that the AES-128 encryption keys used in the CENC encryption are sent from the origin to the edge instances. Wowza Streaming Engine performs extra encryption on the key information to secure this transmission, using the liveRepeaterEncryptionSharedSecret property. This property provides a unique encryption key for each stream the origin serves. The default shared secret can be used, or you can define your own Custom Property on the application properties page.

Add the shared secret property using the XML configuration

  1. Go to [install-dir]/conf/liveorigin/.
     
  2. Open Application.xml in a text editor.
     
  3. In the child element Properties of the Application element, add the liveRepeaterEncryptionSharedSecret property.
    <Property>
        <Name>liveRepeaterEncryptionSharedSecret</Name>
        <Type>String</Type>
        <Value>[mySecret]</Value>
    </Property>
  4. Restart Wowza Streaming Engine.
     
  5. Repeat these steps on each Wowza Streaming Engine edge server (using the XML file in the liveedge directory).

More resources