I am trying to build an app to play video from an URL, I am using rtsp, I have tried with most of the examples that I have found online, however none has worked.. This is my code so far in the client:
package com.example.rtsp_player;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String uri = "rtsp://192.168.2.170:5544/";
VideoView v = (VideoView) findViewById( R.id.videoView );
v.setVideoURI( Uri.parse(uri) );
v.setMediaController( new MediaController( this ) );
v.requestFocus();
v.start();
}
}
And this is how I am broadcasting using vlc: :sout=#transcode{vcodec=h264,vb=800,fps=30,width=320,height=180,acodec=mp4a,ab=128,channels=2,samplerate=22050} :rtp{sdp=rtsp://192.168.2.170:5544/}**
I don't know if it is because of the codecs or what..