• How to set up live streaming using an RTSP/RTP-based encoder

    This tutorial provides the basic steps for publishing a live stream from RTSP/RTP-based encoders to Wowza Media Server® and for setting up an application named live to stream live content to Adobe® Flash® Player, Microsoft® Silverlight® player, Apple® iOS devices, and RTSP/RTP based-players.

    Contents



    Tutorial


    Troubleshooting


    Related Articles


    Tutorial



    Configuration


    This section provides the basic steps for setting up an application for live streaming and configuring Application.xml.

    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):

      Note: Right-click HERE to download a pre-configured version of Application.xml.

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

    4. Edit the [install-dir]/conf/publish.password file and add a username and password that will be used to control RTSP/RTP publishing access (below is an example of the file with the username myuser and password mypassword):
      Code:
      # Publish password file (format [username][space][password])
      # username password
      myuser mypassword
    5. Start Wowza Media Server.


    Publishing the stream


    In your encoder, enter the following information and then click the Publish or Start button:

    Host Address: [wowza-ip-address]:1935
    Stream Name: live/myStream.sdp

    Note: The steps for publishing a stream from your encoder to Wowza Media Server will vary depending on the encoder being used. For more information about how to configure your encoder, see Specific Encoding Technologies in the Wowza forum or the documentation for your encoder.

    Playback


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

    Adobe Flash Player (RTMP)


    In Wowza Media Server 3.5, double-click [install-dir]/examples/LiveVideoStreaming/FlashRTMPPlayer/player.html, enter the information below, and then click the Connect button.

    Server: rtmp://[wowza-ip-address]/live
    Stream: myStream

    To play the stream from a remote computer, copy the FlashRTMPPlayer folder to a web server, and then connect to: http://<webserver>/FlashRTMPPlayer/player.html.

    Note: In Wowza Media Server 3.1.2 and earlier, double-click [install-dir]/examples/LiveVideoStreaming/client/live.html, enter the information below, and then click the Play button.

    Server: rtmp://[wowza-ip-address]/live
    Stream: myStream

    To play the stream from a remote computer, copy the client folder to a web server, and then connect to: http://<webserver>/client/live.html.

    Adobe Flash Player (San Jose/Adobe HDS)


    In Wowza Media Server 3.5, double-click [install-dir]/examples/LiveVideoStreaming/FlashHTTPPlayer/player.html, enter the information below, and then click the Connect button.

    Stream: http://[wowza-ip-address]:1935/live/myStream/manifest.f4m

    To play the stream from a remote computer, copy the FlashHTTPPlayer folder to a web server, and then connect to: http://<webserver>/FlashHTTPPlayer/player.html.

    Note: In Wowza Media Server 3.1.2 and earlier, double-click [install-dir]/examples/LiveVideoStreaming/clientOSMF/bin-release/LiveOSMFPlayer.html, enter the information below, and then click the Play button.

    Stream: http://[wowza-ip-address]:1935/live/myStream/manifest.f4m

    To play the stream from a remote computer, copy the clientOSMF/bin-release folder to a web server, and then connect to: http://<webserver>/bin-release/LiveOSMFPlayer.html.

    Note: The stream can only be played from an OSMF-based Flash player that's embedded in a webpage.

    Apple iOS device (Cupertino/Apple HLS)


    Enter the following URL into the Safari® web browser on the device:

    URL: http://[wowza-ip-address]:1935/live/myStream/playlist.m3u8

    Note: The Apple® iPhone® 3GS (and older) and iPod touch® devices require that video be encoded using H.264 format (Baseline profile level 3 or lower) and AAC or MP3 stereo audio.

    Note: This stream can also be played using the Safari web browser or QuickTime 10.x on a computer running Mac OS® X Snow Leopard version 10.6 or later.

    Microsoft Silverlight (Smooth Streaming)


    In Wowza Media Server 3.5, double-click [install-dir]/examples/LiveVideoStreaming/SilverlightPlayer/player.html, enter the information below, and then click the Connect button.

    Stream: http://[wowza-ip-address]:1935/live/myStream/Manifest

    To play the stream from a remote computer, copy the SilverlightPlayer folder to a web server, and then connect to: http://<webserver>/SilverlightPlayer/player.html.

    Note: In Wowza Media Server 3.1.2 and earlier, double-click [install-dir]/examples/LiveVideoStreaming/clientSilverlight/Default.html, enter the information below, and then click the Play button.

    Stream: http://[wowza-ip-address]:1935/live/myStream/Manifest

    To play the stream from a remote computer, copy the clientSilverlight folder to a web server, and then connect to: http://<webserver>/clientSilverlight/Default.html.

    Note: The Microsoft® Silverlight® player requires that both audio and video be present for playback. For live streaming only, the key frame frequency (which can be set directly in some encoders or is gop/fps) must be between 1 and 4 seconds (2 seconds is recommended). Anything greater than 4 seconds may cause playback to freeze.

    RTSP/RTP player


    Enter the following URL into the RTSP/RTP player:

    URL: rtsp://[wowza-ip-address]:1935/live/myStream

    Adaptive bitrate streaming


    Adaptive bitrate (ABR) live streaming to Adobe® Flash® Player, Apple iOS devices, and Microsoft Silverlight requires that you have an encoder that can generate multiple bitrate streams from the same source with properly aligned key frames. You also must create a Synchronized Multimedia Integration Language (SMIL) file that links the streams together for playback.

    For example, let's say that we have three live streams encoded at different bitrates:

    • myStream_700 (700kbps total bitrate)
    • myStream_350 (350kbps total bitrate)
    • myStream_200 (200kbps total bitrate)

    Using a text editor, create a SMIL file named myStream.smil in the [install-dir]/content folder with the following content:
    Code:
    <smil>
        <head>
        </head>
        <body>
            <switch>
                <video src="myStream_700" system-bitrate="700000"/>
                <video src="myStream_350" system-bitrate="350000"/>
                <video src="myStream_200" system-bitrate="200000"/>
            </switch>
        </body>
    </smil>
    You can see that there's a <video> entry in the <switch> container for each stream rendition. The system-bitrate value is set to the total bitrate (in bits-per-second) for that stream.

    Microsoft Smooth Streaming will only switch between the video portion of the streams. The audio track in the first stream listed in the <switch> container will be used. If you want to use a stream other than the first stream for the audio track, add an <audio> entry to the <switch> container for that item. For example:
    Code:
    <smil>
        <head>
        </head>
        <body>
            <switch>
                <video src="myStream_700" system-bitrate="700000"/>
                <video src="myStream_350" system-bitrate="350000"/>
                <video src="myStream_200" system-bitrate="200000"/>
                <audio src="myStream_200" system-bitrate="96000"/>
            </switch>
        </body>
    </smil>
    Note: The <audio> item will be ignored when streaming using Adobe HDS (San Jose) or Apple HLS (Cupertino) streaming.

    Note: JW Player and Flowplayer use a client-side xml file to reference each version not the server-side smil file shown in this tutorial. The both also use the BWCheck module.

    Adobe Flash Player (San Jose/Adobe HDS)


    In Wowza Media Server 3.5, double-click [install-dir]/examples/LiveVideoStreaming/FlashHTTPPlayer/player.html, enter the information below, and then click the Connect button.

    Stream: http://[wowza-ip-address]:1935/live/smil:myStream.smil/manifest.f4m

    Note: In Wowza Media Server 3.1.2 and earlier, double-click [install-dir]/examples/LiveVideoStreaming/clientOSMF/bin-release/LiveOSMFPlayer.html, enter the information below, and then click the Play button.

    Stream: http://[wowza-ip-address]:1935/live/smil:myStream.smil/manifest.f4m

    Apple iOS device (Cupertino/Apple HLS)


    Enter the following URL into the Safari web browser on the device:

    URL: http://[wowza-ip-address]:1935/live/smil:myStream.smil/playlist.m3u8

    Microsoft Silverlight (Smooth Streaming)


    In Wowza Media Server 3.5, double-click [install-dir]/examples/LiveVideoStreaming/SilverlightPlayer/player.html, enter the information below, and then click the Connect button.

    Stream: http://[wowza-ip-address]:1935/live/smil:myStream.smil/Manifest

    Note: In Wowza Media Server 3.1.2, double-click [install-dir]/examples/LiveVideoStreaming/clientSilverlight/Default.html, enter the information below, and then click the Play button.

    Stream: http://[wowza-ip-address]:1935/live/smil:myStream.smil/Manifest

    By default Microsoft Smooth Streaming will calculate video and audio bitrates for the manifest data on-the-fly by inspecting the stream. If you want to configure Wowza Media Server to use the bitrates in the SMIL file, add the following property to the HTTPStreamer/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>smoothStreamingUseSMILBitrates</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>
    When running in this mode, Wowza Media Server will assume that the video and audio system-bitrate values are for the video and audio data only.

    Adobe Flash Player (RTMP)


    Dynamic streaming for Adobe Flash requires a fair amount of work on the client-side. The following articles provide details about how to achieve dynamic streaming in Flash:

    Dynamic streaming in Flash (part 1)
    Dynamic streaming in Flash (part 2)
    Dynamic streaming in Flash (part 3)

    When streaming using Adobe HTTP Dynamic Streaming (Adobe HDS) with Wowza Media Server, it's best to turn on dynamic stream markers, which will provide more accurate on-the-fly bitrate calculations (in most cases). To turn on dynamic stream markers, edit [install-dir]/conf/[application]/Application.xml and add the following property to the Streams/Properties container (be sure to get the correct Properties container - there are several in the Application.xml file):
    Code:
    <Property>
        <Name>enableDynamicStreamMarkers</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>
    Note: Dynamic stream markers are turned on by default in Wowza Media Server 2.2.0 and later.

    Troubleshooting



    RTSP/RTP


    • RTSP/RTP streaming is used to stream to Android™ and BlackBerry® mobile devices. Newer Android-based phones also support Flash player 10.1 or later along with RTMP and Adobe HTTP Dynamic Streaming (Adobe HDS).

    • To stream to RTSP/RTP, be sure that UDP ports 0-65535 are open and properly mapped to the server running Wowza Media Server.

    • It's very important to carefully follow the instructions provided in How to troubleshoot RTSP/RTP playback to properly configure Wowza Media Server for RTSP/RTP streaming.


    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) by adding the following properties 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>forceMPEGTSOut</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>
    <Property>
        <Name>rtpWrapMPEGTS</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>

    Property to change AAC packetization method


    Wowza Media Server can output AAC audio using the mpeg4-generic and mp4a-latm (3gpp) packetization methods. The default packetization method is mpeg4-generic. To switch to mp4a-latm (3gpp), 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>audioPacketizerAAC</Name>
        <Value>com.wowza.wms.rtp.packetizer.RTPPacketizerMPEG4LATM</Value>
    </Property>


    Updated: For Wowza Media Server 3.5.0 on 11-08-2012
    Comments 9 Comments
    1. desaiparthd -
      I want to setup the RTSP live streaming using Live-repeater-edge. How shall I configure the live-repeater edge? What changes are to be made in the encoder to push the stream to live-repeater-origin?
    1. rrlanham -
      The configuration guide is here:
      http://www.wowza.com/forums/content....tream-repeater

      You do not have to do anything different in the encoder, you just publish to the origin as you would a live application

      Richard
    1. maynou -
      Sorry i'm a biginner here and i'm trying to apply RTSP/RTP player but i can't get any result and i don't know why i I followed the tutorial but i can't find the player RTSP in the installation of Wowza server it dosn't exist as a folder like the other players would u plz help me?? I'm desperate
    1. geass4154 -
      Hi, i make an application on android. my link : rtsp://yayin.mirasis.com.tr:1935/live/vatantv . i can get video but no sounds ? How can i solve that ?

      Thanks
    1. rrlanham -
      If it is mp3, try aac audio instead. At least some Android device do not stream mp3.

      Richard
    1. geass4154 -
      How can i decode to aac ?
    1. rrlanham -
      It is mp3 according to VLC Tools > Codec info: Codec: MPEG Audio layer 1/2/3 (mpga)

      Your encoder has to support AAC, but that may not be the problem because I also see that UDP ports are blocked. I can tell in VLC Tools > Codec info because there are two sets of audio and video info blocks, which indicates that VLC failed-over from UDP to TCP. However the Android device may not be able to fail-over to TCP, it has to have UDP. So you have to open all UDP ports on the server and make sure they are mapped to you server in your network; in a home router you have to do port forwarding.

      Go through these guides thoroughly:

      http://www.wowza.com/forums/content....-RTP-streaming

      http://www.wowza.com/forums/content....P-RTP-playback

      Richard
    1. Lime2404 -
      Hi everyone.
      I am trying to playback an adaptive bitrate streaming from WOWZA On VLC using following URL http://10.10.30.129:1935/live/smil:m.../playlist.m3u8.
      10.10.30.129 is my local network. I have no probalem to playback it on Iphone, but VLC. It only allows me to playback this URL http://&#91;wowza-ip-address]:1935/live/.../playlist.m3u8
      Please help
    1. rrlanham -
      This has worked in my tests with the latest version of VLC.

      Richard