4

I am trying to write a very simple application which simply tries to playback a video which is being streamed by a RTSP Server. I had read somewhere that the VideoView component is capable of handling RTSP Streams. So i have written the code in the following way.

vv = (VideoView) findViewById(R.id.videoView1);
    mc = new MediaController(getApplicationContext());
    vv.setVideoURI(Uri.parse(url));
    vv.setMediaController(mc);
    vv.requestFocus();

    vv.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {

        public void onPrepared(MediaPlayer mp) {
            vv.start();

        }
    });

The URL String is of the following format rtsp://192.168.1.136:8554/mercykilling.mkv

My problem is that i keep getting an error as below

V/MediaPlayer(16501): message received msg=100, ext 1=1, ext2=-18

Can anyone give any pointers on this topic?

Anuj
  • 389
  • 1
  • 5
  • 20

3 Answers3

2

previous FAQ

previous background

General Comment - RTSP / RTP supports the inclusion of a very large set of underlying encodings and specs for packing media track inside packets and im not sure that the standard Android libStageFright libs actually support it in all of its permutations.

I looked at the ICS samples in the sdk under API / media / video...

ApiDemos\src\com\example\android\apis\media\MediaPlayerDemo_Video.java

take a look at your SDK and at the comments in the above sample...

        case STREAM_VIDEO:
            /*
             * TODO: Set path variable to progressive streamable mp4 or
             * 3gpp format URL. Http protocol should be used.
             * Mediaplayer can only play "progressive streamable
             * contents" which basically means: 1. the movie atom has to
             * precede all the media data atoms. 2. The clip has to be
             * reasonably interleaved.
             * 
             */

Those comments do NOT support the idea that android 4.0 mediaPlayer will play RTSP streams.

If you want to test a generic RTSP stream, i would suggest that you grab a feed from Youtube and try to play the URL for the format=1 stream , which will be RTSP protocol. Example here

Community
  • 1
  • 1
Robert Rowntree
  • 6,230
  • 2
  • 24
  • 43
0

mkv only supports from version 4.0+ Take a look

And one thing always keep in your mind is that to support rtsp streaming, you have to start rtsp server. Otherwise you can't start that file.

Suvam Roy
  • 1,282
  • 2
  • 11
  • 21
0

You can use the library @ http://net7mma.codeplex.com/ (Of which I am the author)

It can provide an easy way to allow playback of Rtsp or Rtp media in Android.

Jay
  • 3,276
  • 1
  • 28
  • 38