• How to configure a live stream repeater

    Live stream repeater is a method for delivering a single live stream across a multiple server deployment to many viewers. The setup uses an origin/edge configuration where the source stream is published to an origin server and the stream is made available for playback on multiple edge servers. This article describes how to configure live stream repeater (origin/edge) applications. You can do this on a single computer that's running Wowza Media Server® if you want, in which case the [wowza-origin-address] and [wowza-edge-address] values are the same.

    Contents




    Basic configuration



    Wowza origin

    1. On the Wowza origin server, create the application folder [install-dir]/applications/liveorigin.

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

    3. Open the newly copied Application.xml file in a text editor and set the StreamType property to liverepeater-origin:
      Code:
      <StreamType>liverepeater-origin</StreamType>
    4. Start Wowza Media Server.

    Wowza edge

    1. On each Wowza edge server, create the application folder [install-dir]/applications/liveedge.

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

    3. Open the newly copied Application.xml file in a text editor and set the StreamType property to liverepeater-edge:
      Code:
      <StreamType>liverepeater-edge</StreamType>
    4. Start Wowza Media Server.

    Encoder

    Publish a stream from an encoder to the Wowza origin server:

    Connect: rtmp://[wowza-origin-address]:1935/liveorigin
    Stream name: myStream
    -or-

    Start a MediaCaster stream (for example, from an IP camera) using StreamManager.

    Testing basic configuration


    Use the Wowza Media Server LiveVideoStreaming example player to test the stream.

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

    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.

    Test from the origin server:

    Server: rtmp://[wowza-origin-address]:1935/liveorigin
    Stream: myStream

    Test from the edge server:

    Server: rtmp://[wowza-edge-address]:1935/liveedge
    Stream: rtmp://[wowza-origin-address]:1935/liveorigin/_definst_/myStream

    Configuring HTTP packetizers



    Live streams coming into Wowza Media Server must be packaged (packetized) before they can be delivered to clients using HTTP streaming protocols such as Apple HTTP Live Streaming (Apple® HLS), Adobe HTTP Dynamic Streaming (Adobe® HDS), and Microsoft® Smooth Streaming. The <Streams>/<LiveStreamPacketizers> list in Application.xml specifies the streaming protocols that are used when packetizing live streams. There are two types of packetizers: streaming packetizers and repeater packetizers.

    Wowza origin

    In a live stream repeater (origin/edge) configuration, streaming packetizers are used when delivering a stream from the Wowza origin server to a Wowza edge server. The <Streams>/<LiveStreamPacketizers> list in Application.xml on the origin can contain none, one, or more than one of the following streaming packetizers.
    cupertinostreamingpacketizer Enables Apple HLS live streaming to iOS-based devices.
    sanjosestreamingpacketizer Enables Adobe HDS live streaming to Flash® Player.
    smoothstreamingpacketizer Enables Smooth Streaming to Microsoft Silverlight®.

    On the origin server, add the desired streaming packetizers to /conf/liveorigin/Application.xml:
    Code:
    <!-- LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater, sanjosestreamingrepeater, dvrstreamingpacketizer, dvrstreamingrepeater -->
    <LiveStreamPacketizers>cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer</LiveStreamPacketizers>
    Wowza edge

    In a live stream repeater (origin/edge) configuration, a packetizer is set with a repeater value on a Wowza edge server. The <Streams>/<LiveStreamPacketizers> list in Application.xml on the edge can contain none, one, or more than one of the following repeater packetizers.

    cupertinostreamingrepeater Enables Apple HLS live stream repeater for iOS-based devices.
    sanjosestreamingrepeater Enables Adobe HDS live stream repeater for Flash Player.
    smoothstreamingrepeater Enables Microsoft Smooth Streaming live stream repeater for Silverlight.

    On each edge server, add the desired repeater packetizers to /conf/liveorigin/Application.xml:
    Code:
    <!-- LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater, sanjosestreamingrepeater, dvrstreamingpacketizer, dvrstreamingrepeater -->
    <LiveStreamPacketizers>cupertinostreamingrepeater, smoothstreamingrepeater, sanjosestreamingrepeater</LiveStreamPacketizers>

    Setting up originURL(s)



    Wowza edge

    On each edge server, add the origin server URL to the Application.xml file:
    Code:
    <Repeater>
    	<OriginURL>wowz://[wowza-origin-address]:1935/liveorigin</OriginURL>
    	<QueryString><![CDATA[]]></QueryString>
    </Repeater>
    For redundancy, you can define multiple origin servers for a single stream by specifying two origin URLs separated by the pipe character (|). For example:
    Code:
    <Repeater>
    	<OriginURL>wowz://[wowza-origin-address]:1935/liveorigin|wowz://[wowza-alternate-origin-address]:1935/backuporigin</OriginURL>
    	<QueryString><![CDATA[]]></QueryString>
    </Repeater>
    The above setup defines a single origin server per-application. Each stream that's played through that application uses the OriginURL value to locate the origin server for the stream. You can also configure per-stream routing by using stream names that include the full path to the source stream. For more information, see Using simple stream names.

    Note: In the event that the primary origin server fails, clients may experience up to a 12-second timeout before failover to the backup origin server is completed. Use the above method only for failover purposes.

    Note: The WOWZ™ protocol is a new TCP-based messaging protocol in Wowza Media Server 3.5 and is used for server-to-server communication. It's enabled by default. If one of the Wowza Media Servers in the origin/edge configuration isn't running Wowza Media Server 3.5, an RTMP connection will be established between the servers instead.

    Using simple stream names



    If you're using an encoder such as an MPEG-TS encoder in which the stream name isn't a simple stream name, of if you just want to simplify complex stream names for clients, you can use .stream files on the origin server to hide the complex stream names. For example, if your complex stream name on the origin server is udp://0.0.0.0:10000, use a text editor to create a file named origin.stream in the [install-dir]/content folder of each edge server and set the contents to udp://0.0.0.0:10000. You can then use origin.stream in place of [stream-name] in the example playback URLs to play the stream.

    Note: A .stream file is a plaintext file with a .stream filename extension. Make sure that your text editor doesn't use the .txt filename extension for this file.

    Note: You can also simplify complex URL-based stream names by using the StreamNameAlias AddOn.

    Playing the streams



    Note: In the following examples, [wowza-edge-address] is the IP address of an edge server running Wowza Media Server, [wowza-origin-address] is the IP address of the origin server running Wowza Media Server, and [stream-name] is the name of the live stream being sent to the origin server.

    To play the stream in Adobe Flash Player (San Jose/Adobe HDS)

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

    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-edge-address]:1935/liveedge/[stream-name]/manifest.f4m


    To play the stream on Apple iOS device (Cupertino/Apple HLS)

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

    URL: http://[wowza-edge-address]:1935/liveedge/[stream-name]/playlist.m3u8


    To play the stream in Microsoft Silverlight (Smooth Streaming)

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

    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.

    URL: http://[wowza-edge-address]:1935/liveedge/[stream-name]/Manifest


    To play the stream in Adobe Flash Player (RTMP)

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

    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-edge-address]:1935/liveedge
    Stream: rtmp://[wowza-origin-address]:1935/liveorigin/_definst_/[stream-name]

    Note: You can substitute the name of a .stream file on the origin server in place of the complex URL in Stream. For more information, see Using simple stream names.

    Securing the origin



    You can prevent unauthorized re-streaming from a server and direct streaming from an Adobe Flash client using SecureToken.

    Wowza Media Server 3.5 and later

    1. On the origin server, open [install-dir]/conf/[application]/Application.xml in a text editor and add the following <Module> definition as the last entry in the <Modules> list:
      Code:
      <Module>
      	<Name>ModuleRTMPAuthenticate</Name>
      	<Description>ModuleRTMPAuthenticate</Description>
      	<Class>com.wowza.wms.security.ModuleRTMPAuthenticate</Class>
      </Module>
    2. On the same origin server Application.xml file as above, add the following property to the <Properties> list at the bottom of the file:
      Code:
      <Property>
      	<Name>secureTokenSharedSecret</Name>
      	<Value>#ed%h0#w@1</Value>
      </Property>
    3. On each edge server, open [install-dir]/conf/[application]/Application.xml in a text editor and add the following <Module> definition (same as above) as the last entry in the <Modules> list:
      Code:
      <Module>
      	<Name>ModuleRTMPAuthenticate</Name>
      	<Description>ModuleRTMPAuthenticate</Description>
      	<Class>com.wowza.wms.security.ModuleRTMPAuthenticate</Class>
      </Module>
    4. In each edge server's Application.xml file (same as above), add the following property to the <Properties> list at the bottom of the file:
      Code:
      <Property>
      	<Name>secureTokenOriginSharedSecret</Name>
      	<Value>#ed%h0#w@1</Value>
      </Property>

    Wowza Media Server 3.1.2 and earlier

    1. Download and unzip the MediaSecurity Addon package.

    2. Copy the two .jar files from the package /lib folder to the Wowza Media Server /lib folder on the origin server and each edge server.

    3. On the origin server, open [install-dir]/conf/[application]/Application.xml in a text editor and add the following <Module> definition as the last entry in the <Modules> list:
      Code:
      <Module>
      	<Name>ModuleRTMPAuthenticate</Name>
      	<Description>ModuleRTMPAuthenticate</Description>
      	<Class>com.wowza.wms.plugin.security.ModuleRTMPAuthenticate</Class>
      </Module>
    4. On the same origin server Application.xml file as above, add the following property to the <Properties> list at the bottom of the file:
      Code:
      <Property>
      	<Name>secureTokenSharedSecret</Name>
      	<Value>#ed%h0#w@1</Value>
      </Property>
    5. On each edge server, open [install-dir]/conf/[application]/Application.xml in a text editor and add the following <Module> definition (same as above) as the last entry in the <Modules> list:
      Code:
      <Module>
      	<Name>ModuleRTMPAuthenticate</Name>
      	<Description>ModuleRTMPAuthenticate</Description>
      	<Class>com.wowza.wms.plugin.security.ModuleRTMPAuthenticate</Class>
      </Module>
    6. In each edge server's Application.xml file (same as above), add the following property to the <Properties> list at the bottom of the file:
      Code:
      <Property>
      	<Name>secureTokenOriginSharedSecret</Name>
      	<Value>#ed%h0#w@1</Value>
      </Property>
    7. Restart Wowza Media Server on all origin and edge servers so that the new .jar files are loaded.


    Securing the edges



    1. Follow the steps in the previous section (Securing the origin).

    2. In each edge server's Application.xml file (same as above), add the following property to the <Properties> list at the bottom of the file (below the secureTokenOriginSharedSecret Property):
      Code:
      <Property>
      	<Name>secureTokenSharedSecret</Name>
      	<Value>#ed%h0#w@1</Value>
      </Property>
      <Property>
      	<Name>requireSecureConnection</Name>
      	<Value>true</Value>
      	<Type>Boolean</Type>
      </Property>
    3. For this to work, your Flash application must return the SecureToken when it connects. For information about how to do this in JW Player, see How to add SecureToken Protection to LongTail JW Player 5.



    Updated: For Wowza Media Server 3.5 on 11-14-2012
    Comments 45 Comments
    1. rrlanham -
      Added "Securing the Origin" and "Securing each Edge" sections
    1. loudenboomer -
      Hi,

      regarding the <OriginURL>, does it have to contain RTMP link if I only use Cupertino for streaming from Edge servers to the clients?
      Is only RTMP used from Origin to Edge or HTTP can be used?

      In that case, the tag would be:
      <originURL>http://[wowza-address]:1935/liveorigin</originURL>
      is this valid?

      I use UDP/RTP as input to Origin.
      Thanks!
    1. rrlanham -
      No, it must be RTMP. The origin handles packetizing for HLS clients, the edge serves HLS clients. The edge restreams from the origin using RTMP.

      btw, you can use .stream files instead of originURL. Take a look at this guide:
      http://www.wowza.com/forums/content....er-Quick-Start

      Richard
    1. loudenboomer -
      Thanks for quick reply.
      I'm planning to use two physical servers, each one as origin and edge. From there I will add multiple edge servers. Each edge will be aware of the other Origin, so I need to configure them as mentioned in guide:
      <originURL>rtmp://[wowza-address]:1935/liveorigin|rtmp://[wowza-alternate-address]:1935/backuporigin</originURL>

      how do I you this together with origin.stream file that already contains this:
      rtmp://[wowza-address]:1935/liveorigin/_definst_/myStream

      Is this [wowza-address] then IP of Origin or the Edge server?
      Can the applications be named the same on both origin servers?

      Does this switch-over work only when thewhole origin server goes down or even when the stream is unavailable on primary Origin?

      If DRM is used (Wowza 3), where is the encryption done? On Edge servers?
      Thanks!
    1. countz -
      Is it possible to reduce the backup failover from 12 seconds to something much shorter?
    1. rrlanham -
      Add this Property to /conf/[edge-app-name]/Application.xml /MediaCaster /Properties list:
      Code:
      <Property>
      	<Name>streamTimeout</Name>
      	<Value>12000</Value>
      	<Type>Integer</Type>
      </Property>
      The value is milliseconds.

      Richard
    1. countz -
      Thank you for that, very useful.

      I've been looking all over for an old URL parameter to the repeater, which allowed to pass a custom origin for that connection (and by doing so, overriding the setting in Application.xml).
      The idea is that the player will do this in real-time, and Wowza will not rely on a .stream file or on the Application.xml value. But I can't find it anywhere, do you know where I might find this?
    1. rrlanham -
      A liverepeater-edge application can re-stream from a fully qualified origin url, which can be the contents of a .stream file, without setting the Application.xml /originURL to anything. So you can have many .stream files each pointing to different streams from different origin application.

      stream1.stream
      rtmp://[wowza-origin1-address]:1935/origin/myStream

      stream2.stream
      rtmp://[wowza-origin2-address]:1935/origin/myStream

      Richard
    1. rrlanham -
      You can pass parameters in a NetStream.play command then override play command to look at the querystring and decide which stream to play, among your .stream files

      http://www.wowza.com/forums/content....y-remap-stream

      Another approach would be to use IMediaStreamNameAliasProvider2:
      http://www.wowza.com/forums/content....der2-interface

      Using IMediaStreamNameAliasProvider2 you cannot use .stream files. You have to use simple alias names stream1, stream2.

      Richard
    1. IPVSINC -
      I'm having a really tough time getting the video to play from the edge server.

      I have an origin server setup per the tutorial w/ the /applications/liveorigin folder created. Copied and edited /conf/Application.xml to /conf/liveorgin

      On the edge server (and I setup a liveedge application on the origin server as well for testing but I am seeing the same results).... I created the /applications/liveedge folder and copied/edited /conf/Application.xml to /conf/liveedge/Application.xml per the tutorial. I entered the <OriginURL>rtmp://originwowzaaddress.com:1935/liveorgin</OriginURL> - Notice... in one tutorial, I see :1935 and another there is not a :1935. I have tried both ways to no avail.

      On the origin server, in the /content folder, I have created the .stream name... mystream.stream with the contents being the URL to my IP camera. I know the URL is correct because I have no problem using the streammanager and under the live application pulling and re-streaming the same IP camera with the same url...

      On the origin server, using the streammanager under liveorigin application, I have selected RTP and entered my stream name mystream.stream and selected OK. I have also tried things by selecting liverepeater as opposed to RTP. Still nothing.

      When I try to request the video using the following URL in safari which triggers quicktime to play the live video: rtsp://edgeserver.com:1935/liveedge/mystream.stream, it just hangs and I don't get the live video... All of this works if I simply pull the video from the IP cam using the live application using the streammanager....

      Thank you in advance,

      Tim
    1. rrlanham -
      If you step through the guide at the top of this thread, there are tests along the way, e.g. playback directly from origin. It is a good idea to go from top to bottom in that guide, and see how it all unfolds, testing along the way.

      You start the stream on the origin in this case with MediaCaster type "rtp". If you wanted to pre-start the origin stream on the edge, you could do that with MediaCaster type "liverepeater", but that should not be neccessary.

      Test with [wowza-install-dir]/examples/LiveVideoStreaming/client/live.html

      direct from origin:
      Server: rtmp://[wowza-address]:1935/liveorigin
      Stream: mystream.stream

      from edge, using full rtmp url to the origin stream:
      Server: rtmp://[wowza-address]:1935/liveedge
      Stream: rtmp://[wowza-address]:1935/liveorigin/mystream.stream

      from edge, using originURL + stream name
      Server: rtmp://[wowza-address]:1935/liveedge
      Stream: mystream.stream

      Richard
    1. mingster -
      It's been very helpful reading this forum. However we can't find liverepeater-edge-origin example. Are there instruction for liverepeater-edge-origin + ModuleRTMPAuthenticate?

      We have it fully working for origin -> edge. When trying out edge-origin, we keep getting NetConnection.Connect.Rejected from LiveMediaStreamHandler. All 3 roles (origin, edge-origin, edge) are configured on the same development box with rtmpe://localhost/the_role
    1. mingster -
      Additional note:
      I modified the working config from edge, adding cupertinostreamingpacketizer and smoothstreamingpacketizer, and update app type to liverepeater-edge-origin. It works for client, but edge got Connect.Rejected.

      If app type is back to liverepeater-edge, client works still, and ModulesRTMPAuthenticate.onConnect rejects the edge. AllEncoder property is set to unknown.
    1. randall -
      mingster,

      You'll want to get the "origin -> liverepeater-edge-origin -> edge" setup working first, before adding RTMPAuthenticate to the mix.
    1. eponte -
      Hi, How do I do for creating RTMP for my new server with Wowza?
    1. rrlanham -
      I responded here:
      http://www.wowza.com/forums/showthre...ed=1#post99038

      Richard
    1. cgerrish -
      Is it possible to have the edge servers look at multiple origin servers?
    1. rrlanham -
      Yes, the way to do that is to ignore Application.xml /originURL and use .stream files (or StreamNameAlias) to point directly to origin streams. The .stream file or alias rule will resolve to full rtmp url + stream name. For example you can have these two files:

      File1: /contents/stream1.stream
      contents: rtmp://[wowza-origin1-address]:1935/live/stream1

      File2: /contents/stream2.stream
      contents: rtmp://[wowza-origin2-address]:1935/live/stream2

      Then you can start stream1.stream and stream2.stream in StreamManager or /conf/StartUpStreams.xml with MediaCaster type "liverepeater".

      Make sure your .stream files are plain text and have .stream extension, watch out that your text editor does not add .txt extension.

      Richard
    1. vdavid -
      my unique scenario is to publish a stream from an encoder to another publishing point. is this possible in wowza at all. I want to do this directly from the origin server.
      More like Flash Media Encoder--->Origin Server 1--->Origin server 2
      but all configuration must be done on origin server 1 as I don't have access to the configurAtion of origin server 2. I want to send the encoded stream to a publishing point on 2 but it must first get to 1.

      Thanks.
    1. randall -
      Answered vdavid in this duplicate post.