Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

I am trying this code

VideoView myVideoView = (VideoView) findViewById(R.id.videoPlayer);
         myVideoView.setVideoURI(Uri.parse(url.toString()));        
        myVideoView.setMediaController(new MediaController(this));
         myVideoView.requestFocus();  
        myVideoView.start();

this code giving error(1,-1). I am unable to play this link.If anyone tell me idea to play this url.

thinks.

like image 996
Jeeva Avatar asked Dec 05 '25 11:12

Jeeva


1 Answers

Roundabout suggestion -

  1. download the rtsp stream to a local filesink using VLC which has just been compiled on android.
  2. once the download is complete, simply play that file using the normal Intent field values for a local file and mimetype of mp4.

snip below should play what was downloaded.

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

VLC on android links: http://forum.xda-developers.com/showthread.php?t=1517415 http://code.google.com/p/android-vlc-remote/source/browse/AndroidManifest.xml

Get an rtsp link from any youtube vide - slightly involved process

You can stream just about any youtube video as RTSP if you do the following:

  1. Get the youtube video ID - like videoID=kgfctMNeDtg
  2. Get the youtube feed for the videoID
  3. Find the rtsp url for the appropriate youtube format . Formats 1,5 6 all have rtsp
  4. request the rtsp uri with an instance of HttpClient

Details:

http://snipplr.com/view/63341/youtube-rtsp-cli-request--audio-track-only-p2/

http://snipplr.com/view/57846/curl--rtsp-to-get-sdp-descriptor-for-media-stream/

like image 76
Robert Rowntree Avatar answered Dec 07 '25 17:12

Robert Rowntree