Search code examples
androidvideo-streamingrtspandroid-videoviewrtmp

Android VideoView RTSP delay


I am opening a RTSP stream of an IP camera in my Android application through VideoView. There is a problem that It has a great delay that reaches more than 20 seconds! although viewing the Camera from an ordinary PC via its browser there is no such delay. Any Ideas please?

My Code:

        String path="rtsp://192.168.1.20/3gpp";
        myVideoView.setVideoURI(Uri.parse(path));
        myVideoView.setMediaController(new MediaController(this));
        myVideoView.requestFocus();
        myVideoView.start();

Solution

  • Use MJPEG stream, instead of RTSP. After lots of research, I´ve found an MJPEG viewer class that plays live stream near in real time (depending on your network connection).

    Here´s the code Android and MJPEG