The code is only streaming for one user at a time. Can anyone help me to play the stream in more than one system at the same time(convert it to multicast or broadcast). Thanks in advance.
The library source is over here: https://github.com/fyhertz/libstreaming
my current code is:
mSurfaceView = (net.majorkernelpanic.streaming.gl.SurfaceView) findViewById(R.id.surface);
// Sets the port of the RTSP server to 1234
Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
editor.putString(RtspServer.KEY_PORT, String.valueOf(5060)); // audio port num
editor.commit();
// Configures the SessionBuilde
SessionBuilder.getInstance()
.setSurfaceView(mSurfaceView)
.setPreviewOrientation(90)
.setContext(getApplicationContext())
.setAudioEncoder(SessionBuilder.AUDIO_AAC)
.setVideoEncoder(SessionBuilder.VIDEO_NONE);
MainActivity.this.startService(new Intent(MainActivity.this,RtspServer.class));
I looked at the code at github and seems that you only need to specify the multicast address to the
SessionBuilder
class and then the underlying RTSP server and RTP transport should handle everything (at least the RTSP responses seem have code to produce correct transport descriptions). So I guess adding asetDestination
call to yourSessionBuilder
configuration should be ok (replace the 232.0.1.2 with the address you need):The clients will still connect to the RTSP server through it's address but the actual RTP stream should be single and shared among all the clients.