Fix unaligned video and audio with a server-side sort buffer in Wowza Streaming Engine

To resolve unaligned video and audio in a Wowza Streaming Engine™ media server software live application stream, create and configure a server-side sort buffer.

You can configure the sort buffer properties in Wowza Streaming Engine Manager or by editing [install-dir]/conf/[application]/Application.xml. If you make changes to Application.xml, any supported settings are displayed in Wowza Streaming Engine Manager the next time it's started.

Configure a server-side sort buffer in Wowza Streaming Engine Manager


  1. Click the Applications tab at the top of the page.
     
  2. In the Applications contents panel, click the name of your live application.
     
  3. On the application page Properties tab, click Streams 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 Streams properties area.
  5. Select the Enabled check box next to sortPackets and set the value to true.
  6. Select the Enabled check box next to sortBufferSize and set the value to 750.
  7. Click Save, and then restart the application when prompted to apply the changes.

Configure a server-side sort buffer in Application.xml


  1. Use a text editor to open the [install-dir]/conf/[application]/Application.xml file for your live application and add the following property to the <Streams>/<Properties> container. Be sure to add the properties to the correct <Properties> container in Application.xml as there are several in the file.
<Property>
    <Name>sortPackets</Name>
    <Value>true</Value>
    <Type>Boolean</Type>
</Property>
<Property>
    <Name>sortBufferSize</Name>
    <Value>750</Value>
    <Type>Integer</Type>
</Property>
  1. Restart Wowza Streaming Engine to apply the changes. 

Verify the sort buffer configuration


After the stream is first published, check the access log file in [install-dir]/logs to verify that the sorting buffer is configured properly. You should see a statement that looks like this:

sortPackets[1]: sortBufferSize:750

You can also search for the keyword sortPackets in the Logs feature in Wowza Streaming Engine Manager to confirm proper configuration.

If you don't see this in the logs, make sure that you put the properties in the correct <Properties> container and that they're not commented out.

Note: You can also try to reduce the video stream complexity. If the video stream is encoded using Main Profile, try Baseline Profile instead. Sometimes more complex H.264 encodes that use complex B-frame structures can cause the video stream to be out-of-sync with the audio during playback.