Canonical low-latency settings for VLC for Android (3.0+)

I've recently started using libVLC in an Android application with the intent of replacing a commercial SDK that we're paying a lot for, but not seeing the results that we'd hoped for. The application requires viewing RTSP streams at as-close-to real-time as possible. 500ms or better ideally (depending on the tablet), without that latency drifting over time.

The process of switching out the commercial SDK for libVLC was almost seamless and it worked right away, with the exception of the latency being a few seconds (without touching any default settings). It connects to the RTSP streams really fast, and doesn't drop connections.

I've spent a couple of days tweaking the various settings to try to reduce the latency as much as possible. In some cases, I get 300ms latency, that eventually drifts to a few seconds of latency, before the stream drops and restarts (and the latency dance begins again). In other cases (I guess when I set the network cache too low), I get a log full of errors and never get a picture.

My current settings are:

val media = Media(libVLC, Uri.parse(streamUrl))
media.setHWDecoderEnabled(true, false)

If I set network-caching to anything less than 200, I never see an image (I read somewhere this might be because the tablet's decoder latency is higher than 200ms).

Anyways, I've found dozens of potential answers spanning a decade, some are similar, some conflicting, and some using deprecated flags. Some notable ones:



2018: Android LibVLC options do not work


2017: Reduce delay when playing rtp stream with libvlc on Android

LibVLC libVlc = new LibVLC(context, arrayListOf(


media.setHWDecoderEnabled(true, false);


Set network cache to 500, and disable HW acceleration

2015: Decrease delay during streaming and live streaming methods


2013: Stream desktop over RTP using VLC with the lowest latency possible

Related to Desktop VLC and tweaking FFMPEG

And of course, we have the immense VLC flags list here:

So, in conclusion, is there a canonical method for libVLC 3+ on Android that we should collectively use for real-time streaming applications?

In my case, zero caching and dropping late frames, in order to stay as close as possible to real-time is ideal (even with janky frames). But, I do also understand that for most people, stable streaming (with occasional, sporadic frame drops) would be preferred.

I originally posted on the VideoLAN forums, 3 days ago.