• How to troubleshoot live streaming

    Here is a brief list of suggestions for troubleshooting common live streaming issues:


    Video and Audio out of Sync
    Poor Video and Audio Quality
    MPEG-TS/RTP UDP Packet Loss Remedies
    MPEG-TS Missing Audio
    MPEG-TS Missing or Garbage Video
    Native RTP, MPEG-TS, RTSP/RTP or SHOUTcast/Icecast re-stream stream goes down
    Incoming Multicast Streams Interference
    How to reduce delay before video starts playing back


    Video and Audio out of Sync


    Try inserting a server side sort buffer. Edit [install-dir]/conf/[application]/Application.xml (where [application] is the name of the application you have configured for streaming) and add the following two properties to the Streams/Properties container (be sure you add these properties to the correct <Properties> container, there are several in this configuration file):

    Code:
    <Property>
        <Name>sortPackets</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>
    <Property>
        <Name>sortBufferSize</Name>
        <Value>750</Value>
        <Type>Integer</Type>
    </Property>
    To verify the sorting buffer is configured properly check the log file. You should see a statement that looks like this when the stream is first published. If you do not see this in the logs, then go back and double check to be sure you put the properties in the correct Properties container and that they are not commented out:

    Code:
    sortPackets[1]: sortBufferSize:750
    You can also try reducing the complexity of the video stream. If the video stream is Main profile try Baseline. Sometimes more complex H.264 encodes which utilize complex B-frame structures can cause the stream video to play out of sync from the audio.


    Poor Video and Audio Quality

    (native RTP, MPEG-TS over RTP or RTSP/RTP streaming only)
    Poor video and audio quality when streaming using RTP over UDP can be caused by packet loss or packets being delivered out of order. Follow this article describing How to turn on an RTP jitter buffer and packet loss logging (RTP and MPEG-TS). This method will not work for MPEG-TS streaming unless the stream is wrapped in RTP.



    MPEG-TS/RTP UDP Packet Loss Remedies


    If think you might be having packet loss issues with an incoming MPEG-TS or RTP stream that is being delivered over UDP or Multicast, try making the following server adjustments:
    1. First be sure you are running the most recent patch: Development Builds
    2. Be sure the server is properly tuned (always very, very important) by following the How to do performance tuning article.
    3. Edit [install-dir]/conf/VHost.xml and change the RTP/DatagramConfiguration/Incoming section to this:
      Code:
      <DatagramConfiguration>
          <Incoming>
              <ReuseAddress>true</ReuseAddress>
              <ReceiveBufferSize>2048000</ReceiveBufferSize>
              <SendBufferSize>65000</SendBufferSize>
              <!-- <MulticastBindToAddress>true</MulticastBindToAddress> -->
              <!-- <TrafficClass>0</TrafficClass> -->
              <MulticastTimeout>50</MulticastTimeout>
              <DatagramMaximumPacketSize>8192</DatagramMaximumPacketSize>
          </Incoming>
          <Outgoing>
              ...
          </Outgoing>
      </DatagramConfiguration>



    MPEG-TS Missing Audio


    Some MPEG-TS based encoders send unaligned AAC packets. To instruct Wowza Media Server to properly deal with these unaligned AAC packets edit [install-dir]/conf/[application]/Application.xml (where [application] is the name of the application you have configured for streaming) and add the following property to the RTP/Properties container (be sure you add these properties to the correct <Properties> container, there are several in this configuration file):

    Code:
    <Property>
        <Name>audioIsAligned</Name>
        <Value>false</Value>
        <Type>Boolean</Type>
    </Property>


    MPEG-TS Missing or Garbage Video


    For use with Wowza Server 3. Some MPEG-TS based encoders send unaligned video packets. To instruct Wowza Server to properly deal with these unaligned video packets edit [install-dir]/conf/[application]/Application.xml (where [application] is the name of the application you have configured for streaming) and add the following property to the RTP/Properties container (be sure you add these properties to the correct <Properties> container, there are several in this configuration file):

    Code:
    <Property>
        <Name>videoIsAligned</Name>
        <Value>false</Value>
        <Type>Boolean</Type>
    </Property>


    Native RTP, MPEG-TS, RTSP/RTP or SHOUTcast/Icecast re-stream stream goes down


    If you have an native RTP or MPEG-TS stream that frequently goes down and you want Wowza Media Server to monitor the stream and reconnect when it becomes available you can set the MediaCaster/Property streamTime. To do this, edit [install-dir]/conf/[application]/Application.xml and add the following properties to the MediaCaster/Properties container (there are several containers in the file be sure to get the right one):

    Code:
    <Property>
        <Name>streamTimeout</Name>
        <Value>12000</Value>
        <Type>Integer</Type>
    </Property>
    This will instruction Wowza Media Server to monitor the incoming stream and if it goes away for longer 8 seconds it will attempt to reconnect to the stream. This property is specified in milliseconds.



    Incoming Multicast Streams Interference


    If you are having problems with multiple incoming multicast streams interfering with each other on Linux you may need to set the Java property java.net.preferIPv4Stack to true. To do this, edit [install-dir]/bin/setenv.sh and uncomment the following line (line 13):

    Code:
    JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"


    How to reduce delay before video starts playing back


    • Increase FPS to speed up the playback start time. A Flash RTMP client waits for a key frame and at least 60 frames before playback begins.
    • Another way is through adding properties to your Application.xml configuration. You can speed up playback start time at the expense of increasing latency. Use this method if a quick start time is important and increasing latency is not important. With this method, the result will be that streaming will start further behind the live point. Use of these properties requires experimentation and testing. It will force more video data into the initial response from Wowza Media Server which will speed up playback start time. If low latency is important to your workflow, do not use this method.

      Add the following properties to Streams/Properties container in conf/[application]/Application.xml:
      Code:
      <Property>
           <Name>instantOn</Name>
           <Value>true</Value>
           <Type>Boolean</Type>
      </Property>
      <Property>
           <Name>instantOnBufferTime</Name>
           <Value>3000</Value>
           <Type>Integer</Type>
      </Property>



    Comments 11 Comments
    1. bitsbits -
      I'm evaluating MPEG-TS/UDP streaming using the provided sample live streaming flash object. It appears that if TS packets do not get delivered for few seconds (less than 10 sec), video fast forwards for multiple seconds after delivery resumes. But after more than 14 sec or so, the fast forwarding does not occur. Is there anyway to tweak this so that video does not fast forward? Is it even Wowza's doing or is it the flash object? I've played with StreamTimeout property. It does not seem to help. Can you help?

      Does Wowza use the continuity field in the TS header? I'm wondering if this could cause this behavior.

      Thank you.
    1. rrlanham -
      You can try the jitter buffer:

      http://www.wowza.com/forums/content....G-TS-over-RTP)

      I'm not sure if it can help with packets that are that far behind.

      Richard
    1. bitsbits -
      I tried the jitter buffer settings:I started with what is posted. But it logs "RTPDePacketizerMPEGTS.flushVideoBuffer video frame incomplete" error. Along with with Sorter reporting packet loss. So I doubled the values to these:
      rtpDePacketizerPacketSorterBufferTime 100
      rtpDePacketizerPacketSorterFlushTime 20

      But still the same result. MPEGTS streaming was working before the change. I am running 2.2.4 with "StartStream feature" enabled to auto start.Just to be clear. I'm actually trying not to care about dropped TS packets. I would like it to just display what it receives and not care too much about keeping up.
    1. rrlanham -
      We will need more details. Write to support@wowza.com and reference this thread, then provide details of the source and access to it if possible.

      Richard
    1. bitsbits -
      This particular feature is very important to my customer. I'm streaming TS files via UDP sockets. I can deal with a large time delays between files. I can stream around 200kbs without any issues. But I'm having what appears to be significant packet drops around 650kbs. Is there a particular TS packet count per UDP packet Wowza is expecting? I would very much like to keep the high bit rate.

      Thank you.
      Jae
    1. rrlanham -
      Jae,

      If high bitrate is the factor, there is not configuration fix. The best solution is multi-bitrate streaming. The 2nd best is a lower, more optimal bitrate stream.

      Richard
    1. bitsbits -
      Is there a property to tell Wowza to ignore pts and/or dts for UDP MPEG-TS encoder streams?
    1. rrlanham -
      Yes, add this Property to /conf/[app-name]/Application.xml /LiveStreamPacketizer/Properties list:

      Code:
      <Property>
                      <Name>chunkBreakOnPTS</Name>
                      <Value>false</Value>
                      <Type>Boolean</Type>
      </Property>
      Richard
    1. pobrejuanito -
      Hi,

      Past weekend we were testing our Wowza setup. We are using Tricaster to broacast RTMP live stream. It is using H.264 with Baseline profile. Our setup includes 1 EC2 instance that is acting as origin and balancer and it is repeating the stream to our edge servers.

      Video and Audio were out of sync. I want to try adding

      Code:
      <Property>
          <Name>sortPackets</Name>
          <Value>true</Value>
          <Type>Boolean</Type>
      </Property>
      <Property>
          <Name>sortBufferSize</Name>
          <Value>750</Value>
          <Type>Integer</Type>
      </Property>
      to /conf/[application]/Application.xm. I have "liveorigin", "redirect" application setup on my origin/balancer and on the edge, the application is "liveedge". My question is which application Application.xml do I put this xml code into? origin, redirect, liveedge?

      Thanks
    1. randall -
      You only have to add properties one time if you put them in the liveorigin app. Remember, the stream is published to the "liveorigin" app (I assume), not "redirect".
    1. bmota007 -
      Can any one tell me why my mobile live streaming works perfect on Black berry and Android and on the iphone its starts normal but after a few minutes it shutsdown and the streaming of the audio or video it comes back some times a few minutes later or a few hours later. This happens on Audio streaming only or live video only. It just shuts down and even if I re start on the iphone it wont comeback.