• 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. dx2222 -
      Hi everyone,

      Is it possible to publish a stream from a custom application without using the encoding software suggested?
      I want to make a mobile application which will enable me to send and publish live video stream from my blackberry to the wowza server - is that possible?
    1. rrlanham -
      I answer this in similar post.

      http://www.wowza.com/forums/showthre...ght=#post75773

      Richard
    1. Leopold O'Donnell -
      Quote Originally Posted by cnynracer1 View Post
      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.
      The latest (pre-release - coming soon - honestly ;-) ) does a nice job of encoding with H.264.

      Get it here: http://labs.adobe.com/downloads/flashplayer11.html

      It takes some fiddling to get flash building in your dev environment:
      Flex instructions here: http://www.youtube.com/watch?v=LlME1tUrDTo
      Flash Professional CS5.5 instructions here: http://forums.adobe.com/message/3906794#3906794

      Here are some snippets for your flash code that will effect the changes:
      Code:
      	// Settings for H.264 - this is all there is to it. Sadly no AAC :-(
      	var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();
      
      	h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_2);
        	nsPublish.videoStreamSettings = h264Settings;
      I"ve used this successfully with some Xuggler code that I fire off from a module to post process streams for IOS availability. This could have been done as a distinct server, but I felt it better to manage one app than two.
    1. rrlanham -
      If it doesn't do mp3 or aac audio, it still won't be useful outside of Flash apps without a transcoding layer.

      Richard
    1. ztatic -
      Note: The iPhone 3GS and older and iPod touch devices require video encoded using H.264 format, Baseline 3 profile, or lower, and AAC or MP3 stereo audio.
      What is Baseline 3 profile? and what does that mean for iPhone 3GS etc?
    1. lisa_w -
      This is in reference to what the iPhone 3 supports per Apple's technical specifications. So if you encoded to a profile higher than Baseline, you would not be able to play it back on the iPhone 3GS and older.

      -Lisa
    1. robertookla -
      It seems we need a minimum 80kbps for audio bitrate for it to stream on iOS. If I go lower than 80kbps, the video freezy after 2 seconds on iphone. Is there a way to fix this problem, to have the bitrate lower than 80kbps?
      Thanks
    1. rrlanham -
      Some iOS devices might not handle audio under 128kbs if it is mp3. But AAC 64kbs or lower is okay. And newer iOS with latest iOS software handles lower bitrate mp3.

      Richard
    1. robertookla -
      I am actually using Iphone 4 S, iOS 5.1 so it is the latest one. How do we enable ACC from FMLE? There is only 1 option for mp3 format
    1. rrlanham -
      You need MainConcept AAC plugin to enable AAC in FMLE.

      Try 64kbs mp3.

      Richard
    1. brayster99 -
      Could you please disambiguate this example where you have multiple bitrates and multiple origins.

      Thanks

      Quote Originally Posted by rrlanham View Post
      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. randall -
      brayster99, that example SMIL specifies two different bitrate streams which are part of a keyframe aligned multibitrate group. For example, if you were streaming two live keyframe aligned streams to the origin called myStream1 and myStream2, which are different bitrates, and you wanted to serve them as a multibitrate group in an origin-edge configuration, you would put that SMIL on each of your edge servers. Each edge would also need the two .stream files. On the edge, the SMIL points to the .stream files, the .stream files point to the origin streams. The .stream files will generally point to the same origin server.

      Any questions?
    1. rogerlittin -
      Hi brayster99,

      Your response came through to the support desk.

      I have two origins for encoder redundancy. Does the .stream file look like rtmp:/origin1/app/inst/name|rtmp://origin2/app/inst/name ?
      If you do have multiple origin servers then that is the correct way to have them in the .stream files but it may cause a problem with key frame alignment if one of the streams is temporarily unavailable on one of the origin servers.

      You should be able to use the ModuleMediaCasterStreamMonitorAdvanced module to monitor & reset the streams if they do get out of sync.

      In your case, you would run the module on the edge server so if one of the streams from the origin does get out of sync, it would try reconnecting to the origin servers, starting from origin1. There would be problems if one of the streams was still running on origin1 as it would get that stream and it would get the other from origin2. If you are using FMLE to send the streams to your origin servers as multi bitrate streams then it should reset both if they become out of sync.
    1. brayster99 -
      I now have the following files in the "content" directory and have started them with type livestreamrepeater in the stream manager. I have tested all three stream indivually by using an iphone to go to http://theedgeserver/app/inst/thefil.../playlist.m3u8 where the file name is the thefilename.stream is the thing i started in stream manager. BUT the smil file still doesnt doesnt work. So I thought it might have trouble switching so I out only one entry in the smil like;

      Code:
      <smil>
          <head>
          </head>
          <body>
              <switch>
                  <video src="thefilename.stream" system-bitrate="650000"/>
              </switch>
          </body>
      </smil>
      and it still doesnt work. What should I try?
    1. rrlanham -
      When using .stream files use (in your case) "filename.stream" to start the stream in StreamManager (not its contents) on the edge with MediaCaster type "liverepeater".

      Richard
    1. progati -
      Hi. I am sending an RTMP stream to Wowza using Wirecast. I can successfully see the live stream on iOS devices, and on Android and Web browsers (using the Flash RTMP client), but Silverlight is behaving oddly. If I put the clientSilverlight folder on my local drive or use an SMB connection to my HTTP server, then things play properly, but if I link to the Default.html on my HTTP server using an HTTP URL, then I only see the Wowza Live Video Streaming banner, but the player isn't visible, just a white space.
    1. rrlanham -
      You have to copy the /clientBin folder to the same location as the Default.html file

      Richard
    1. progati -
      I copied the entire LiveVideoStreaming folder to my HTTP server. In that is a clientSilverlight folder which contains the Default.html file and the ClientBin folder (which just has LiveSmoothStreaming.xap in it).

      The URL I am using is http://my.server/LiveVideoStreaming/...t/Default.html - Paul
    1. randall -
      progati,

      What you have done seems correct. Try updating your Silverlight plugin, or try with a different browser (and plugin).
    1. sigizmynd -
      I try to use Adobe Live Encoder with Wowza.
      When I publish stream, it create not sdp but flv.
      and video not work(((