• How to set up live streaming using an RTMP-based encoder

    This tutorial provides the basic steps to publish a live stream from RTMP-based encoders to Wowza Media Server® and to set up an application to deliver the live stream to all supported player technologies.

    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. Start Wowza Media Server.


    Publishing the stream


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

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

    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 stream rendition, not the server-side SMIL file that is shown in this tutorial. They 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 62 Comments
    1. mwolffs -
      Are these instructions assuming the source of the stream is colocated with the wowza server (on the same box)?

      If this is not the case, what would be the modifications?
    1. ianbeyer -
      No, the source of the stream would generally not be on the same box.

      If it is, you'd just use the localhost address to publish.
    1. cnynracer1 -
      If I am understanding this correctly, this eliminates the need for complex transcoding solutions such as http://tinyurl.com/2a8o9f7. Is that correct?

      Does the source need to be H.264. We are trying to re-stream from a webcam (Flash player encoder) to all of these sources (cuppertino, rtsp).

      Thank you.
    1. rogerlittin -
      The encoder built into Flash player doesn't do H.264 so the streams produced will only work to other flash players. There is a browser plugin available to stream you webcam in H.264 using a Flash player to control it. http://www.nanocosmos.de/
    1. cnynracer1 -
      Thanks Roger. Yes I understand Flash player doesn't encode in H.264, but I am curious if we can do this without asking our users to download a plugin such as this.
    1. rogerlittin -
      Encoding is very cpu intensive so anything that runs on the client would have to be downloaded. To do it on the server you would need a lot of resources available to do the transcoding and would only be able to handle a few streams at the same time.
    1. shthap3ns -
      I'm noticing that the multi-bitrate live streaming instructions are saying to use the /vod application. Is that correct? How do we access a multi bitrate live stream using live repeater origin/edge?
    1. rrlanham -
      I updated the Live tutorial to use application named "live" instead of "vod". It was a mistake, thanks for pointing that out. Of course the application name is arbitrary, what matters is the Application.xml StreamType.

      To do multi-bitrate on a edge server, create smil file in the edge content folder, something like
      Code:
      <smil>
      	<head>
      	</head>
      	<body>
      		<switch>
      			<video src="origin1.stream" system-bitrate="200000"/>
      			<video src="origin2.stream" system-bitrate="500000"/>
      		</switch>
      	</body>
      </smil>
      Where origin1.stream and origin2.stream are text files in the edge content folder (alongside the smil) that contain the full url to the origin stream, something like:
      Code:
      rtmp://[wowza-origin-address]/live/myStream1
      If you are doing HTTP streaming (Cupertino, Smooth or Sanjose), or the origin stream is a MediaCaster type (e.g., a rtsp stream from an IP camera), then use StreamManager or /conf/StartUpStreams.xml on the edge to start the streams (origin1.stream and origin2.stream) with MediaCaster Type "liverepeater".

      Richard
    1. latalata -
      workiing with adobe media encoder? for me not working.
    1. latalata -
      Apple iphone, Can it use another port? or only 1935
      Ex: http://&#91;wowza-address]:5000/live/myS.../playlist.m3u8
    1. charlie -
      You can use port 80 (which is the default) port. Edit [install-dir]/VHost.xml and add 80 to the list of HostPort/Ports. Be sure to re-start Wowza and that you are not running a web server on the same machine.

      Charlie
    1. benbiles -
      I can use this player fine to play fmle rtmp stream

      [install-dir]/examples/LiveVideoStreaming/clientSilverlight/Default.html

      Is there a normal player other than this that will work for live streams?

      JWplayer not working., Expressions player templates not working.,

      Is it possible to edit the example player and make a normal unbranded player?

      Or is silverlight just not really working yet for live streaming?
    1. rrlanham -
      The key frame interval must be between 1 and 4 seconds. 2 seconds is best. Click the wrench icon next to "h.264" setting. The default is 5 seconds and that will not work in Silverlight.

      Also make sure you have an audio track. Video without audio is unreliable. Audio without video does not work at all.

      Richard
    1. latalata -
      got to work with android, flash, iphone but I can not work with the black berry 554 use port 32 kbs aac Any help?
    1. nublaii -
      I am only planning on offering a live stream for flash players and iOS. Do I still need to add all the packetizers?, like

      <HTTPStreamers>cupertinostreaming,smoothstreaming, sanjosestreaming</HTTPStreamers>

      Or can I just put

      <HTTPStreamers>cupertinostreaming</HTTPStreamers>

      Can I safely omit all the packetizers if I am setting up a repeater?
    1. rrlanham -
      You can remove those if you are not going to use. For live, you need to configure Application.xml /Streams /LiveStreamPacketizers. See this post, at bottom shows what live packetizers you need for origin and edge.
      http://www.wowzamedia.com/forums/con...er-Quick-Start

      Richard
    1. digitalfin -
      Does the publish.password file only support one pair of username/password or as many as we need?
    1. rrlanham -
      You can have many lines, no practical limit that I know of. One username password per line.

      Richard
    1. phattran911 -
      For dynamic streaming, does the FMLE need to publish multiple bitrate live stream to wowza servers? I don't see such option in the FMLE so I guess not.
    1. rrlanham -
      FMLE interface allows you to enter multiple bitrate definitions, it's in the lower-left, you have to check a box for each added. Then you have to add "%i" to the stream name, e.g., "myStream%i". Then FMLE will publish myStream1, myStream2, etc..

      Richard