[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Implementing a RTP Mixer in Mediastreamer

From: Steve Strobel
Subject: [Linphone-developers] Implementing a RTP Mixer in Mediastreamer
Date: Mon, 17 Mar 2014 10:48:49 -0600

I am currently using mediastreamer to allow a group of devices to communicate using a single multicast IP address.  That works fine, as long as only one device transmits at a time.  If multiple devices transmit at the same time, the one that began transmitting first is the only one that can be heard (I tweaked the logic for that so it would lock to a SSRC (discarding packets from all other SSRCs) unless there were no packets received from it for a half-second, at which time it would lock to the SSRC of the next packet to arrive).

I would now like to make it mix the audio from multiple sources.  I suppose that would involve making a separate jitter buffer for each simultaneously-transmitting source, separately running the received packets through the codec, then mixing the resulting PCM audio.  I know how to mix the audio from separate RTP sessions (on different multicast IP addresses), but I don't know how to do it when they all use the same multicast IP address. 

I would be happy enough to manually configure a pool of mediastreamer sessions (enough to handle the max number of simultaneous transmitters) and connect the output of their audio codec filters all into an audio mixer.  The challenge is getting the packets sent from the various sources fed to the different sessions.  

I suppose one option would be to add a member to the session structure specifying which SSRC it should listen for and a callback to inform the application when a packet is received from an SSRC that is not currently handled by any of the sessions.  Then the application could set up one session from the pool for each of SSRCs heard from most recently.  But it would still need some RTP packet reception logic to allow those sessions to all read from the same network socket but sort out the packets from each SSRC.  I am not sure of the best way to implement that part of it.  Any suggestions welcomed.


P.S.  There was interest in building this functionality into oRTP/mediastreamer in 2010.  I presume that it hasn't happened, but would love to be corrected.


Steve Strobel
Link Communications, Inc.
1035 Cerise Rd
Billings, MT 59101-7378
(406) 245-5002 ext 102
(406) 245-4889 (fax)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]