Copy link to clipboard
Copied
Hi,
In my netwrok rtmp is not supported,so i am not able to make rtmp connection.
I tried with rtmpt(ports 80,443)and able to get connected and publish the live stream to FMS(using AS3).
But with in 5 to 6 minutes my proxy server block the streaming.Reason,my proxy can allow only 600 http request per minute from a particular computer(client machine),but while publishing through rtmpt after some time http post request coming form client machine increase the limit of 600 per minute,so proxy block the connection.
I am making my connection like this "rtmpt://xx.yy.zz.kk:80/Training" where xx.yy.zz.kk represent internet IP.
Please suggest some turnaround so that in case of rtmpt(http tunelling) http post request will not increase periodically.
Regards
Nitesh kumar
1 Correct answer
The problem got resolved by using connecting FMS using rtmps with port 443.
Copy link to clipboard
Copied
I don't think there is any possible workaround to get around this problem because traditionally publish is done via rtmp. But what i want to understand from you that whether you are saying that every minute http request keeps on increasing, i mean it can be case that when publish stops for that minute it crosses 600 request limit. I mean if its keeps on increasing for every minute then its real issue which i dont think might be the case - but do let me know
Copy link to clipboard
Copied
Hi SE,
Thanx for reply. I want to say that when I publish video to the server. The request message is more than 600 per minute for every minutes, which lead to block of http request by the ISA. I think I must be doing some mistake, which leads to such problem. There should be one request for the connection and then for every data frame there should be continuation of that but it should not be new request. I calculated when I publish the video using wireshark is around 15-24 request per second. I have compared the request count with one of the application "openmeeting" which is also using rtmp connection but in our proxy it fails to make connection. Then it tries to make connection using rtmpt and get connected. In this case the request is only ones in a second to our proxy which leads to freely flow of video to the server.
I'm trying to give the architecture of my server and api used to publish the video below.
Architecture:
Tomacat server at port 8080 on same PC with FMS at port 80,1935.
Code snippet to publish at client side is:
serverIP = "rtmpt://59.162.23.65:80/live";
private function onNetStatus(event:NetStatusEvent):void
{
switch (event.info.code)
{
case "NetConnection.Connect.Success" :
publishCamera(camName,micIndex);
break;
}
}
private function publishCamera(camName:String,micIndex:int):void
{
m_cam=Camera.getCamera(camName);
switch(m_resolution)
{
case "160x120" : m_cam.setMode(160,120,15);
break;
case "320x240" : m_cam.setMode(320,240,15);
break;
case "640x480" : m_cam.setMode(640,480,15);
break;
default : m_cam.setMode(320,240,15);
break;
}
m_cam.setQuality(0,85);
if(micIndex != -1)
{
m_mic=Microphone.getMicrophone();
m_mic.codec = SoundCodec.SPEEX;
m_mic.setUseEchoSuppression(true);
m_mic.setLoopBack(false);
m_mic.setSilenceLevel(20);
m_ns.attachAudio(m_mic);
}
m_ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
m_ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
m_ns.attachCamera(m_cam);
m_ns.publish(m_publishName, "live");
}
code snippet at server side is:
application.onConnect = function(myClient,Publisher)
{
clientObj = myClient;
if(streamObj != null)
{
trace("streamObj: " + streamObj.name);
trace("clientObj: " + clientObj);
if(streamObj.name == clientObj)
{
trace("streamObj == clientObj");
}
else
{
trace("streamObj != clientObj");
}
}
else
{
trace("streamObj is null");
}
this.so.setProperty(myClient.name, myClient);
trace(clientObj + "connected with IP: " + clientObj.ip);
trace(Publisher + " get connected");
return true;
}
application.onPublish = function(myClient,myStream)
{
trace("Live Publish began");
streamObj = myStream;
}
Please help.
Thanx
Copy link to clipboard
Copied
The difference with rtmp vs. rtmpt is that rtmpt being over http is a request-response model. In order for FMS to send any data to the client, we need to have an http request to piggy back the data on an http response. As such, the client sends "idle" http requests to the server even when it has no data to send in order for the server to have a request it can piggy back a response on if it needs to send data to the client. These idle requests are sent very often so the server doesn't have to wait long to be able to send (possibly urgent) data to the client.
Copy link to clipboard
Copied
I should also note that the idle posts are less important for a publishing client where data is mostly being sent from client to server. But for subscribing clients, the idle posts would be very important for the server to be able to send data to the clients.
Copy link to clipboard
Copied
Hi Chan,
Thanks for Your resposne,I agree with you that rtmpt is as requset/response model.I just want to understand
why after 4 to 5 minutes of publish with rtmpt, my http post request from client machine start increasing and
reaches the max limit set by my isa-proxy server.
Copy link to clipboard
Copied
What is the max request rate that your proxy server will allow?
Just doing a quick calculation, I'd expect to see http requests somewhere between 120-300/min.
This assumes an "idle" request is sent every 500 msec in the case when there is no data being sent that means 120 requests/min.
Assuming audio packets are sent every 20 msec that means 300 requests/min.
If you're seeing more than that, I'm don't have an immediate answer for you.
Copy link to clipboard
Copied
My proxy server allow 600 http request/min.I analyze with WireShark (network sniffer tool) that intially http post request from client machine to server are
6/Sec.mean 360/min (fine). but then after some time it start increasing.I just want to understand,who is the culprit,Flash Player,Publishing Code,FMS,Proxy/FireWall.
Copy link to clipboard
Copied
Well, as I mentioned, FlashPlayer is definitely sending lots of http requests; this is part of the rtmpt protocol. And assuming audio every 20 msec (typically), that only accounts for 300/min. So that is roughly in line with what you saw (360/min). Not sure why after some time this starts increasing. What's your audio sample rate?
Copy link to clipboard
Copied
I tried it with all the audio samples rates ie 11025,22050,4100 Hz, Even i tested it with Flash Media Live Encoder 3 but same result for all the combinations.
Copy link to clipboard
Copied
You can try using the logLiveStream admin API to enable logging of the incoming msgs for a particular stream to see what the msgs are, and what the timestamps are.
Do do this, enable this admin cmd in Users.xml.
<AdminServer>
<HTTPCommands>
<Enable>true</Enable>
<Allow>logLiveStream</Allow>
<Deny>All</Deny>
<Order>Deny,Allow</Order>
</HTTPCommands>
</AdminServer>
This will enable only logLiveStream cmd via http. Alternatively, you could just allow all cmds via http by changing <Allow>All</Allow>, and <Deny></Deny> (empty).
Publish your stream. Then execute the following cmd from a browser.
http://adminserver:1111/admin/logLiveStream?auser=username&apswd=password&appinst="live/_definst_"&stream="foo"&mode=[send-input]
replacing "adminserver" with the hostname/ip of the FMS admin server, "live/_definst_" with name of the app/inst you're connecting/publishing to, and "foo" with the name of the stream you're publishing. The mode arg says to log all the msgs that FMS receives in the input side for the specified stream.
This will create a log file in the FMS logs directory and will have a name something like, netstream_x_y.log.
Copy link to clipboard
Copied
Hi Chan,
I have tried to write log file as per you. I followed the steps written by you but while executing the code I'm getting error :
<level>error</level>
<code>Admin.API.InvalidMethod</code>
<description>loglivestream - No such method found!</description>
<timestamp>9/28/2010 1:12:13 PM</timestamp>
Copy link to clipboard
Copied
Which version of FMS are you using?
Copy link to clipboard
Copied
Hi,
we have checked for FMS developer 3.5 and 4.0 both
Thanks
Copy link to clipboard
Copied
The problem got resolved by using connecting FMS using rtmps with port 443.
