Wowza Community

Dynamic Bandwidth Detection (BWCheck)

Okay, it’s the example. mostly at least. So you are looking for the trace output of the line below specifically “kbitDown”:

trace("onBWDone: kbitDown:"+kbitDown+" deltaDown:"+deltaDown+" deltaTime:"+deltaTime+" latency:"+latency);

Do you see this trace, and what is it if you do?

There is a server-side to this too, you have to have the right section in the Application.xml at [wowza-install-dir]/conf/video/Application.xml

Also, remember to take out the FLVPlayback Module that is in the original Application.xml. You don’t need that when using the bw check module.


That looks perfect. Is it solved?


Yes, send to

I think I see the problem. You have to re-order the flow.

When onBWDone returns kbitdown is when you should call createPlayStream.

Also you are closing the connection onBWDone, don’t do that.

There are 3 changes below should do it:

nc.onBWDone = function(kbitDown, deltaDown, deltaTime, latency) {
trace("onBWDone: kbitDown:"+kbitDown+" deltaDown:"+deltaDown+" deltaTime:"+deltaTime+" latency:"+latency);
// app logic based on the bandwidth detected follows here
detected_bw = kbitDown;
createPlayStream(); // insert this here
// close the Netconnection to bwcheck
function doConnect()
// createPlayStream(); // comment this out
videoLastW = 0;
videoLastH = 0;

When do you call this function from the client? It might be too soon. You should wait till you get “NetStream.Play.Start” notification in your NetStatus event handler. Something like:

protected function statusHandler(evt:NetStatusEvent):void {
	switch ( {
		case  'NetStream.Play.Start'"getStreamStats",new Responder(handleResponse),"someStream");


The approach is to use the bandwidth checker to determine available bandwidth to the client, then use that information to play a video with appropriate bit rate for that connection. The buffer is not something you want to adjust for this purpose.

And bandwidth checking is not automatic. And what you do with the results of the bandwidth checking is not automatic. You have to add the module to Application.xml, and you have to run the bandwith checking functions in the player, and you have to take the result and do something with it: play a version of the video that you have encoded to a bit rate for that connection speed.


Yes, the source code for bandwidth checker is in first post of this thread. You can compile your own version in the Wowza IDE to make adjustments.


Did you add the jar file to wowza/lib folder then restart Wowza, and did you add the module to Application.xml. You want to connect to the Wowza server that you added that jar to, and to the application that you added the Module to.


There is a Actionscript 3 version of ctosbwcheck in [wowza-install-dir]/examples/BWCheck/CtoSBWCheck.fla

The results of the bwcheck do vary from moment to moment, which is normal result of varying network conditions.


It should be here:

[install dir]\examples\BWChecker\client\CtoSBWCheck.fla

I’ll send it to that email too.


There is a working AS3 example here:



It’s on page 2 of this thread. You have to build it in the Wowza IDE

It tests from client to server. The default one at the top tests from server to client.


I don’t understand the question. Can you explain?


I think you are talking about using Netstream.play2() and netstreaminfo object. This what is used to implement Flash Dynamic Streaming, for example JW Player’s implementation

You can search around but here is one article that looks useful

Here is how the simple, before connect method to check bandwidth

I think that camera.setQuality() will have an affect on a stream after you do netstream.publish()


You’re English is great. Thanks for the update.


i’m having some problems with converting the BWChecker to AS3.

this is what i’ve got :

var constring="rtmp://localhost/bwcheck";
var detected_bw:String;
var counter:Number=0;
var nc:NetConnection=new NetConnection;
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler );
function netStatusHandler (e:NetStatusEvent):void{
	trace("Level: "" Code: ";
	if ( == "NetConnection.Connect.Success") {
		trace("--- connected to: " + nc.uri);	//this.uri
function onBWCheck(latency:String):Number{
	trace("in onBWCheck");
	return ++counter; // Serverside, just ignore any return value, For now return the call count
function onBWDone(kbitDown, deltaDown, deltaTime, latency):void{
	trace("==>in onBW_DONE");
	trace("onBWDone: kbitDown:"+kbitDown+" deltaDown:"+deltaDown+" deltaTime:"+deltaTime+" latency:"+latency);
	//detected_bw = kbitDown;
nc.connect(constring, true);

and i get this as a result (haven’t changed anything to serverside code, or is it necessary that i do that?):

in onBWCheck

Level: status Code: NetConnection.Connect.Success

— connected to: rtmp://localhost/bwcheck

ok , works like a charm now. Thanks a lot !

Hi Craigweb,

You may find netlimiter useful:



Hi Charlie,

like balint.pelhos , I need to calculate the actual bandwidth after the stream has started without start another connection and generating an extra traffic.

I read your reply about it, but I’m not able to use IOPerformanceCounter interface like you suggested…

Is it possible have some indication or some reference how to implement it (server side and client side).


For using the bandwidth checker module, the instruction (posted below) asks for the FLVPlayback module to be removed. I would like to know why this needs to be done?




Create a folder named [install-dir]/applications/bwcheck

Create a folder named [install-dir]/conf/bwcheck

Copy [install-dir]/conf/Application.xml into new bwcheck config folder

Edit copied Application.xml file and remove the module reference to ModuleFLVPlayback and add the module reference below as the last entry in the section (it is important that it is the last entry):