Wowza Media Systems home  

Go Back   Wowza Media Server Forums > Wowza Media Server Pro Forums (version 1.7.x) > Help Requests

Reply
 
Thread Tools Display Modes
  #1  
Old 09-21-2009, 10:12 AM
ipirva ipirva is offline
Junior Member
 
Join Date: Sep 2009
Posts: 9
Default replicate live rtmp stream, flowplayer load balancing

Any encoders I have seen allow only sending the rtmp packets to two stream servers: one primary (active streamer) and one secondary/backup (Allegro DVT transcoders/encoders).
Is there a way that Wowza replicates the streams to all the other Wowza streaming servers? Or what is the correct way of streaming when you have for example 4 wowza streaming servers and every server has to send the stream to customers?

Another question would be has anyone been successful in implementing wowza load balancing with flowplayer?

Thank you for your support!

Last edited by ipirva; 09-21-2009 at 10:44 AM.
Reply With Quote
  #2  
Old 09-21-2009, 12:05 PM
rrlanham rrlanham is offline
Senior Member
 
Join Date: Dec 2007
Posts: 5,150
Default

Use Origin/Edge (live stream repeater) configuration. See the Multiple Server Live Streaming (Live Stream Repeater)" section of the user guide.

And you can use Wowza Dynamic Load Balancing:
http://www.wowzamedia.com/forums/showthread.php?t=4637

You have to modify Flowplayer and recompile for this type load balancing. This is not tested yet, but try changing org.flowplayer.controller.DefaultRTMPConnectionPro vider function _onConnectionStatus to this:

Code:
private function _onConnectionStatus(event:NetStatusEvent):void {
            onConnectionStatus(event);
			if (event.info.code == "NetConnection.Connect.Success" && _successListener != null) {
				
				if (event.info.secureToken != undefined)
						_connection.call("secureTokenResponse", null, TEA.decrypt(event.info.secureToken, "ThisToken"));

				_successListener(_connection);
			} 
			else if (event.info.code == "NetConnection.Connect.Rejected") {
				if (event.info.ex.code == 302) {
					setTimeout(function():void{
						_connection.connect(event.info.ex.redirect);
					},100);
					
				}
				
			}
			else if (["NetConnection.Connect.Failed", "NetConnection.Connect.AppShutdown", "NetConnection.Connect.InvalidApp"].indexOf(event.info.code) >= 0) {
				
				if (_failureListener != null) {
					_failureListener();
				}
			}	
		}
This is how to setup developement for Flowplayer so you can compile these changes:
http://flowplayer.org/documentation/...vironment.html

Richard
Reply With Quote
  #3  
Old 09-21-2009, 11:47 PM
ipirva ipirva is offline
Junior Member
 
Join Date: Sep 2009
Posts: 9
Default

Thank you for your quick reply! I will test the load balancer

I used the code you provided and I had two errors:
1. col: 53 Error: Access of undefined property TEA. -- solved with import com.meychi.ascrypt.TEA;
2. col: 6 Error: Call to a possibly undefined method setTimeout. -- adobe says "1180 Call to a possibly undefined method %s. This error appears only when the compiler is running in strict mode."

as I am completely a "new entry" in the action script world I would like to ask you if this is a problem or if it might be somehow fixed.
Reply With Quote
  #4  
Old 09-22-2009, 12:36 AM
ipirva ipirva is offline
Junior Member
 
Join Date: Sep 2009
Posts: 9
Default

ok ... some minutes later and googling I found that I had to: import flash.utils.setTimeout; in order to use setTimeout().

I used a timeout of 2000. 100 ms isn't it too low?
Reply With Quote
  #5  
Old 09-22-2009, 04:35 AM
rrlanham rrlanham is offline
Senior Member
 
Join Date: Dec 2007
Posts: 5,150
Default

Actually, 100 milliseconds is enough. This is a quirk of Flash that you have to wait a moment in this situation, but it doesn't have to be very long.

Richard
Reply With Quote
  #6  
Old 09-23-2009, 05:47 AM
ipirva ipirva is offline
Junior Member
 
Join Date: Sep 2009
Posts: 9
Default connection limit + load balancing

it works fine the redirect.

I was just wondering now that there is a connection limiting module (http://www.wowzamedia.com/forums/showthread.php?t=6012), a load balancing module (http://www.wowzamedia.com/forums/showthread.php?t=4637), would it be a solution to let the load balancer know when an edge server reached the upper connections limit?
Reply With Quote
  #7  
Old 09-23-2009, 05:54 AM
rrlanham rrlanham is offline
Senior Member
 
Join Date: Dec 2007
Posts: 5,150
Default

It's not built-in, but you might be able to extend the Load balancing system (which comes with source) to do it.

See this post for a suggested direction:
http://www.wowzamedia.com/forums/sho....php?t=5801#10

Richard
Reply With Quote
  #8  
Old 09-23-2009, 07:23 AM
ipirva ipirva is offline
Junior Member
 
Join Date: Sep 2009
Posts: 9
Default

ok, I will try to do it.

another thing I have just noticed: the load balancer do not knows if one edge fails and keeps sending traffic to it.
Reply With Quote
  #9  
Old 09-23-2009, 07:35 AM
rrlanham rrlanham is offline
Senior Member
 
Join Date: Dec 2007
Posts: 5,150
Default

I tested for this by shutting down the edge server OS, stopping Wowza service on an edge, and pulling plugs on the edge server, and no problem in those tests.

If you can replicate and capture debug logs when this happens, send to support@wowzamedia.com along with zipped /conf folder

Richard
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:06 PM.


Copyright © 2006 - 2008, Wowza Media Systems
Wowza Media Systems