# Dynamic Bandwidth Detection (BWCheck)

**URL:** https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [March 15, 2007, 6:40am UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31 "2007-03-15T06:40:15Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [June 15, 2010, 4:15pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/21 "2010-06-15T16:15:32Z")

</div>

Flowplayer and JW Player both have dynamic switching solutions to accomplish this. They use BWCheck in the beginning, but only once, then use NetStream.info object, the “QoS” (quality of service) metrics to decide when to switch streams.

I’ve not worked with the Flowplayer implementation, but I have used the JW player one. The tutorial is here:

[http://www.longtailvideo.com/support/tutorials/Bitrate-Switching](http://www.longtailvideo.com/support/tutorials/Bitrate-Switching)

You need versions of a video that are Keyframe and timecode aligned. The MS Expresssion encoder seems to be able to do that.

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [June 15, 2010, 10:01pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/22 "2010-06-15T22:01:45Z")

</div>

Are you doing live streaming? Wirecast does live, Expression encoder doesn’t do live. At present, as far as I know, Wirecast does not do the necessary alignment for this purpose. FMLE works.

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [June 16, 2010, 12:17am UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/23 "2010-06-16T00:17:34Z")

</div>

We have guides in the Live Encoder section:

[http://community.wowza.com/c/-/8](http://community.wowza.com/c/-/8)

I can’t really recommend. They all have their strengths, weaknesses and price points

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [June 21, 2010, 9:29pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/24 "2010-06-21T21:29:33Z")

</div>

If you are still using Wirecast, as I mentioned before I think, it does not properly align the keyframe timecodes to make live switching possible. FMLE can do this. Have you seen this, you can debug keyframe timecodes with this, to see if they are lining up:

[https://www.wowza.com/forums/showthread.php?t=7942](https://www.wowza.com/forums/showthread.php?t=7942)

Richard

---

<div class="post-metadata">

### Author: ![Jake\_Hilton](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@Jake\_Hilton](https://community.wowza.com/u/Jake_Hilton)
#### Post date: [April 6, 2010, 2:22pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/25 "2010-04-06T14:22:42Z")

</div>

My point is the jar does not fire the onBWDone call twice but the code sample does… hence I believe they are not in sync on a code level.

And to your code sample… I am seeing bw numbers on both calls and so both onBWDone calls would be considered valid which isn’t the correct usage. The two calls report very different bandwidth numbers.

Thanks,

Jake

---

<div class="post-metadata">

### Author: ![Derrick\_Freeman](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Derrick\_Freeman](https://community.wowza.com/u/Derrick_Freeman)
#### Post date: [May 17, 2010, 10:16pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/26 "2010-05-17T22:16:31Z")

</div>

Hey Richard,

I was looking at the response you had for using JW Player 5.1 for dynamic streaming in this thread.

> No, this is not needed for that. The main thing you need is video versions that have properly aligned keyframe timecodes. Follow this tutorial:
> 
> [http://www.longtailvideo.com/support/tutorials/Bitrate-Switching](http://www.longtailvideo.com/support/tutorials/Bitrate-Switching)
> 
> Richard

So, I’m looking into dynamic streaming with RTMP as mentioned here ([http://www.longtailvideo.com/support/jw-player/jw-flv-player-v4/27/bitrate-switching):](http://www.longtailvideo.com/support/jw-player/jw-flv-player-v4/27/bitrate-switching%29:)

and saw this listed in the doc:

“Stream switching for RTMP based upon bandwidth only works if the server implements a checkBandwidth call. This is default in FMS 3.0+, and easy to set up with Wowza. If there’s no checkBandwidth handler, streams will be switched based solely on the available display width.”

Do I need to set anything up on Wowza 2 for this?

Thanks,

Derrick

---

<div class="post-metadata">

### Author: ![Derrick\_Freeman](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Derrick\_Freeman](https://community.wowza.com/u/Derrick_Freeman)
#### Post date: [May 17, 2010, 10:35pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/27 "2010-05-17T22:35:28Z")

</div>

OK Cool. Thanks Richard

Derrick

---

<div class="post-metadata">

### Author: ![Ivan\_Chabanaud](https://avatars.discourse-cdn.com/v4/letter/i/bbce88/32.png) [@Ivan\_Chabanaud](https://community.wowza.com/u/Ivan_Chabanaud)
#### Post date: [March 5, 2011, 7:03am UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/28 "2011-03-05T07:03:40Z")

</div>

I am not able to run these demo in BWChecker

CtoSBWCheck.html and bwcheck.html

Do you have AS3 and flex version of it

for CtoSBWCheck reponse

> [@Dynamic Bandwidth Detection (BWCheck)](http://community.wowza.com/t/-/73):
>
> Below is a bandwidth checker from forum contributor Roger. It is a Wowza Pro/Java version of the bandwidth checker discussed in this article: [http://www.adobe.com/devnet/flashcom/articles/flvideo\_bandwidth.html](http://www.adobe.com/devnet/flashcom/articles/flvideo_bandwidth.html) Java code: Download a built version of this code from [wms-plugin-bwcheck.zip](https://www.wowza.com/downloads/forums/bwcheck/wms-plugin-bwcheck.zip) Unzip and copy the wms-plugin-bwcheck.jar file (not the entire folder) into the [install-dir]/lib folder and restart the server package com.wowza.wms.plugin.bwcheck; import java.util.\*; import com.wowza.…

---

<div class="post-metadata">

### Author: ![brk\_so](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@brk\_so](https://community.wowza.com/u/brk_so)
#### Post date: [April 20, 2010, 11:00am UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/29 "2010-04-20T11:00:36Z")

</div>

It outputs the following data:

kbitDown:10828

deltaDown:779.616

deltaTime:0.072

latency:36

How can I calculate out of this the bandwidth:

Is deltaTime in milliseconds ? is it the time it took to download ?

What is deltaDown? is it in bits, in Milliseconds ?

Is latency in milliseconds ? How do I add it to the equation ?

kbitDown is the total amount of bits sent, right ?

Thanks

---

<div class="post-metadata">

### Author: ![brk\_so](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@brk\_so](https://community.wowza.com/u/brk_so)
#### Post date: [April 20, 2010, 12:27pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/30 "2010-04-20T12:27:59Z")

</div>

Thanks Richard, but I was aiming at something else.

Suppose I have a myFIle that I send to the user,

and i want to calculate how long it will take for the user to recieve it.

I know my file size, but i dont know what`s the user download speed.

How can I tell the user`s download speed by this data, please ?

---

<div class="post-metadata">

### Author: ![brk\_so](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@brk\_so](https://community.wowza.com/u/brk_so)
#### Post date: [April 20, 2010, 1:39pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/31 "2010-04-20T13:39:49Z")

</div>

Thanks Richard so if

kbitDown:1000

it means it loads 1000kbit per second ?

and if , then i want to send a file of 1000kbit to the user

it will be transferred in:

1 second + latency ?

---

<div class="post-metadata">

### Author: ![brk\_so](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@brk\_so](https://community.wowza.com/u/brk_so)
#### Post date: [April 20, 2010, 6:00pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/32 "2010-04-20T18:00:25Z")

</div>

You must have had someone else in mind when sending this message, Richard.

Which makes a lot of sense to me, Considering you must be answering such a multitude of questions by so many users.

Please believe me I have no issue with the QoS metrics built-in to Flash, nor the NetStream.info.

I`m simply trying to use this BWcheck module as a means of claculating how long will it take the user to recieve a specific big file (the file`s not being sent with NetStream at all).

Neither did I assume that latency and kBitDown are the same.

I just attempted to determine if the formula for calculating how long a file will take to be transferred (assuming bandwidth is not constant) would be:

```auto
Latency + kbitDown*fileSize in kbits 

```

Is my formula correct ?

If not, what would be the right formula, please ?

Also, you said:

> “latency” is how long will it take to start playing
> 
> The speed at which it will play once it starts is indicated by kbitDown
> 
> In what units is measured latency ? seconds ?
> 
> and in what units is measured kbitDown? kbits per second ?
> 
> Many thanks

---

<div class="post-metadata">

### Author: ![brk\_so](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@brk\_so](https://community.wowza.com/u/brk_so)
#### Post date: [April 20, 2010, 6:18pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/33 "2010-04-20T18:18:21Z")

</div>

> Please excuse me.

Surely there`s no need for any excuse at all…

Quite the opposite - Thank you for your swift responses and assistance !

Thank you for asserting my assumption about the units AND for correcting my formula. Of course it`s divided and not multiplied.

Again , many thanks - you`ve helped me a great deal.

---

<div class="post-metadata">

### Author: ![brk\_so](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@brk\_so](https://community.wowza.com/u/brk_so)
#### Post date: [April 20, 2010, 6:31pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/34 "2010-04-20T18:31:43Z")

</div>

Please just another question:

Is KILO calculated in the wowza server in standard notation as in 1 Kilobit= 1024 bits or in IEEE notation as in 1 Kilobit=1000bits, please ?

---

<div class="post-metadata">

### Author: ![Steven\_Hartland](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@Steven\_Hartland](https://community.wowza.com/u/Steven_Hartland)
#### Post date: [July 21, 2010, 10:58pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/35 "2010-07-21T22:58:55Z")

</div>

> Hi Richard, I cant get the LIVE RTMP stream switching… I followed guides from flow player and cant get live rtmp working. VOD RMTP works, but not LIVE…
> 
> Our task is to have one page for the viewer to enter and depending on the load of his/her connection it will choose between 3 streams 700 kbps, 400, and 150…

As far as I’ve been able to determine dynamic switching doesn’t work for live streams due to the lack the ability to buffer ahead of play back time.

The details of my findings are here:-

[https://www.wowza.com/forums/showthread.php?t=8378](https://www.wowza.com/forums/showthread.php?t=8378)

---

<div class="post-metadata">

### Author: ![Vivek\_Gupta](https://avatars.discourse-cdn.com/v4/letter/v/f17d59/32.png) [@Vivek\_Gupta](https://community.wowza.com/u/Vivek_Gupta)
#### Post date: [May 1, 2010, 7:56pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/36 "2010-05-01T19:56:38Z")

</div>

I am using the bandwidth checker for my video streaming application and it is working well. However, I would like to show a progress bar while this is going on. Suggestions on how to do it? I am specifically looking for how to get the amount of bandwidth measurement data already received by flash client at a periodic interval.

Thanks,

Vivek

---

<div class="post-metadata">

### Author: ![Vivek\_Gupta](https://avatars.discourse-cdn.com/v4/letter/v/f17d59/32.png) [@Vivek\_Gupta](https://community.wowza.com/u/Vivek_Gupta)
#### Post date: [May 2, 2010, 11:49am UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/37 "2010-05-02T11:49:35Z")

</div>

Richard,

By result set you mean the payload used for bw estimation? I was hoping there is a way I can the amount of data received so far, in actionscript, on the player side. And divide that by the total number of bytes expected. Is that possible? If so, could you point me on how to do this?

Vivek

---

<div class="post-metadata">

### Author: ![Piet\_Mollen](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@Piet\_Mollen](https://community.wowza.com/u/Piet_Mollen)
#### Post date: [April 7, 2010, 12:58pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/38 "2010-04-07T12:58:05Z")

</div>

Do I need to use this module when trying to get JW player 5.1 and Wowza with Dynamic Bitrate Switching to work?

---

<div class="post-metadata">

### Author: ![Jason\_Lee](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@Jason\_Lee](https://community.wowza.com/u/Jason_Lee)
#### Post date: [April 8, 2010, 1:14pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/39 "2010-04-08T13:14:19Z")

</div>

> It seems the sample code is not up to date with the jar file… when using the jar the bw is reported to the client once… when using the code above compiled into a module… the bw call fires twice.
> 
> Also… one small suggestion… 🙂
> 
> When using the jar out of the box it might be nice to wrap the onConnect check in a try catch so that this error doesn’t occur if the second [buy acomplia](http://www.buyacomplia.net) param isn’t passed:
> 
> invoke(onConnect): java.lang.ClassCastException: com.wowza.wms.amf.AMFDataObj cannot be cast to com.wowza.wms.amf.AMFDataItem: com.wowza.wms.amf.AMFDataList.getBoolean(null:-1)
> 
> Thanks!
> 
> Jake

Thank you jakehilton for your prompt and complete response!

---

<div class="post-metadata">

### Author: ![dfs\_dfsasa](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@dfs\_dfsasa](https://community.wowza.com/u/dfs_dfsasa)
#### Post date: [May 29, 2010, 11:31pm UTC](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31/40 "2010-05-29T23:31:25Z")

</div>

You wrote:

There are AS2 and AS3 Flash client examples in the examples folder of Wowza Server:

[install-dir]/examples/BWCheck/client

and

[install-dir]/examples/BWCheck/clientAS2

I cant find the /examples directory! Do you have a link to the code, the as file?

[Previous page](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31.md?page=1)

[Next page](https://community.wowza.com/t/dynamic-bandwidth-detection-bwcheck/31.md?page=3)
