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.