Root Android video streaming client for local ip camera without any lag

I have an ip camera and I want to include a video stream in an android activity. For this, I have included a VideoLayout with a video id and I have added this code to the onCreate method in the Activity.

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        videoView = (VideoView) findViewById(R.id.video);
        Uri video = Uri.parse("rtsp://192.168.1.225/axis-media/media.amp");
        videoView.setVideoURI(video);
        videoView.start();
    }

      

It works, but there is an annoying 10 second delay between capturing the camera image and displaying it on the phone. I need a delay of less than 2 seconds. I know the problem is with the fixed size of the buffer used to cache images during an RTSP session. If I use vlc I can view the stream well by setting network caching = 0. Is there a way to do this in Android? The purpose of the software is ROOTED Android 4.0.3. Can I decide using the root? I read that I can install the media.stagefright.cache-params of the build.prop file, but I don't know if this is helpful or how to install it. Please help me! Thank!

+3


source to share





All Articles