Android Streaming Server Development

I am trying to create a Streaming AV Media Server for use with an Android phone as a client. This will instantly prevent me from developing a server that uses RTSP. I understand Java programming and find that Netty (Java NIO) can be used to fill an otherwise massive gap in the Java Media Framework for this protocol. I played with him and had no real success. I know about live555, but Im on a tight schedule and really don't want to start messing around with C ++, since I know very little about it. I am stuck with this problem for many weeks and can’t show anything. Streaming to Android should be possible, as there are many proprietary applications on the Android market. Can anyone who has experience and knowledge on this subject let me know if there is an easy way to implement the RTSP AV media server that simply transfers .mp4 or .3gp and .mp3 files for use with android without using live555 libraries . If not, I just need to quickly get up to speed in C ++. Thank you in advance.

+3
source share
3 answers

OK, just like this for a stream using HTTP.

I created a virtual folder called "Music" from IIS to WinXP and pointed it to a folder containing mp3 files. This is the complete action required to stream a file (the name is hard-coded).

BTW, it's called SimpleNetRadio since I initially started playing with Shoutcast streams.

package com.mycompany.SimpleNetRadio; import android.app.Activity; import android.media.AsyncPlayer; import android.media.AudioManager; import android.net.Uri; import android.os.Bundle; public class SimpleNetRadio extends Activity { private AsyncPlayer ap = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } @Override protected void onStart() { super.onStart(); ap = (AsyncPlayer) getLastNonConfigurationInstance(); } @Override protected void onStop() { super.onStop(); if (ap != null) ap.stop(); } @Override protected void onResume() { super.onResume(); if (ap == null) { ap = new AsyncPlayer("Simple Player"); ap.play(this, Uri.parse("http://192.168.1.1/Music/02%20-%20Don't%20Stop%20Believin'.mp3"), true, AudioManager.STREAM_MUSIC); } } @Override public Object onRetainNonConfigurationInstance() { return ap; } } 

You should also do this using MediaPlayer with even more code - it will better handle error conditions and will not require much more work.

+1
source

Developing an RTSP streaming server with Netty is a fairly simple task and does not take much time. I wrote it myself, and it worked like a charm. You can see some other server implementation examples using the Netty environment to get started.

+1
source

I'm not sure what your specific needs are, but for static files, you can try combining Amazon S3 and CloudFront , which I assume supports RTSP.

0
source

All Articles