Publish and play a live stream from an MPEG-TS encoder in Wowza Streaming Engine

Configure Wowza Streaming Engine™ media server software to receive an encoded live stream from an MPEG-TS-based source and play the live stream over all supported streaming protocols.

Note: With Wowza Streaming Engine 4.7.5.01 and later, you can ingest an MPEG-TS stream with low overhead audio stream (LOAS) audio lossless coding (MPEG-4 ALS) audio and deliver it using MPEG-DASH.

Configure the live streaming application


Live streams are configured and managed in live applications in Wowza Streaming Engine. You can configure a live application in Wowza Streaming Engine Manager or by setting properties in the application's XML configuration file. Both methods produce the same result; editing Application.xml is the only option if you use Wowza Media Server™ software.

This article explains how to set up a live application that ingests content from an encoder using the MPEG-2 Transport Stream (MPEG-TS) container format.

Configure the live application in Wowza Streaming Engine Manager

This example uses the default live application that installs with Wowza Streaming Engine.

You can use Wowza Streaming Engine Manager with the latest version of most web browsers that support HTML5 and Cascading Style Sheets level 3 (CSS 3). We recommend Google Chrome.

  1. In Wowza Streaming Engine Manager, click the Applications tab at the top of the page and then select the live application in the contents panel.

Start by enabling playback over all supported protocols: Adobe HDS, Adobe RTMP, Apple HLS, Microsoft Smooth Streaming, MPEG-DASH, and RTSP/RTP.

  1. On the Setup tab of the live application page, make sure all Playback Types are selected. If necessary, click Edit, select them all, and then click Save.

Note: Every time you edit an application's configuration, Wowza Streaming Engine prompts you to restart the application. However, you can wait until all changes are completed before you restart.

Next, disable playback authentication.

  1. In the contents panel, click Playback Security, and then click Edit.

  1. On the Playback Security page, select No client restrictions, and then click Save.

  2. Restart the application.

The application runs whenever Wowza Streaming Engine is running.

Configure the live application in XML

This section shows you how to configure the live application by editing the Application.xml configuration file in a text editor. If you configured the live application in Wowza Streaming Engine Manager, skip this section.

  1. Navigate to [install-dir]/conf/live and open Application.xml in a text editor.
  2. In the <Streams> container element, make sure the <StreamType> property is live. The XML looks like this:
    <Streams>
        ...
        <StreamType>live</StreamType>  
        ...
    </Streams>
    
  3. Set the <HTTPStreamers> property for all supported HTTP streaming protocols. The XML looks like this:
    <HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming,mpegdashstreaming</HTTPStreamers>
  4. Set the <LiveStreamPacketizers> property for HDS, HLS, Microsoft Smooth Streaming, and MPEG-DASH streaming. The XML looks like this:
    <Streams>
        ...
        <LiveStreamPacketizers>cupertinostreamingpacketizer,smoothstreamingpacketizer,sanjosestreamingpacketizer,mpegdashstreamingpacketizer</LiveStreamPacketizers>
        ...
    </Streams>
    
  5. In the <RTP> container element, make sure playback authentication is disabled by setting the <PlayMethod> property to none. The XML looks like this:
    <RTP>
        <Authentication>
            ...
            <PlayMethod>none</PlayMethod>
        </Authentication>
        ...
    </RTP>
  6. Save your changes and close Application.xml.
  7. Restart Wowza Streaming Engine or Wowza Media Server.

Publish the source stream to Wowza Streaming Engine


This section provides the basic steps for creating a .stream file to publish the encoded live stream to Wowza Streaming Engine.

Note: Consult your MPEG-TS encoder documentation for information about how to configure an outgoing live stream.

  1. In Wowza Streaming Engine Manager, click Server in the menu bar, click Stream Files in the contents panel, and then click Add Stream File.

  1. In the Add Stream File dialog box, enter a name for the stream file, for example, mpegts.stream.



     
  2. For Stream URI, specify udp://0.0.0.0:10000.

If you're receiving a multicast stream, change 0.0.0.0 to the multicast address of the stream. If needed, you can also use a unique port, for example, udp://0.0.0.0:26400.

  1. Click Add.

When your source encoder is connected, start the stream.

  1. Click Stream Files in the contents panel and then click the Connect icon for your MPEG-TS  .stream file.

  1. In the Connect a Stream File dialog box, click the Application Name menu and choose live.
  2. Click the MediaCaster Type menu and choose rtp.


     
  3. Click OK.

The Connection successful message is displayed.

Test playback


In Wowza Streaming Engine Manager, click Test Players in the upper-right corner of the live application page.

Each tab in the Test Players window either hosts a test player that can play the live stream, or provides instructions for playing the live stream. The test players are preconfigured to stream the default live stream myStream.

To test playback of the MPEG-TS stream mpeg-ts.stream over Adobe HDS, for example, make sure the encoder is sending a stream to the live application in Wowza Streaming Engine and that Adobe Flash is enabled in the browser you're using. Then, click the Adobe HDS tab, enter the information below, and then click Start.

  • Server – Enter [wowza-ip-address]:1935.
     
  • Application – Enter live.
     
  • Stream – Enter mpegts.stream.


The result is the playback URL:
 
http://[wowza-ip-address]:1935/live/mpegts.stream/manifest.f4m

You can also test your live stream by using the test players online on our Wowza Test Players webpage, or by using the example players that install with Wowza Streaming Engine at [install-dir]/examples/. For more information, see any of these articles:

Troubleshooting


RTSP/RTP

RTSP/RTP streaming is used to stream to Android and BlackBerry mobile devices. Android devices used to support Adobe Flash player, but don't any more. Newer Android devices support Apple HLS. HLS works best on Android 4.0 devices and above.

To stream to RTSP/RTP, be sure that UDP ports 0-65535 are open and mapped to the Wowza Streaming Engine server. For more information, see Troubleshoot RTSP/RTP playback from Wowza Streaming Engine.

Fix common problems with .stream files

Many text editors will append a .txt file name extension to the mpegts.stream file name. This will result in an error message similar to the following:
 
SDP file missing: c:/program files/wowza media systems/wowza streaming engine [version]/content/mpegts.stream

To fix this, go to the [install-dir]/content folder and remove the .txt file name extension from the file.

The mpegts.stream file contains the address of the incoming UDP stream that carries the MPEG-TS packets. Most of the time, it's sufficient to set this address to:
 
udp://0.0.0.0:[port]

Where [port] is the port number to which the stream is being published.

The IP address (0.0.0.0) instructs the Wowza Streaming Engine server to listen on all local IP addresses for the incoming stream. Sometimes this won't work properly if the computer has multiple network interfaces. If this happens, it's best to specify the internal IP address of the stream. For example, to listen to the local loopback interface, you might specify:
 
udp://127.0.0.1:10000

Or you might specify the computer's internal NAT address:
 
udp://192.168.1.1:10000

Fix audio and video alignment

Some MPEG-TS encoders publish audio and video where the media frames aren't aligned on PES packet boundaries. This misalignment will cause the audio and video to not play. Wowza Streaming Engine can re-align unaligned streams, but it requires that a property be added to your live application.

Fix audio and video alignment in Wowza Streaming Engine Manager

  1. Click the Applications tab and then click the name of your live application (such as live) in the contents panel.
     
  2. On the live application page Properties tab, click RTP Jitter Buffer in the Quick Links bar.
     
    Note: Access to the Properties tab is limited to administrators with advanced permissions. For more information, see Manage credentials.
  3. Click Edit in the RTP Jitter Buffer properties area and make the following changes depending on if you are correcting audio or video alignment:
     
    • To turn on the code to fix video alignment, select the Enabled check box next to mpegtsVideoIsAligned and set the value to True.
       
    • To turn on the code to fix audio alignment, select the Enabled check box next to mpegtsAudioIsAligned and set the value to True.
  4. Click Save, and then restart the application when prompted to apply the changes.
Note: These properties will apply to all streams delivered by the application. For more information on only changing the properties for a single stream, see Specify per-stream settings in Wowza Streaming Engine .stream files.

Fix video alignment in 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 <RTP>/<Properties> container. Be sure to add the property to the correct <Properties> container in Application.xml as there are several such containers in the file.
     
    <Property>
        <Name>videoIsAligned</Name>
        <Value>false</Value>
        <Type>Boolean</Type>
    </Property>
  2. Restart Wowza Streaming Engine to apply the changes.

Fix audio alignment in 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 <RTP>/<Properties> container. Be sure to add the property to the correct <Properties> container in Application.xml as there are several such containers in the file.
     
    <Property>
        <Name>audioIsAligned</Name>
        <Value>false</Value>
        <Type>Boolean</Type>
    </Property>
  2. Restart Wowza Streaming Engine to apply the changes.
Note: These properties will apply to all streams delivered by the application. For more information on only changing the properties for a single stream, see Specify per-stream settings in Wowza Streaming Engine .stream files.

Fix TS packet alignment in UDP packets

Some MPEG-TS encoders don't align TS packets correctly in UDP packets. When this happens, you'll the following warning messages in the logs:

RTPDePacketizerMPEGTS.handleRTPPacket: Out of sync: 0x[nn]
 
Note: Wowza Streaming Engine only allows a single rtpDePacketizerWrapper value. If you configured a jitter buffer or packet recorder that uses the same rtpDePacketizerWrapper, remove it before performing the steps below.

Fix TS packet alignment in UDP packets in Wowza Streaming Engine Manager

  1. Click the Applications tab and then click the name of your live application (such as live) in the contents panel.
     
  2. On the live application page Properties tab, click RTP Jitter Buffer in the Quick Links bar.
     
    Note: Access to the Properties tab is limited to administrators with advanced permissions. For more information, see Manage credentials.
  3. Click Edit in the RTP Jitter Buffer properties area, select the Enabled check box next to rtpDePacketizerWrapper, and then enter the value com.wowza.wms.rtp.depacketizer.RTPDePacketizerWrapperReChunkMPEGTS.  
  4. Click Save, and then restart the live application to apply the changes. 

Fix TS packet alignment in UDP packets in 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 <RTP>/<Properties> container. Be sure to add the property to the correct <Properties> container in Application.xml as there are several such containers in the file.
     
    <Property>
        <Name>rtpDePacketizerWrapper</Name>
        <Value>com.wowza.wms.rtp.depacketizer.RTPDePacketizerWrapperReChunkMPEGTS</Value>
    </Property>
  2. Restart Wowza Streaming Engine to apply the changes.

Force output to MPEG-TS for set-top boxes

When using RTSP/RTP to stream out content, you can force the output to MPEG-TS, which is required by many set-top boxes. For more information, see Generate and control MPEG-TS output for set-top boxes in Wowza Streaming Engine.

Change the AAC packetization method

Wowza Streaming Engine can use the mpeg4-generic or mp4a-latm (3gpp) packetization method to output AAC audio. The default packetization method is mpeg4-generic.

Configure mp4a-latm packetization using Wowza Streaming Engine Manager

  1. Click the Applications tab and then select your live application in the contents panel.  
  2. On the live application page Properties tab, click Custom in the Quick Links bar or scroll to the bottom of the page.
     
    Note: Access to the Properties tab is limited to administrators with advanced permissions. For more information, see Manage credentials.
  3. In the Custom area, click Edit.  
  4. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:
     
    • Path – Select /Root/Application/RTP.  
    • Name – Enter audioPacketizerAAC.  
    • Type – Select String.  
    • Value – Enter com.wowza.wms.rtp.packetizer.RTPPacketizerMPEG4LATM.
  5. Click Save, and then restart the live application to apply the changes. 

Configure mp4a-latm packetization in XML

  1. Navigate to [install-dir]/conf/[application] and open Application.xml in a text editor.
  2. Add the audioPacketizerAAC property to the <RTP> container element. The XML looks like this:
<RTP>
    ...
    <Properties>
        <Property>
            <Name>audioPacketizerAAC</Name>
            <Type>String</Type>
            <Value>com.wowza.wms.rtp.packetizer.RTPPacketizerMPEG4LATM</Value>
        </Property>
    </Properties>
<RTP>
  1. Restart Wowza Streaming Engine or Wowza Media Server.

Import AC-3 elementary streams

Wowza Streaming Engine (and Wowza Media Server 3.5.1 or later) can import AC-3 elementary streams using Apple HLS (Cupertino) and MPEG-DASH streaming to allow Dolby Digital (AC-3) and Dolby Digital Plus (Enhanced AC-3) audio from MPEG-TS encoders to pass through unaltered for delivery. This lets your customers experience immersive surround-sound audio when streaming on media devices such as Apple TV, Sony PlayStation 3 (PS3), hybrid set-top boxes, and smart TVs.

Note: The mpegtsImportAC3 property will apply to all streams delivered by the application. For more information on only changing the property for a single stream, see Specify per-stream settings in Wowza Streaming Engine .stream files.

Configure AC-3 elementary stream import in Wowza Streaming Engine Manager

  1. Click the Applications tab and then click the name of your live application (such as live) in the contents panel.
     
  2. On the live application page Properties tab, click Custom in the Quick Links bar.
     
    Note: Access to the Properties tab is limited to administrators with advanced permissions. For more information, see Manage credentials.
  3. In the Custom area, click Edit.
     
  4. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:
     
    • Path – Select /Root/Application/RTP.
       
    • Name – Enter mpegtsImportAC3.
       
    • Type – Select Boolean.
       
    • Value – Enter true.
  5. Click Save, and then restart the live application to apply the changes. 

Configure AC-3 elementary stream import in 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 <RTP>/<Properties> container. Be sure to add the property to the correct <Properties> container in Application.xml as there are several such containers in the file.
     
    <Property>
        <Name>mpegtsImportAC3</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>
  2. Restart Wowza Streaming Engine to apply the changes.

Configure I-slice keyframe interpretation

By default, I-slices are treated as keyframes. You can add the isISliceKey property to your live application configuration if you don't want I-slices to be treated as keyframes. For more information, see Configure I-slice keyframe interpretation in Wowza Streaming Engine.

Capture network traffic

To troubleshoot an incoming MPEG-TS/UDP/RTP/RTSP stream, Wireshark can be a very useful tool. It can capture the traffic on the computer it runs on, and filter/organize incoming/outgoing packets so they can be analyzed easily. To validate that an encoder stream is actually reaching your Wowza Streaming Engine server, it can be useful to capture all incoming/outgoing traffic and identify the data packets coming from the encoder on the configured Wowza port. To perform a network capture when opening the Wireshark tool, you must select on which network interfaces Wireshark should capture the traffic.

Click image to see full-size version.

After selecting the network interface, click Start so that Wireshark starts capturing incoming and outgoing packets. If your encoder isn't pushing the UDP stream to your Wowza Streaming Engine server yet, you should start it to see the incoming traffic. You should be able to see packets being captured by Wireshark.

You can also capture the network traffic on a Linux-based computer by using the "tcpdump" tool. A sample capturing command would be:
 
tcpdump -i any -s 0 -w captureFile.pcap

After stopping the network traffic capture (Capture > Stop or CTRL+E), you'll be able to see all captured packets in the Wireshark interface. You can apply filters to isolate only the traffic that's relevant for your investigation. You can find more filters that can be applied here: http://wiki.wireshark.org/DisplayFilters

In the following figure, you can see that UDP packets from the encoder (10.9.9.5) are being received by the media server (10.9.9.61) on port 5004.

Click image to see full-size version.

To debug RTSP client playback issues, you can filter out the traffic coming and going from/to that particular client IP address, if you know the IP address of the playback client. Sometimes, not all packets are decoded correctly. To address this concern, select a particular packet, in this case a request going from the client to the server on port 1935, and choose the Decode as: RTSP option. You can do this because you know that this should be an RTSP message exchange. You can get the context menu and dialog box shown in the following figures by right-clicking on a particular packet line, and then choosing the Decode as option.

Click image to see full-size version.

Click image to see full-size version.

To follow the RTSP exchange between the client and the media server, right-click on a selected RTSP-decoded TCP packet, and then select the Follow TCP stream option. You'll then be presented with all the communication message exchanges between the client and the media server. See the following figures:

Click image to see full-size version.

Click image to see full-size version.

Another thing that might help in debugging an RTSP streaming session would be to verify that all RTP packets are being sent by the media server in the correct order. To check that you can filter out only the RTP packets, apply a similar filter (in this case, the client playback IP address is 10.9.9.101: ip.addr == 10.9.9.101 and rtp), and then verify that all outgoing RTP packets of the same RTP type (one RTP type for audio and one RTP type for the video track) have consecutive sequence numbers. Packets shouldn't be sent out of order. A high sequence number shouldn't arrive before a lower sequence number. If the player is running on a computer, you might also want to take a network capture on the receiving end and compare with the data from the sender end.

You can also verify the RTCP receiver reports sent by the client and sender reports sent by the media server. In receiver reports, you can get the number of the last RTP packet reported as received by the client and verify that against the list of received RTP packets displayed by Wireshark. The receiver reports also inform you about how many RTP packets were lost and the average jitter time. In sender reports, you can get the sequence number of the last RTP packet reported as sent by the media server and verify that against the list of sent RTP packets displayed by Wireshark.
Click image to see full-size version.

Click image to see full-size version.

More resources