Skip to main content
September 28, 2011
Question

what's the relationship between server_bytes_in and bytes_out ?

  • September 28, 2011
  • 2 replies
  • 1690 views

I wirte some code to get stream from remote server in live application

write the following code in application.onAppStart function in main.asc(application is live type) file.

        this.myNC= new NetConnection();

        this.myNC.onStatus = NC_onStatus;

        this.myNC.connect("rtmp://test.domain/live");

        trace("this.myNC.connect :: rtmp://test.domain/live");

Then :

function NC_onStatus(info)

{

        switch (info.code)

        {

                case "NetConnection.Connect.Success" :

                        application.myStream = Stream.get("stream");    //App stream

 

                        application.myStream.onStatus = NS_onStatus;

 

                        if (application.myStream)

                        {

                                application.myStream.play("stream",-2, -1,true,application.myNC); //If reset is true (1), any playing stream stops, and the playl

ist is reset. By default, the value is true

                        }

 

                        trace("Connect success!");

                        break;

                case "NetConnection.Connect.Failed" :

                        trace("connect origin failed!");

                        break;

                case "NetConnection.Connect.Rejected" :

                        trace("connect origin reject!");

                        break;

function NS_onStatus(info)

{

        trace(info.code);

}

When this vhost is running, I request the api of adminserver : getActiveVHostStats. But result of bytes_out field is very large.

And what's the relationship between server_bytes_in and bytes_out ?

This topic has been closed for replies.

2 replies

October 17, 2011

I tried to reproduce this particular case by creating a main.asc using the code given, But I am getting no such high bytes_out values even when my server_bytes_in and server_byte_out values are non zero.....

October 18, 2011

You can watch the video from the fms using the above code in main.asc .

The result which bytes_out now minus another bytes_out   generated 5 minutes ago  is greater than value of bandwith generated by one people watch the video.

Adobe Employee
September 28, 2011

Is rtmp://test.domain/live - same server where you are running this application or its different machine? I assume it is different server but at times for testing purpose people use same servers - so just want to rule that out. Secondly are there subscribers for server-side stream which you are creating?

September 30, 2011

Yes.  rtmp://test.domain/live is running on different machine.

But I can not understand your reply.

Thanks for still.

Nikhil_Kalyan
Participating Frequently
September 30, 2011

I can answer a part of your question.

server_bytes_in relates to netConnections created on the server.

What we generally do is to create netConnections from the client to the server whose stats can be collected in bytes_in and bytes_out. But the netconnections can also be made from the server (either to itself or to someother server) and these stats are capture using server_bytes_in and server_bytes_out.

Hope that helps.  Thank you !