1

I'm currently trying to receive multiple RTP audio stream, mixing them, and output RTSP stream by using ffmpeg or ffserver.

RTP audio stream is send by Android AudioStream.

Here is code Android side.

AudioManager audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audio.setMode(AudioManager.MODE_IN_COMMUNICATION);

audioGroup = new AudioGroup();
audioGroup.setMode(AudioGroup.MODE_ECHO_SUPPRESSION);

audioStream = new AudioStream(InetAddress.getByAddress(getLocalIPAddress()));
audioStream.setCodec(AudioCodec.PCMU);
audioStream.setMode(RtpStream.MODE_NORMAL);
audioStream.associate(InetAddress.getByName(SipStackAndroid.getRemoteIp()), REMOTE_PORT);
audioStream.join(audioGroup);

Then I prepare server side.

Here is ffserver.conf

HTTPPort 5555
HTTPBindAddress 0.0.0.0
RTSPPort 5454
RTSPBindAddress 0.0.0.0
MaxHTTPConnections 100
MaxClients 1000
MaxBandwidth 10000
CustomLog -

<Feed feed1.ffm>
  File /tmp/feed1.ffm
  FileMaxSize 500M
</Feed>

<Stream live.wav>
  Format rtp
  Feed feed1.ffm
  AudioBitRate 13
  AudioChannels 1
  AudioSampleRate 8000
  AudioCodec pcm_mulaw
  # AudioCodec libmp3lame
  NoVideo
</Stream>

And here is ffserver or ffmpeg command.

ffserver -d -f ffserver.conf
ffmpeg -i "rtp://192.168.150.10:12345" -acodec auto http://127.0.0.1:5555/feed1.ffm

I can't solve how to receive multiple rtp stream and how to mix them.

Please give some ideas and actual links where I can find an answer.

John
  • 11
  • 2

0 Answers0