• How to publish and play a live stream (MPEG-TS based encoder)

    This tutorial provides the basic steps that show how to use Wowza Streaming Engine™ live streaming software to publish a live stream from MPEG-TS-based encoders for playback on all supported player technologies.

    Contents


    Tutorial

    Troubleshooting
    More resources

    Tutorial


    This tutorial shows you how to set up an application that ingests content from a live encoder that publishes a stream using the MPEG-2 Transport Stream (MPEG-TS) protocol. Wowza Streaming Engine software administrators can configure live streaming applications by using UI options in Wowza Streaming Engine Manager or by setting properties in Application.xml. Both configuration methods have the same result. Wowza Media Server™ software administrators must configure live streaming applications in the Application.xml file.

    Wowza Streaming Engine Manager configuration

    This section shows you how to set up a live streaming application in Wowza Streaming Engine Manager. The live stream is sent to the streaming engine from an encoder that delivers a stream in the MPEG-2 Transport Stream (MPEG-TS) format. Users play the live stream to view the event as it happens. The example uses an application named live, which is included in default Wowza Streaming Engine software installations. If you want to create a new live streaming application, you can use this same procedure.

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

    1. On the Wowza Streaming Engine Manager Welcome page, click the Applications tab at the top of the page.

    2. Configure the live application:

      1. In the Applications contents panel, click live, and then click Edit. (This example uses the installed live application. If you want to create a new live streaming application, click Add Application in the contents panel, and then click Live. Follow the instructions in the UI.)



      2. On the live page, select all of the Playback Types, and then click Save.



        The following alert appears after every configuration change. You can wait until all changes are completed before you restart.


    3. Configure playback authentication:

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



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


    4. Restart the application.


    Publishing the stream


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

    1. Consult your MPEG-TS encoder documentation to configure an outgoing live stream.

    2. Create the .stream file:

      1. In the Server contents panel, click Stream Files, and then click Add Stream File.



        Note: You can also start the procedure to create a .stream file in the Applications contents panel for the live application.
      2. In the Add Stream File dialog box, enter a name for the new stream file, enter Stream URI, and then click Add.



        For MPEG-TS based encoders, use udp://0.0.0.0:10000. If you're receiving a multicast stream, change the 0.0.0.0 part of the URL to the multicast address of the stream. If needed, you can also use a unique port, for example, udp://0.0.0.0:26400.

    3. Start the stream:

      1. In the Server contents panel, click Stream Files, and then click the Connect icon for the stream file you created in step 2.



      2. In the Connect a Stream File dialog box, select live in Application Name and rtp in MediaCaster Type, and then click OK.



      3. The Connection successful notification is displayed.



    XML configuration

    This section shows you how to configure the live application by editing the Application.xml configuration file in a text editor.
    Note: If you created your application by following the previous section, skip this section. If you make changes to Application.xml and you're using Wowza Streaming Engine™ software, any supported settings will be 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 Wowza Media Server.
    1. Create application folder [install-dir]/applications/live.

    2. Create configuration folder [install-dir]/conf/live and copy [install-dir]/conf/Application.xml to this new folder.

    3. Edit the newly copied Application.xml file and make the following changes (some of these settings may already be present):

      1. Set the Streams/StreamType property to:
        <StreamType>live</StreamType>
      2. Set the HTTPStreamers property to:
        <HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming,mpegdashstreaming</HTTPStreamers>
      3. Set the Streams/LiveStreamPacketizers property to:
        <LiveStreamPacketizers>cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, mpegdashstreamingpacketizer</LiveStreamPacketizers>
      4. Set the RTP/Authentication/PlayMethod property to:
        <PlayMethod>none</PlayMethod>

    4. Restart the Wowza media server.


    Publishing the stream


    Note: If you're using Wowza Streaming Engine, you can publish the stream in Streaming Engine Manager. For details, see Publishing the stream.
    1. Consult your MPEG-TS encoder documentation to configure an outgoing live stream. Use port 10000 to publish the stream to the IP address of the Wowza media server.

    2. Use a text editor to create the file [install-dir]/content/mpegts.stream and set the contents of this file to udp://0.0.0.0:10000. If you're receiving a multicast stream, change the 0.0.0.0 part of the URL to the multicast address of the stream. If needed, you can also use a unique port, for example, udp://0.0.0.0:26400.

    3. Using a text editor, edit the file [install-dir]/conf/admin.password and add a user name and password that will be used to start and stop the publishing of the MPEG-TS stream. The following is an example of the file with user name myUser and password myPassword:
      # Admin password file (format [username][space][password])
      # username password
      myUser myPassword
    4. Start the Wowza media server.

    5. Use Stream Manager to start the MPEG-TS stream:

      1. Enter the following URL in a web browser:

        URL: http://[wowza-ip-address]:8086/streammanager

      2. In the Security dialog box, enter your admin user name and password from step 3.

      3. In the Stream Manager webpage, click the [start-receiving-stream] link just below the live application folder.

      4. In the Start Receiving Stream dialog box, select the following MediaCaster Type option: rtp

      5. In the Stream Name field, enter mpegts.stream.

      6. Click OK.

    Playback

    Note: In the following examples, [wowza-ip-address] is the IP address or domain name of the Wowza media server.

    Playback in Wowza Streaming Engine Manager


    In Streaming Engine Manager, click Test Players in the upper-right corner of the live application page. The Test Players window that opens includes test players that are preconfigured to stream the live stream named myStream over various streaming formats.

    Each tab in the Test Players window either hosts a test player that you can use to play the live stream or provides instructions for playing the live stream. For example, to use the Adobe HDS protocol to play mpeg-ts.stream, 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 when using the Adobe HDS tab on the player is the following URL:

    http://[wowza-ip-address]:1935/live/mpegts.stream/manifest.f4m

    The test players are also online on our Wowza Test Players webpage.

    Example players


    You can also use example players installed in [install-dir]/examples/ to test your streaming applications. For more information see the following articles:



    Adaptive bitrate streaming

    To implement adaptive bitrate (ABR) streaming, you can ingest mpegts.stream through Wowza Transcoder to create a Synchronized Multimedia Integration Language (SMIL) file. For details, see How to create and play SMIL files with streams created by Wowza Transcoder.

    Troubleshooting


    RTSP/RTP

    RTSP/RTP streaming is used to stream to Android and BlackBerry mobile devices. Android mobile devices formerly supported Adobe Flash player, but Android no longer supports Flash. Newer Android devices now 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 media server.

    Note: To configure the Wowza media server for RTSP/RTP streaming, follow the instructions provided in How to troubleshoot RTSP/RTP playback

    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 the following:

    URL: 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 media 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:

    URL: udp://127.0.0.1:10000

    Or you might specify the computer's internal NAT address:

    URL: udp://192.168.1.1:10000

    Properties to 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 media server software can re-align unaligned streams, but it requires that a property be added to your live application.

    Wowza Streaming Engine Manager configuration


    1. In Wowza Streaming Engine Manager, 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 How to specify per-stream settings in .stream files.

    XML configuration


    To turn on the code to fix video alignment:

    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 the Wowza media server software to apply the changes.

    To turn on the code to fix audio alignment:

    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 the Wowza media server software 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 How to specify per-stream settings in .stream files.

    Property to 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 see lots of the following warning messages in the logs:

    RTPDePacketizerMPEGTS.handleRTPPacket: Out of sync: 0x[nn]
    Note: Wowza media server software 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.

    Wowza Streaming Engine Manager configuration


    1. In Wowza Streaming Engine Manager, 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 rtpDePacketizerWrapper.

      • Type - Select String.

      • Value - Enter com.wowza.wms.rtp.depacketizer.RTPDePacketizerWrapperReChunkMPEGTS.

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

    XML configuration


    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 the Wowza media server software to apply the changes.

    Property to force output to MPEG-TS (set-top box)

    When streaming out using RTSP/RTP, you can force the output to MPEG-TS, which is required by many set-top boxes. For more information, see How to generate and control MPEG-TS output for set-top boxes.

    Property to change AAC packetization method

    A Wowza media server can use the mpeg4-generic and mp4a-latm (3gpp) packetization methods to output AAC audio. The default packetization method is mpeg4-generic.

    Wowza Streaming Engine Manager configuration


    To switch to mp4a-latm (3gpp), do the following:

    1. In Wowza Streaming Engine Manager, 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 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.

    XML configuration


    To switch to mp4a-latm (3gpp):

    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>audioPacketizerAAC</Name>
          <Value>com.wowza.wms.rtp.packetizer.RTPPacketizerMPEG4LATM</Value>
      </Property>
    2. Restart the Wowza media server software to apply the changes.

    Property to import AC-3 elementary streams

    Note: Wowza Media Server 3.5.1 or later is required.
    A Wowza media server 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.

    Wowza Streaming Engine Manager configuration


    To import AC-3 elementary streams:

    1. In Wowza Streaming Engine Manager, 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.

    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 How to specify per-stream settings in .stream files.

    XML configuration


    To import AC-3 elementary streams:

    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 the Wowza media server software to apply the changes.

    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 How to specify per-stream settings in .stream files.

    Property to configure I-slice keyframe interpretation

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

    Capturing 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 media 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 media 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



    How to play your first live stream (video tutorial)
    How to troubleshoot RTSP/RTP playback
    How to set up an application for RTSP/RTP streaming
    How to configure Apple QuickTime player to playback an RTSP/RTP on Windows
    How to configure VLC player for RTSP/RTP playback (RTSP/RTP interleaved and tuning)
    How to create and play SMIL files with streams created by Wowza Transcoder

    Originally Published: 10-02-2010.
    Updated: For Wowza Streaming Engine 4.2.0 on 06-16-2015.

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