Search code examples
javastreamdelayred5

Red5 communication delay


I have created a Red5 stream recorder app that records the client's camera and mic. It records the stream by NetStream.publish("streamname","live") and invokes a remote call that starts recording it. The problem is after the client calls the remote startRecording method and the server starts recording the stream, the whole communication slows down and has a long delay, often a half minute! From the slowdown everything has long delays even the remote calls. In the localhost it works good. What is the problem?


Solution

  • You might need to start a new Thread for the processing of the server side recording. We had similar issues and solved it by adding a StreamListener to the stream that runs in its own Thread and uses a construct similar to: http://en.wikipedia.org/wiki/Semaphore_%28programming%29 to collect all packets and write them to disc, independent of the red5 application logic.

    That way we have been able to solve the performance issues in server side recording.

    Sebastian