4

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

fercis
  • 611
  • 2
  • 12
  • 26
  • Also,when I display the video streamed by the camera from my computer I can display its video characteristics in "Codec Information" tab of VLC media player: {Codec: MPEG-4 Video mp4v Resolution: 720x576 Frame Rate: 25000 Decoded format: Planar 4:2:0 YUV} – fercis Feb 25 '14 at 13:31
  • RTSP is a control protocol and MP4 is a file format (or it seems to be MP4 video in your case). Please post the adb log to see what's wrong with the `MediaPlayer`. – leesei Jul 21 '15 at 05:48

1 Answers1

-1

have you added the permission ?

<uses-permission android:name="android.permission.INTERNET" />
Michele La Ferla
  • 6,775
  • 11
  • 53
  • 79
SP_
  • 241
  • 1
  • 5
  • 16