Java – Is there a good way to stream videos from Android to RTSP servers?

Is there a good way to stream videos from Android to RTSP servers?… here is a solution to the problem.

Is there a good way to stream videos from Android to RTSP servers?

I looked around and didn’t really find anything. I want to stream video from the built-in camera to my RTSP server. While looking for examples, I see that MediaPlayer may have its setDataSource() method that contains only the location of the stream on the server. I’m trying to simulate it with the following method:

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’m trying to emulate the server with LIVE555 in case there might be any reason for the delay. However, the problem may be an understanding lock in the way I work. Any insight into things I can try would be appreciated. Thanks in advance!

(Also, x is replaced with a number, I just don’t know why adding the IP I’m using would be very useful)

Please let me know if there is any help I can add. Thanks again!

Solution