How to play RTSP [live streaming] link in android?

I am trying to play the RTSP live streaming url "rtsp: //". But I am getting this error (1, -1).

I am trying to use this code

VideoView myVideoView = (VideoView) findViewById(;
        myVideoView.setMediaController(new MediaController(this));


this code gives error (1, -1). I cannot play this link. If anyone can tell me to play this url.



source to share

2 answers

Carousel offer -

  • download the rtsp stream to a local file using VLC which has just been compiled on android.
  • Once the download is complete, just play that file using the usual local file intent and mp4 mimetype.

The snip below should play the downloaded files.

new Intent(Intent.ACTION_VIEW).setDataAndType(Uri.parse("file:///mnt/sdcard/myfile.mp4"), "video/mp4"); 


VLC on android links:

Getting rtsp link from any youtube video is a slightly involved process

You can stream almost any YouTube video as RTSP if you do the following:

  • Get youtube video id - for example videoID = kgfctMNeDtg
  • Get youtube feed for videoID
  • Find the rtsp url for the corresponding youtube format. 1.5 6 formats all have rtsp
  • request rtsp uri with HttpClient instance

More details:



I tried playing rtsp: // on VLC but was unable to do so, here is the error I am getting

enter image description here

Try another link that works like rtsp: // 554 / playlist / ch12zqcif.3gp (some indian channels)



All Articles