Search code examples
androidrtspvlc

vlc stream to Android


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.


Solution

  • 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