0

I'm trying to create an app to stream video from an ip-camera to android via rtsp. To test this I am attempting to use an rtsp stream from VLC.

The code I am using is:

    VideoView videoView = (VideoView) findViewById(R.id.video);

    Uri video = Uri.parse("rtsp://192.168.1.10:5544/test.sdp");
    videoView.setVideoURI(video);
    videoView.start();

when this is run I get "Sorry, this video cannot be played". It seems there are many people having this problem but I cannot find a fix.

The logcat file is this:

03-13 13:11:44.577: D/dalvikvm(400): GC_EXPLICIT freed 606K, 12% free 6429K/7239K, paused 3ms+4ms

03-13 13:11:49.346: D/MediaPlayer(400): Couldn't open file on client side, trying server side

03-13 13:11:49.630: E/MediaPlayer(400): error (1, -2147483648)

03-13 13:11:50.187: E/MediaPlayer(400): Error (1,-2147483648)

03-13 13:11:50.187: D/VideoView(400): Error: 1,-2147483648

03-13 13:11:50.697: D/dalvikvm(400): GC_FOR_ALLOC freed 10K, 11% free 6482K/7239K, paused 310ms

03-13 13:11:50.867: D/dalvikvm(400): GC_CONCURRENT freed <1K, 4% free 6983K/7239K, paused 4ms+2ms

Any and all help would be greatly appreciated.

Bo Persson
  • 90,663
  • 31
  • 146
  • 203
Jono
  • 3
  • 1
  • 2

2 Answers2

0

Are you sure the encoding is supported by your device? Do you have the correct permissions? (Internet)

The error code is a bit general, try searching on the error. Possibilities that I have found: http://code.google.com/p/android/issues/detail?id=8624

error (1, -2147483648) on Android

Community
  • 1
  • 1
David Olsson
  • 8,085
  • 3
  • 30
  • 38
0

I had the same problem with VideoView but I got it to work with MediaPlayer. Here you have an example https://github.com/commonsguy/vidtry/tree

Ungureanu Liviu
  • 4,034
  • 4
  • 37
  • 42
  • many thanks for this response have it working now with this code. Turns out there's no video player in the emulator..school boy error. – Jono Mar 30 '12 at 11:52
  • @Jono: can you test videos in the emulator (I am having same problems)? – Salman A Apr 16 '12 at 06:16