We connect to FMS using NetConnection:
netConnection.connect(server, userID);
where the server is something like this:
rtmfp://OUR_IP_ADDRESS/ChatApp
We connect to the NetGroup like this:
groupSpecifier = new GroupSpecifier(groupID);
groupSpecifier.multicastEnabled = true;
groupSpecifier.postingEnabled = true;
groupSpecifier.serverChannelEnabled = true;
netGroup = new NetGroup(netConnection, groupSpecifier);
And we connect to the NetStream like this:
netStream = new NetStream(netConnection, groupSpecifier.groupspecWithAuthorizations());
I read somewhere that DIRECT_CONNECTIONS was better than mesh, but maybe it was an older article. So mesh is the way to go?
If I am experiencing audio latency and video freezing for a second or two, what other optimizations are possible?
So, in your case , the application on FMS is 'ChatApp' that you are connecting to. You can find it under /opt/adobe/fms/applications directory or /mnt/applications or wherever the applications directory is mapped to. The mapping can be found in fms.ini file under the conf folder with the variable VHOSTS.APPSDIR
The rest of the code snippet is how we make the P2P mesh, and it looks ok to me.
We can safely assume P2P is the way to go. DIRECT CONNECTIONS is 1.0 of P2P
(in my opinion).
For more optimizations, you need to make sure the following :
No packet loss in your network : since the P2P is on UDP, careful observation of your network traffic is required
Do not use Queues
Reduce OutChunkSize (this can be found in server.xml), and you can always read the comments above each tag to get a description about its function.
Use optimal bitrates for audio and video that your network supports
Reduce the buffer length on the client side (ideally 0 or 0.1) so that it starts playback instantly without any delay and reducing latency
These are some of the points that i can quickly think of !
Thank you !