• 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™ software to publish a live stream from MPEG-TS-based encoders for playback on all supported player technologies.

    Contents


    Tutorial

    Troubleshooting
    Related Articles

    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. Make sure Wowza Streaming Engine Manager is running. See How to start and stop Wowza Streaming Engine software.

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

    3. Configure the live application:

      1. In the Applications contents pane, 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 pane, 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.


    4. Configure outgoing (playback) authentication:

      1. In the contents pane, click Outgoing Security, and then click Edit.


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

    5. 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 pane, 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 pane 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 pane, 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:
        Code:
        <StreamType>live</StreamType>
      2. Set the HTTPStreamers property to:
        Code:
        <HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming,mpegdashstreaming</HTTPStreamers>
      3. Set the Streams/LiveStreamPacketizers property to:
        Code:
        <LiveStreamPacketizers>cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, mpegdashstreamingpacketizer</LiveStreamPacketizers>
      4. Set the RTP/Authentication/PlayMethod property to:
        Code:
        <PlayMethod>none</PlayMethod>

    4. Restart the Wowza 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 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:
      Code:
      # Admin password file (format [username][space][password])
      # username password
      myUser myPassword
    4. Start the Wowza 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 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 at www.wowza.com/testplayers.

    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 properly mapped to the server that is running the Wowza server software.

    Note: To configure the Wowza server properly for RTSP/RTP streaming, carefully 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 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 server software can re-align unaligned streams, but it requires that a property be added to [install-dir]/conf/[application]/Application.xml.

    To turn on the code to fix audio alignment, add the following property to the RTP/Properties container in [install-dir]/conf/[application]/Application.xml (be sure to get the correct <Properties> container; there are several in the Application.xml file):
    Code:
    <Property>
        <Name>audioIsAligned</Name>
        <Value>false</Value>
        <Type>Boolean</Type>
    </Property>
    To turn on the code to fix video alignment, add the following property to the RTP/Properties container in [install-dir]/conf/[application]/Application.xml (be sure to get the correct <Properties> container; there are several in the Application.xml file):
    Code:
    <Property>
        <Name>videoIsAligned</Name>
        <Value>false</Value>
        <Type>Boolean</Type>
    </Property>
    Note: Wowza Media Server 3.0.0 or later is required.

    Property to fix TS packet alignment in UDP packets

    A few 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]

    Add the following property to the RTP/Properties container in [install-dir]/conf/[application]/Application.xml (be sure to get the correct <Properties> container; there are several in the Application.xml file):
    Code:
    <Property>
        <Name>rtpDePacketizerWrapper</Name>
        <Value>com.wowza.wms.rtp.depacketizer.RTPDePacketizerWrapperReChunkMPEGTS</Value>
    </Property>
    Wowza server software only allows a single rtpDePacketizerWrapper value. If you have configured a jitter buffer or packet recorder that uses the same rtpDePacketizerWrapper, they must be removed.

    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 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 the Streaming Engine Manager contents pane, click live.

    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, and then do the following:

      1. Add the audioPacketizerAAC property with the following values:

        • Path: Select /Root/Application/RTP.

        • Name: Enter audioPacketizerAAC.

        • Type: Select String.

        • Value: Enter com.wowza.wms.rtp.packetizer.RTPPacketizerMPEG4LATM.

      2. Click Add.

    5. On the Properties tab, click Save.

    6. Click Restart in the upper-right corner of the live application page to restart the application.

    XML configuration


    To switch to mp4a-latm (3gpp), add the following property to the RTP/Properties container in [install-dir]/[application]/Application.xml (be sure to use the correct Properties container—there are several in the Application.xml file):
    Code:
    <Property>
        <Name>audioPacketizerAAC</Name>
        <Value>com.wowza.wms.rtp.packetizer.RTPPacketizerMPEG4LATM</Value>
    </Property>

    Property to import AC-3 elementary streams

    Note: Wowza Media Server 3.5.1 or later is required.
    Wowza 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. To import AC-3 elementary streams, add the following property to the RTP/Properties container in [install-dir]/[application]/Application.xml (be sure to get the correct <Properties> container; there are several in the Application.xml file):
    Code:
    <Property>
        <Name>mpegtsImportAC3</Name>
        <Value>true</Value>
        <Type>Boolean</Value>
    </Property>

    Related Articles



    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


    Updated: For Wowza Streaming Engine 4.0.6 on 08–11–2014.

    Comments 35 Comments
    1. bmckim -
      This article forgets to tell you to publish the .smil file as a stream:


      Using either the Stream Manager, [install-dir]/conf/StartupStreams.xml or IApplicationInstance.startMediaCasterStream(...), start the stream using the stream name smil:[smil-file-name]. For example, to start the stream group above use the stream name smil:stream.smil. Once started, you can double check to be sure the stream is started as a group by viewing the streams in the Stream Manager. Stream groups will be listed under each of the individual streams.
    1. rrlanham -
      I don't think it is ever necessary to start a smil file with MediaCaster, just the items in the smil, if they are MediaCaster streams.

      Richard
    1. lisa_w -
      Added note with required parameters for playback with Microsoft Silverlight (Smooth Streaming). -Lisa
    1. apakabartv -
      I have a couple of questions.

      1) any idea why we have to login to port 8086 in order to start receiving mpegts stream ?

      2) can the above "live" and "rtp-live" stream types coexist at the same time ? I can have the rtp-live stream type above to work, but not the live.
    1. rrlanham -
      If you don't want to login to StreamManager, open /conf/VHost.xml and search for
      Code:
      com.wowza.wms.http.streammanager.HTTPStreamManager
      , then change the AuthenticationMethod in that HTTProvider to "none", then restart Wowza. However, this is not a good idea for security reasons.

      You can have an application with StreamType "live" and publish (push) streams to that application, then start other MediaCaster (pull) streams with the StreamManager, and they can all co-exists, no problem.

      Richard
    1. apakabartv -
      Thank you very much.

      Actually what I wanted to ask was how to automatically start receiving live stream (i.e. without having the admin to login and click the "start receiving stream"). Your answer leads me to chapter 5 of Wowza user guide and I got what I want. Edit the StartupStreams.xml file and uncomment the <StartupStream> section for MPEG-TS.

      Cool ...
    1. countz -
      Can you have multiple entries in a .stream file?
    1. rrlanham -
      No, just one

      Richard
    1. countz -
      I have the below sample URL for iPad users, how do I make it redundant such that it will try more than one .stream file?

      http://test.com:1935/testRepeat/_def.../playlist.m3u8

      At the moment, if the source specified in test.stream is down, users get a "File not found" message.
    1. rrlanham -
      I can't think of an easy way to do that.

      Richard
    1. LearnerDev -
      So when transcoding with VLC which profile i should use?
    1. rrlanham -
      If you are streaming to mobile devices, Baseline 3 is recommended.

      More info:
      http://www.wowza.com/forums/content....erver-(MPEG-TS)

      Richard
    1. tunglq87 -
      Hi, all!

      I don't understand step 7 above how to.( Configure the MPEG-TS based encoder to send a live stream to the IP address of the server running Wowza Server using port 10000 ). everyone help me...!
    1. rrlanham -
      This article shows how to use StreamManager:

      http://www.wowza.com/forums/content....Stream-Manager

      Richard
    1. rrlanham -
      Sorry StreamManager is step 8.

      Step 7, configuring your encoder, is specific to whichever encoder you are using, but there should be a way to enter an IP address that you will point the stream at. Make that the IP address of your Wowza server.

      Richard
    1. tunglq87 -
      Thanks! Richiard !

      I understand! and i used encoder (vlc, wirecast) success. But, when i use encoder on windows. Now, Can i use encoder on Linux (CentOS 5.6 64 bit)? so, how to config them? ( my system is using Wowza media server 2 on CentOS 5.6 64 bit)
    1. rrlanham -
      The only mpegts encoder that I have experience with really is VLC:

      http://www.wowza.com/forums/content....erver-(MPEG-TS)

      Richard
    1. apakabartv -
      Hello,

      Any suggestion how I could secure the UDP port from unsolicited (trashing) stream?
      I mean, if Wowza listens to an incoming stream on a public IP, then once someone out there figures out the port number, he/she could send some bogus stream just to interfere with my own stream.

      One way that I have in mind is as follow:

      Put 2 network interface cards on the Wowza server. one is connected to the LAN (private IP), and one is connected to the internet (public IP). Wowza will only listen to incoming stream on the LAN interface.
      Then all of my live stream sources (e.g. IP camera, etc) will need to be on the LAN. This can be achieved by having VPN setup for my remote IP camera in order to get access to the LAN. I know that setting up a VPN access like this could be another big job.

      Is there any other suggestion in this topic ?

      Thanks in advance,
      William.
    1. charlie -
      There should be a way to do it using IP tables where you only allow a given IP address or address range to write UDP packets to a given port. I do not know the exact syntax.

      Charlie
    1. cnfcnf -
      Hi there,

      I am very confused. I am trying to transmit a live video from my webcam/tv tuner to my server running Wowza using VLC. I am not trying to transfer a fixed mp4 file.

      Can anyone tell me the VLC settings for this? I believe the Input source in this case should be a capture device. Am I correct about this?

      I am a bit confused on how I should "refer" to the capture device on the commandline. For instance, if I am using a webcam, what is the capture device name? Obviously I would need to specify 2 things: the capture device from where the video is to be taken, and the destination server on which wowza is running.

      Please help!