I'm new to Android development and can't seem to get anywhere with the development of an app to live stream an RTSP feed from an ip camera. While I can get the code to stream from a website with an RTSP address of a .mov file, I cannot get it to stream from my ip camera's RTSP address. We are using VideoView
so that we can support back to android 4.0 because the goal is to display this in Epson Moverio BT-200 video glasses.
Below is the code I have now, with lines to the two streams I can get from the camera commented out. The line not commented out is a test stream online that plays fine.
VideoView videoView;
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
//Create a VideoView widget in the layout file
//use setContentView method to set content of the activity to the layout file which contains videoView
this.setContentView(R.layout.activity_full_screen_video);
videoView = (VideoView)this.findViewById(R.id.video_player_view);
//Set the path of Video or URI
//videoView.setVideoPath("rtsp://192.168.1.122/h264");
//videoView.setVideoPath("http://192.168.1.122/ipcam/mjpeg.cgi");
videoView.setVideoPath("rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov");
//Set the focus
videoView.requestFocus();
videoView.start();
}
When ran with either of the lines that are pulling from the ip camera, we get the error below:
'setDataSource IOException happend :
java.io.FileNotFoundException: No content provider: http://192.168.1.122/ipcam/mjpeg.cgi'
The RTSP stream from the camera has been verified with another rtsp android app, so I know it's not bad.
Does something have to be done to allow for buffering? The ultimate goal is to get as close to real time live streaming to the app to do video overlay in the glasses. However, we can't even get a basic stream to show up. Any and all advice would be welcome!