How to negotiate red5 connection parameters for streaming with JAVA
I have been creating a thin browser client (on java) that sends an RTMP stream to a specified red5 instance. I also use RTMP Researcher to monitor the traffic and events that occur between the client and the server.
Here is what I note: There is obviously a map with options that is being exchanged between the red5 instance and the client. You can see it here:
(direct link : http://img716.imageshack.us/img716/661/newbitmapimagelb.png )What I am wondering开发者_如何学Go about is is there a programmatic way to obtain this map in the client side and maybe change some of the parameters or just examine them
Edit:
I am connecting like this
connect ( host, port, app, callback );
. I assume I am sending some default parameters along, because the other connect methods have also an optionsMap as an argument. I was wondering what are the possible values that could be put in such an optionsMap and where to obtain a list of them?
Hey, I was also struggling with red5 and found this post. Download the red5 source and look inside this source file: src/org/red5/server/net/rtmp/BaseRTMPClientHandler.java
You should know that the connect() method has multiple signatures.
The following method in BaseRTMPClientHandler.java creates the default parameters:
public Map<String, Object> makeDefaultConnectionParams(String server, int port, String application) {
Map<String, Object> params = new ObjectMap<String, Object>();
params.put("app", application);
params.put("objectEncoding", Integer.valueOf(0));
params.put("fpad", Boolean.FALSE);
params.put("flashVer", "WIN 9,0,115,0");
params.put("audioCodecs", Integer.valueOf(1639));
params.put("videoFunction", Integer.valueOf(1));
params.put("pageUrl", null);
params.put("path", application);
params.put("capabilities", Integer.valueOf(15));
params.put("swfUrl", null);
params.put("videoCodecs", Integer.valueOf(252));
return params;
}
精彩评论