red5 1.0 rc1 - Native Bandwidth Detection Up/Down

1,344 views
Skip to first unread message

Giusanny

unread,
Feb 17, 2011, 11:11:53 AM2/17/11
to red5
Hi,
first of all..great work whith 1.0 rc1!

I read on the new web site www.red5.org about the features of the
laste rel. "Native Bandwidth Detection Up/Down"

How can I get an example (or documentation) of using this feature in
my Application class?
Is this feature like the old methods IBandwidthConfigurator...?

Dominick Accattato

unread,
Feb 17, 2011, 11:31:33 AM2/17/11
to red5in...@googlegroups.com, Giusanny
Hello Giusanny,

If I'm correct, the IBandwidthConfigurator was used to limit bandwidth etc... The Native Bandwidth Detection refers the ability to get the client2server bandwidth and the server2client bandwidth. 

If you remember the demo "bwCheck". That demo used to require the server app "bwcheck" to be installed.

Old Client 

see how this code uses a service
"bwCheckService.onClientBWCheck";
That means you used to need a bean to be installed on the server. 


The server app no longer needs to be installed. For instance, if you download this client and run against your server, you will see bandwidth statistics being sent back and forth without needing to install a server application. The code has been moved into Red5 instead.
now you can just call:
connection.call("checkBandwidthUp"); // client to server bw stats
connection.call("checkBandwidth");  // server to client bw stats

Does this make sense?

Giuseppe Sannicandro

unread,
Feb 17, 2011, 12:01:42 PM2/17/11
to Dominick Accattato, red5in...@googlegroups.com
Thanks Dominik, I got it.
 
Now, for example, if I want to know the bandwhith used from the publisher of a stream, I could use "checkBandwidthUp", but how can I use it in my Application class where I have the Connection of the user?
 

 
2011/2/17 Dominick Accattato <dacca...@gmail.com>

Dominick Accattato

unread,
Feb 17, 2011, 12:11:36 PM2/17/11
to Giuseppe Sannicandro, red5in...@googlegroups.com
Ok,

Again, this code used to exist only as an example that could be installed. It was obviously useful and other media servers like FMS do indeed have the native "checkBandwidth" call. However, I don't believe the other servers do "checkBandwidthUp" which is of course useful if you plan on switching camera quality settings based on the clients upload throughput. So I added the "checkBandwidthUp" as well due to it's usefulness.

So if you wanted the server to know the users upload bw, you could run the "checkBandwitdhUp" in a loop until you have a pretty good measurement. After you're measurement has been recorded, you could then just call another service method on the server..
nc.call("setClientBandwidth", result); 

keep in mind that "setClientBandwidth" is not a native method. You have to implement that yourself and do whatever serverside logic you desire with the result. Maybe you have a HashMap of clientCameras and you're storing their latest upload throughput. Whatever you like, be creative!

Dominick Accattato

Dan Rossi

unread,
Feb 17, 2011, 10:31:55 PM2/17/11
to red5in...@googlegroups.com, Giuseppe Sannicandro
They don't have a native bwcheck call it is likely using the same code that was ported over from FMS but they have built it into a module on the client object so the application doesnt need to include the code. It would be the same as moving this app code as a plugin and have the core run detection when true is sent as an arg to connect. They also dont have an upstream check in fms, this is something i put in the app ;)

They have progressed much further from this now though and now push information to the flash player via netstreaminfo to provide realtime byte information to be used for realtime bandwidth checking. This is then combined with the play2 method to use logic in the player code to determine which bitrate stream to switch two and dynamically switch in realtime without stopping or buffering. 

Have a look here at the dynamic streaming example, there is console logging to show what its doing, but the hd button isnt working on the controlbar yet. 


This works for both vod and live subscribers, where there is multiple live streams available when pushing with flash media encoder's multi rate profiles. 

Giuseppe Sannicandro

unread,
Feb 18, 2011, 3:46:24 AM2/18/11
to Dan Rossi, red5in...@googlegroups.com
So the flowplayer plugin does it already!
 
thanks guys
I would like to have documentation about red5 core to understand (first of all) and develop something intresting
2011/2/18 Dan Rossi <electr...@gmail.com>

Dan Rossi

unread,
Feb 18, 2011, 5:04:21 AM2/18/11
to Giuseppe Sannicandro, red5in...@googlegroups.com
it deals with the client side yes ;)

Dominick Accattato

unread,
Feb 18, 2011, 11:25:46 AM2/18/11
to red5in...@googlegroups.com, Dan Rossi, Giuseppe Sannicandro
Dan, 

Have you tested flowplayer with the latest native bw code to see if it works out of the box? As for the original port, yes Dan was the man! I just added it to the red5 codebase.
Reply all
Reply to author
Forward
0 new messages