0

I'm trying to implement a simple system to stream voice from microphone to an Android app. To stream, I used the ffmpeg program. I tried the following command:

ffmpeg -ar 48000 -f alsa -i hw:0 -acodec mp2 -b:a 384k -f rtp rtp://127.0.0.1:1234

and I was able to start the server.

Then, I used the command:

ffplay rtp://127.0.0.1:1234

and everything worked properly.

Now I need to play this stream in an Android mobile app.

I saw this code somewhere in stackoverflow:

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("rtsp://192.168.0.100"));
startActivity(i);

but the app crashed, stating that:

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=rtp://192.168.0.100:1234

Can anyone help me with the Android code to play the stream? Plus, am I using the right protocol (RTP) or should I use RTSP?

Thank you.

  • You're talking about 2 different apps, right -- the one launching the intent, and another to handle the intent (play the audio)? Or are they the same app? What app is on the device that you expect to be able to handle the intent you created? On what basis do you think that app has an intent filter that should match your intent? – LarsH Nov 28 '16 at 14:40
  • Hi LarsH, actually, this is what I thought. I just copied the above code from a post here in stackoverflow and tried it. Anyway, do you have a suggestion on how to write the Android code? – Othman Mohammad Nov 28 '16 at 14:48
  • Does this answer your question? http://stackoverflow.com/questions/11274906/play-rtsp-streaming-in-an-android-application – LarsH Nov 28 '16 at 17:17

0 Answers0