bigbluebutton icon indicating copy to clipboard operation
bigbluebutton copied to clipboard

Support for multiple red5 servers does not work for two or more servers

Open mconf-daileon opened this issue 8 years ago • 1 comments


Author Name: Mateus Dalepiane (Mateus Dalepiane) Original Redmine Issue: 1243, http://dev.mconf.org/redmine/issues/1243 Original Date: 2014-04-30 Original Assignee: Felipe Cecagno


The support for multiple red5 servers, as proxies, is working properly only when one a single proxy server is used. When two or more servers are used, the connection between them seems to be created as expected, but the video stream does not work. The stream work through two proxy servers if a user is previously connected in the first one.

Example: In the scenario Stream <==> SV1 <==> SV2 <==> SV3 <==> User If the user tries to connect through SV3/SV2/SV1 it will not work. But if there is already a user connected through SV2/SV1, and then the user tries to connect the same way as before it will work.

An exception happens in SV2, as follows: [ERROR] [RTMPMessageExecutor-1] org.red5.server.messaging.InMemoryPushPushPipe - Exception when pushing message to consumer java.lang.IllegalStateException: Cannot stop in current state: STOPPED at org.red5.server.stream.PlayEngine.stop(PlayEngine.java:772) ~[red5-server.jar:na] at org.red5.server.stream.PlayEngine.sendMessage(PlayEngine.java:1000) ~[red5-server.jar:na] at org.red5.server.stream.PlayEngine.pushMessage(PlayEngine.java:1403) ~[red5-server.jar:na] at org.red5.server.messaging.InMemoryPushPushPipe.pushMessage(InMemoryPushPushPipe.java:81) ~[red5-server.jar:na] at org.red5.server.stream.ClientBroadcastStream.dispatchEvent(ClientBroadcastStream.java:338) ~[red5-server.jar:na] at org.red5.server.net.rtmp.BaseRTMPHandler.messageReceived(BaseRTMPHandler.java:170) ~[red5-server.jar:na] at org.red5.server.net.rtmp.RTMPConnection$MessageReceivedTask.run(RTMPConnection.java:1332) ~[red5-server.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.6.0_30] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) ~[na:1.6.0_30] at java.util.concurrent.FutureTask.run(FutureTask.java:166) ~[na:1.6.0_30] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) ~[na:1.6.0_30] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.6.0_30] at java.lang.Thread.run(Thread.java:701) ~[na:1.6.0_30]

mconf-daileon avatar May 05 '16 16:05 mconf-daileon


Original Redmine Comment Author Name: Mateus Dalepiane (Mateus Dalepiane) Original Date: 2014-05-12T15:41:39Z


Using Wireshark I found out that there was a difference between the web flash client and the red5 RTMP client, in how they called the play() method on the server. The web client uses a single parameter, the stream name, while the RTMP client was also sending the start time and the length of the stream. This resulted in a different configuration on the second server RTMP client, and prevented the stream retransmission. To fix this a a CustomRTMPClient was created, and the play() method reimplemented to use a single parameter, as the web client.

This is implemented in multivideo branch.

The CustomRTMPClient is implemented as a private class inside CustomStreamRelay, maybe it would be better to move it to it's own class file. Please consider this during code review.

mconf-daileon avatar May 05 '16 16:05 mconf-daileon