0

Just looked on stackoverflow question post link RTSP Client Implementation on Android

Found another Android RTSP Client

Tried to implement with videoview and surfaceview.

--http web link video is coming. 
--http using VLC player no video
--rtsp using VLC player no video.

I am using code from Android RTSP Client

package com.weeklybuild.rtspviewer;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

import android.net.Uri;
import android.widget.MediaController;
import android.widget.VideoView;

public class MainActivity extends Activity {

@Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  String uri = "rtsp://localhost:8554/test";  //giving Url as per VLC 
  VideoView v = (VideoView) findViewById( R.id.videoView );
  v.setVideoURI( Uri.parse(uri) );
  v.setMediaController( new MediaController( this ) );
  v.requestFocus();
  v.start();
 }
}

Can Someone tell me why unable to view video using RTSP ?

Manku
  • 431
  • 3
  • 9
  • 16
  • have you given internet permission to the app? – BennyHawk Sep 13 '18 at 00:35
  • Yes, I have given internet permission also. – Manku Sep 13 '18 at 01:57
  • I have installed app IP Webcam from google play and broadcasting video on local http ip address. When i am using that http link in above code. Then i am getting Couldn't open http://192.168.43.87:8080/video: java.io.FileNotFoundException: No content provider: http://192.168.43.87:8080/video. While this link is working on phone chrome. Can someone tell me, why this is not working on above code. – Manku Sep 13 '18 at 02:55
  • Can you switch your URI to this: rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov and check? – BennyHawk Sep 13 '18 at 05:40
  • Yes, above link is working fine. Then why link created by VLC player is not working. Is there any difference in codec? – Manku Sep 13 '18 at 06:38

1 Answers1

1

I'm guessing the reason is that the URI specified is not correct. Since the link,

rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov

works, we can be sure that the code works fine. I'm guessing the problem is because there is no codec to the URI provided in the question.

The second link you provided, Android RTSP Client also states that there can be a lot of problems with the codec. (Section 4 in the link)

I'd suggest to add and .stream and check. If that doesn't work then try a different codec.

BennyHawk
  • 172
  • 2
  • 11