• How to configure Apple HLS packetization (cupertinostreaming)

    This article describes properties in Wowza Streaming Engine™ media server software that you can use to control how the Cupertino segmenter splits streams into segments suitable for playback on Apple HLS compatible clients.

    Note: Wowza Streaming Engine 4.0.0 or later is required.

    Contents


    Wowza Streaming Engine Manager configuration
    XML configuration
    More resources

    Wowza Streaming Engine Manager configuration


    You can configure the properties that control how the Cupertino segmenter splits streams in Wowza Streaming Engine™ Manager. Use Streaming Engine Manager to manage the Wowza Streaming Engine media server software.

    Configure properties for live streams

    1. In the manager Welcome page, click the Applications tab at the top of the page.

    2. In the Applications contents panel, click the name of your live application (such as live).

    3. On the live application page Properties tab, click Cupertino Streaming Packetizer in the Quick Links bar.

      Note: Access to the Properties tab is limited to administrators with advanced permissions. For more information, see Manage credentials.


    4. Click Edit in the Cupertino Streaming Packetizer properties area. To enable a property, select the Enabled check box for the property. You can also change the value for an enabled property from its default setting. All time values are in milliseconds and the values are set on a per-application basis. Refer to the Cupertino segmenter property reference below for more information about the individual properties you can use to manage the Cupertino segmenter for live streams.



    5. Click Save, and then restart the application when prompted to apply the changes.

    Note: For more information about how to configure properties, see Configure properties. This article shows how to access and adjust default properties and how to add custom properties in Streaming Engine Manager.

    Cupertino segmenter property reference

    • cupertinoChunkDurationTarget - Sets the duration of each chunk in milliseconds. If you're using Origin/Edge configuration this will need to be set on the Origin and Edges with matching values.

    • cupertinoMaxChunkCount - Sets the maximum number of chunks stored in the available chunk list.

    • cupertinoPlaylistChunkCount - Sets the number of items returned in the playlist.

    • cupertinoRepeaterChunkCount - Sets the number of chunks that are immediately sent from the origin to the edge after initial connection and is configured on the origin. This property is only required for use with Live Edge applications. A live edge application will have a StreamType of liverepeater-edge in the Application.xml file.

    Property details


    Audio and video packets from a live encoder enter the Wowza media server and are segmented into time-based chunks. The duration of each chunk (in milliseconds) is controlled by the cupertinoChunkDurationTarget setting. As the chunks are created, they're added to the available chunk list. The maximum number of chunks stored in the available chunk list is controlled by the cupertinoMaxChunkCount setting. When an iOS device requests the stream, a playlist is returned that contains the [n] most recently added chunks. The number of items returned in the playlist ([n]) is controlled by the cupertinoPlaylistChunkCount setting.

    A live stream repeater is a system that's used to deliver a single live stream in an origin/edge configuration to multiple edge servers. The first time an edge server requests the stream, it pulls the previously segmented chunks from the origin to the edge for delivery to an iOS device. The cupertinoRepeaterChunkCount setting controls the number of chunks that are immediately sent from the origin to the edge after initial connection. It's best if this setting is equal to or greater than cupertinoPlaylistChunkCount but less then cupertinoMaxChunkCount. With Wowza Streaming Engine 4.5.0.02 and later, if you set the cupertinoRepeaterChunkCount to a value that is equal to or less than 0, the cupertinoPlaylistChunkCount value is used.

    Notes:
    • Chunks must start on a keyframe, so it's best to use a keyframe interval that's a factor of the cupertinoChunkDurationTarget setting. For example, if cupertinoChunkDurationTarget is set to 10 seconds, use a keyframe interval of either 2, 2.5, 5, or 10 seconds.

    • To estimate how much memory is used to store the chunks for a single live stream, use the following formula:

      [total-memory-mb] = ([stream-bitrate-kbps]/([1024-kb-per-mb]*[8-bits-per-byte])) * [cupertinoChunkDurationTarget-seconds] * [cupertinoMaxChunkCount]

      For example, a 500 kbps stream consumes the following amount of memory, given the default settings above:

      (500/(1024*8)) * 10 * 10 = 6 MB of memory

    • You can add the cupertinoCalculateChunkIDBasedOnTimecode property to turn on chunk ID numbering based on incoming packet time. To do this, do the following:

      1. On the live application page Properties tab, click Custom in the Quick Links bar.

      2. In the Custom section, click Edit.

      3. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:

        • Path - Select /Root/LiveStreamPacketizers.

        • Name - Enter cupertinoCalculateChunkIDBasedOnTimecode.

        • Type - Select Boolean.

        • Value - To start Apple HLS chunk IDs at 0, enter false. To calculate Apple HLS chunk IDs based on the incoming live stream timecodes, enter true. (Use this mode to synchronize chunk IDs between two servers that packetize the same live stream.)

      4. Click Save, and then restart the application when prompted to apply the changes.

    Configure property for VOD streams

    You can control the video on demand (VOD) chunk size by adding the cupertinoChunkDurationTarget property to your VOD application configuration.

    1. In the manager Welcome page, click the Applications tab at the top of the page.

    2. In the Applications contents panel, click the name of your live application (such as vod).

    3. On the VOD application page Properties tab, click Custom in the Quick Links bar.

      Note: Access to the Properties tab in Streaming Engine Manager is limited to administrators with advanced permissions. For more information, see Manage credentials.
    4. In the Custom area, click Edit.

    5. Click Add Custom Property, specify the following custom property settings in the Add Custom Property dialog box, and then click Add.

      1. In Path, select /Root/Application/HTTPStreamer.

      2. In Name, enter cupertinoChunkDurationTarget.

      3. In Type, select Integer.

      4. In Value, enter a value (in milliseconds) to specify the default VOD chunk size.

    6. Click Save, and then restart the application when prompted to apply the custom property.

    XML configuration


    If you configured the properties in Wowza Streaming Engine Manager, you can skip this section. If you make changes to [install-dir]/conf/[application]/Application.xml and you're using the Wowza Streaming Engine media server software, any supported settings are displayed in the manager the next time it's started. Wowza Media Server™ software doesn't support Wowza Streaming Engine Manager, so you must edit Application.xml in a text editor if you're running Media Server software.

    Configure properties for live streams

    1. Use a text editor to open the Application.xml file for your live application. Then add the properties described in the Cupertino segmenter property reference above to the <LiveStreamPacketizer>/<Properties> container. Be sure to add the properties to the correct <Properties> container in Application.xml as there are several such containers in the file.
      <Property>
      	<Name>cupertinoChunkDurationTarget</Name>
      	<Value>10000</Value>
      	<Type>Integer</Type>
      </Property>
      <Property>
      	<Name>cupertinoMaxChunkCount</Name>
      	<Value>10</Value>
      	<Type>Integer</Type>
      </Property>
      <Property>
      	<Name>cupertinoPlaylistChunkCount</Name>
      	<Value>3</Value>
      	<Type>Integer</Type>
      </Property>
      <Property>
      	<Name>cupertinoRepeaterChunkCount</Name>
      	<Value>-1</Value>
      	<Type>Integer</Type>
      </Property>
      <Property>
      	<Name>cupertinoCalculateChunkIDBasedOnTimecode</Name>
      	<Value>false</Value>
      	<Type>Boolean</Type>
      </Property>
    2. Restart the Wowza media server software to apply the changes.

    Configure property for VOD streams

    1. Open the Application.xml file for your VOD application using a text editor and then add the cupertinoChunkDurationTarget property to the <HTTPStreamer>/<Properties> container. Be sure the to add the properties to the correct <Properties> container in Application.xml as there are several such containers in the file.
      <Property>
      	<Name>cupertinoChunkDurationTarget</Name>
      	<Value>10000</Value>
      	<Type>Integer</Type>
      </Property>
    2. Restart the Wowza media server software to apply the changes.

    More resources


    See the following articles about advanced Apple HLS packetization properties:



    Originally Published: 10-01-2010.
    Updated: For Wowza Streaming Engine 4.5.0.02 on 10-05-2016.

    If you're having problems or want to discuss this article, post in our forum.