I have a live video streaming camera device which is in the same network with my Android phone. My Android version is 4.1.2. The camera streams video through RTSP and its format is MP4. The address is: rtsp://192.168.0.102:8554/test
I have the following code at oncreate method of my activity:
vwMain = (VideoView) findViewById( R.id.videoView );
vwMain.setMediaController( new MediaController( this ) );
String strURI = "rtsp://192.168.0.102:8554/test";
vwMain.setVideoURI( Uri.parse(strURI) );
vwMain.requestFocus();
vwMain.start();
I get "Sorry this video cannot be played" error. However:
1) When I stream another video which has also MP4 format from my computer connected to the same subnet with VLC media player, I can play the video (the computer has an ip of 192.168.0.101 and my rtsp address is "rtsp://192.168.0.101:8554/test"
2) When I use a mobile version of VLC media player, I can also play the video streamed by the camera (?)
Where can I be wrong? It seems that Android supports my video format:
http://developer.android.com/guide/appendix/media-formats.html