• How to debug AAC or MP3 timecode issues with Apple HLS packetization

    This article describes how to set up an application that will log information about how Wowza™ media server software uses AAC and MP3 timecodes to debug time drift issues.

    Notes:
    • Wowza Streaming Engine™ 4.0 or later is required.

    • This article describes a debugging method only. It won't correct any drift problems that are identified by using this additional logging.

    Contents


    Prerequisites
    Wowza Streaming Engine Manager configuration
    XML configuration
    Checking packet timecode values

    Prerequisites


    Based on the encoder type, follow one of these tutorials to set up an application for live streaming:

    How to publish and play a live stream (RTMP based encoder)
    How to publish and play a live stream (RTSP/RTP based encoder)
    How to publish and play a live stream (MPEG-TS based encoder)
    How to publish and play a live stream (native RTP encoder with SDP file)
    How to re-stream video from an IP camera (RTSP/RTP re-streaming)

    Ensure that Apple HLS is enabled in the Playback Types in the application for which you're configuring these properties.

    Start the server in standalone mode (not as a system service). This is required because the debug statements are written to the console and not to the Wowza logs. For instructions, see How to start and stop Wowza Streaming Engine software.

    Wowza Streaming Engine Manager configuration


    You can configure the properties that control Apple HLS streaming in Wowza Streaming Engine™ Manager. The Streaming Engine Manager is used to manage the Wowza Streaming Engine media server software.

    Configure properties for live streams

    1. In the Streaming Engine 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. These properties are set on a per-application basis. Both debugAACTimecodes and debugMP3Timecodes have a default value of false.



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

    XML configuration


    For versions of Wowza Media Server™ , you'll need to edit the [install-dir]/conf/[application]/Application.xml file by using a text editor. Add the following properties to the LiveStreamPacketizer/Properties container. Be sure the to add the properties to the correct <Properties> container on Application.xml. There are several in the file.
    <Property>
    	<Name>debugAACTimecodes</Name>
    	<Value>true</Value>
    	<Type>Boolean</Type>
    </Property>
    <Property>
    	<Name>debugMP3Timecodes</Name>
    	<Value>true</Value>
    	<Type>Boolean</Type>
    </Property>

    Checking packet timecode values


    With these properties in place, you should now see statements written to the console window:
    tc[difference]: [calculatedTimecode]:[packetTimecode]:[sampleRate]
    What we're doing here is comparing the packet timecode values to a calculated time that's based on the assumption that there are no missing samples and that each packet contains 1024 samples. If there's no drift between the encoder clock and the AAC or MP3 clock, then the [difference] number should be 0 or 1. If there is a drift, then you'll see [difference] numbers greater than 1.

    Originally Published: 11-21-2011.
    Updated: For Wowza Streaming Engine 4.2 on 06-28-2015.

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