Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

measure UPLOAD bandwidth. Not DOWNLOAD just UPLOAD.

New Here ,
Jul 01, 2015 Jul 01, 2015

Hey. Is there a way to measure UPLOAD bandwidth? I am writing an application which is sending flv video from webcam. But before I start send the video I need to know what upload bandwidth is on client site (only at the beginning). I have spent a lot of hours to find the solution but google has nothing to offer. Of course I am writing in AS3 and I am using FMS to stream. Please help

TOPICS
ActionScript
793
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 01, 2015 Jul 01, 2015

what kind of app?  web-based, air or projector/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 01, 2015 Jul 01, 2015

Web-based, flash. I found a function called "checkBandwidth" nc.call("checkBandwidth", null); performed on the server, but it returns the bandwidth for download, rather than upload. Am I correct?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 01, 2015 Jul 01, 2015

use the filereference class to upload and its progress event and getTiemr to calculate the upload speed.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 01, 2015 Jul 01, 2015

Thanks for the tip. I'll let you know in case of problems.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 01, 2015 Jul 01, 2015

FileReference requires that you manually select a file from your computer. Sorry, but this solution is not acceptable for me do you have any other ideas? Maybe it is possible to embed some file directly to swf and automatically send it to the server and then measure the bandwidth?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 01, 2015 Jul 01, 2015

what class are you using to upload your file now?

and you can try the urlloader class but i'm not sure you'll get more than a crude estimate because i think you'll be limited to determining the time the load operation is executed (but not necessarily when loading starts) and when it completes.  i don't think progress events are dispatched for uploads, but you should test that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2015 Jul 02, 2015

I use the NetConnection class to connect to the server and NetStream to handle stream from a webcam. Everything goes by RTMP protocol.

I tried to use the URLLoader class but function called load () of this class in the case of upload must be initiated by the user action.

It may come in handy:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html#

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 02, 2015 Jul 02, 2015

then your netstream has an info property that returns a netstreaminfo instance that has all the properties (eg, currentBytesPerSecond) you need to determine upload speed.

use a loop (like enterframe or timer) to periodically poll the netstream's quality of state and determine the upload speed.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2015 Jul 02, 2015

kglad‌ you were right to give a hint to the algorithm that uses the timer. This is it:

import flash.events.EventDispatcher;

import flash.events.Event;

import flash.events.NetStatusEvent;

import flash.net.NetConnection;

import flash.net.NetStream;

import flash.utils.Timer;

import flash.events.TimerEvent;

//class definition

.

.

.

// constructor code

public function connect(nc:NetConnection):void{

  if(nc.connected){

       netStream = new NetStream(nc);

       netStreamClient = new Object();

       netStream.client = netStreamClient;

       netStreamClient.onMetaData = onMetaData;

       netStreamClient.onPlayStatus = onPlayStatus;

       netStream.addEventListener( NetStatusEvent.NET_STATUS, statusHandler );

       var myTimer:Timer = new Timer(500,20);

       myTimer.addEventListener(TimerEvent.TIMER, function() {

            trace("currentBytesPerSecond (B/s): "+netStream.info.currentBytesPerSecond);

       });

       myTimer.start();

  }

}

//end class definition

Thank you so much for good advice, because the results of your algorithms exactly agree with my previous tests

The problem is that I have to get the highest possible upload bandwidth before sending the film to the server. The reason is that if the user has slow internet connection and most get 1.5 Mbps upload bandwidth, then videos will lost frames and the sound will be poor quality. That's why I want to check it in some way. Maybe embed movie to swf and then send to server without user knowledge? Then I  would be Measure upload bandwidth at the beginning. But how to embed flv movie to swf? And What kind of film I would have to send to fill whole upload bandwidth?. Minimum upload bandwidth is 3.0 - 3.2 Mbps with implemented camera settings.

Hint may be the site http://www.speedtest.net there using flash technology is measured first download and then upload bandwidth. My goal is to upload

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 02, 2015 Jul 02, 2015

i'm not sure what you're asking.

you can't do anything about the users upload speed.  it is, what it is.

you might be able to use some form of data compression so there are less data to send if the upload speed is below some threshold but i'm not sure that's what you want.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2015 Jul 03, 2015

Hi kglad,

my goal is to see what the maximum upload bandwidth can obtain the client. And nothing more. If we go to the page http://www.speedtest.net and run their speed test then we know how fast is the download and the upload speed of our internet. I need to measure user UPLOAD. As for speedtest.net. Something still is unclear?

And I am looking for solutions on how to measure the speed of sending customer (upload bandwidth). Any tips would be appreciated. Although some already checked.

How speedtest measure bandwidth?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2015 Jul 03, 2015

Everything I was looking for is speedtest-cli. Thanks for your help and to next time.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2015 Jul 03, 2015

use:

var maxBPS:int = 0;

  if(nc.connected){

       netStream = new NetStream(nc);

       netStreamClient = new Object();

       netStream.client = netStreamClient;

       netStreamClient.onMetaData = onMetaData;

       netStreamClient.onPlayStatus = onPlayStatus;

       netStream.addEventListener( NetStatusEvent.NET_STATUS, statusHandler );

       var myTimer:Timer = new Timer(500,20);

       myTimer.addEventListener(TimerEvent.TIMER, function() {

            trace("currentBytesPerSecond (B/s): "+netStream.info.currentBytesPerSecond);

          maxBPS=Math.max(maxBPS,netStream.info.currentBytesPerSecond);

if(myTimer.currentCount==myTimer.repeatCount){

trace('maxBPS=',maxBPS);

}

       });

       myTimer.start();

  }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2015 Jul 03, 2015

Unfortunately, using maxBPS I can check what was the maximum upload bandwidth at real time, and not what the user has maximum upload at all. So in my case completely useless. Speedtest-cli arranged the whole thing and I already implemented it 😉 Everything works fine.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 09, 2015 Jul 09, 2015
LATEST

Welcome. Unfortunately speedtest-cli turned out to be a mistake 😕 Speedtest-cli working properly. The problem is that it measures the maximum upload bandwidth of the server, not the client (it's python) 😕


I found on speedtest.net information on how they measure the upload bandwidth, but the algorithm has been quite complicated. Here is the link (I need only upload):

https://support.speedtest.net/hc/en-us/articles/203845400-How-does-the-test-itself-work-How-is-the-r...


I have a problem with sending certain data from the client to the server. The link that I gave is written: "A small amount of random data is generated in the client". How do I send data to the server of a specified weight (e.g. 1 kb of data)? If I find out how to do that then the rest should not be a problem because then I will be able to measure the transfer time of a certain weight of data.


I also found speedtest mini, which can be downloaded here: http://www.speedtest.net/mini.php After unpacking we receive files PHP, JSP, ASP, etc. and some JPG files of various sizes. It is possible that speedtest generates data from these files of a certain size? But how they do that? Generate byte array from JPG? Please help kglad

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines