Stream from one Kurento media server to another
<p>I have a task of building a cluster of Kurento servers to enable streaming of a small number (about 10) of video and audio streams to a large audience (up to 1000 receivers). So yeah, 10,000 streams total. Obviously a single Kurento instance can't handle that much on any kind of server, so clustering is needed.</p>

<p>Here is what i plan to do:</p>

<p>1) Accept connection of a presenter to the 'master' server, when a pipeline is created, WebRtcEndpoint is created, fed with the SDP offer from the presenter client, and SDP answer is delivered to it, wait for stream start by subscribing to MediaStateChanged event.</p>

<p>2) When it happens, create several RtpEndpoints and feed each of them, the hand-hacked SDP offer like</p>

<pre><code>v=0
o=- 0 0 IN IP4 $slave_ip
s= 
c=IN IP4 $slave_ip
t=0 0 
m=video $slave_port RTP/AVP 100 
a=rtpmap:100 H264/90000
a=recvonly
</code></pre>

<p>substituting each time an IP of each slave servers, and some free UDP port on it out of the range assigned to Kurento. Connect that endpoint to the WebRtcEndpoint of the presenter.</p>

<p>3) ????? (need to create an RtpEndpoint on the slave server, which will receive the stream sent by RtpEndpoint on step 2 - but how? which SDP to feed to it? maybe the sdpAnswer received on step 2, reusing it as SDP offer on the slave Kurento? unsure)</p>

<p>4) connect viewers to each of the slave servers by round robin load balancing algorithm, feeding the RtpEndpoint to their receiving WebRtcEndpoints</p>

<p>Can anyone help me with the step 3 please? Also is my plan correct?</p>

<p>Thanks for any suggestions!</p>

<p>Mikhail</p>

<p>PS also a big big question is what $slave_port will be</p>