libVLC on Android - caching and buffering logic

This forum is about all development around libVLC.
fasteque
Blank Cone
Blank Cone
Posts: 10
Joined: 04 Jul 2016 11:24

libVLC on Android - caching and buffering logic

Postby fasteque » 03 May 2017 11:16

Hi all,

I have an Android application which relies on libVLC for video playback.
I built VLC on a Linux machine following the official documentation and using the Java library like the official VLC Android application does.

Everything works fine and smooth but now I wanted to understand how I settings to do some fine tuning.
Videos are streamed over HTTP/HTTPS, but there's no particular or sophisticated service server side: I directly pass the HTTP url while creating the Media instance.

The idea is that for devices or slow connections the player should buffer more at the beginning, to avoid to do that multiple times during the playback.

My questions for you guys VLC experts:

- is it possible to implement this logic tweaking VLC options only?

- how does the caching/buffering work on VLC?

- what does the option "--network-caching" affect? Also, should I set it for both the LibVLC and the Media instances? Looking at the VLC for Android source code it seems so.

- what does the option "--sout-mux-caching" affect?

- Am I missing other important options?


Thank you very much in advance for your help!


Daniele

fasteque
Blank Cone
Blank Cone
Posts: 10
Joined: 04 Jul 2016 11:24

Re: libVLC on Android - caching and buffering logic

Postby fasteque » 09 May 2017 17:17

Hello again,

I've tried to read a bit the code and I'm still having some questions, maybe less broad then in my previous post :)

As far as I've seen, there's a prefetching buffer, which is allocated when the stream is started.
I've tried to change its value in VLCOptions but it doesn't have any effect.
Instead, adding it as an option (prefetch-buffer-size) for a Media, it changes the value at runtime: the value to pass is the number of Kb (so the number set in the option is multiplied by 1024).

- Is this prefetching buffering filled only when video playback is started? Do you have any suggestions about changing its value?

Second question is about "network-caching" option. Again I've noticed that this option is passed to the Media as well, that's the value taken into account, not the one passed in VLCOptions.
But I still do not get where this value is loaded (for an HTTP stream) and the buffering performed.
It looks like at the beginning the value passed in the option is used but later, instead, a new value is available

- How does the stream buffering work? Is it dynamic? Do you have any hint about a file/method to look further into?


Thanks again,
Daniele


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 20 guests