Search code examples
javaandroidrtsp

Is there a good way to stream video FROM Android to an RTSP server?


I have searched around and haven't really found anything. I would like to send the video from the built in camera to my RTSP server via a stream. When looking for examples, I saw that it might be possible for MediaPlayer to have its setDataSource() method to just include the location of the stream on the server. I tried to emulate that with:

mediaRecorder = new MediaRecorder();
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
mediaRecorder.setOutputFile("rtsp://x.x.x.x/mystream2.mpg");
mediaRecorder.prepare();
mediaRecorder.start();

I am attempting to use LIVE555 to simulate a server in case that might be any reason for the hold up. However, the problem is probably a lock of understanding of how things work on my part. Any insight as to things I could try would be highly appreciated. Thanks ahead of time!

(Also, the x's are replaced with numbers, I just don't know why adding the IPs I'm using would be terribly helpful)

If there's anything I can add to help, let me know. Thanks again!


Solution

  • We ended up just using a standard protocol smashing JPEG after JPEG and loading those and it more-or-less simulates real time. We could still use a better solution, but this worked for now. If anybody wants to see some code, leave a comment. If anybody has a better solution, post it and I will switch the answer over.