[vlc-devel] [PATCH 0/1] Improve SFTP network performance with buffer

Ilkka Ollakka ileoo at videolan.org
Sun Feb 18 12:48:02 CET 2018

On Sat, Feb 17, 2018 at 03:24:24PM +0100, Martin Disch wrote:
> Sure thing! To clarify what you want me to do exactly I have three questions:
> 1. By "the issue" do you mean the slowness of SFTP reading I described
> in the first place, or the fact that the stream prefetch filter
> doesn't help unless its read size is increased in the options?

Slowness of SFTP reading. It might be possible that prefetch filter has some
boundary that makes it buffer underrun on that specific case (not likely, but
possible), but that is another matter.

Other possibility would be to check if prefetch-buffer-size increase helps.

> 2. Concerning the stream filters, I noticed something I can't make
> sense of. There's the options page where all available filters are
> listed with checkboxes. Checking one of them adds the module name to
> the text box below, which I assume is used as an argument telling VLC
> which stream filters to use. The stream prefetch filter is the only
> one of them offering its own options. When I went and increased the
> buffer size, I realized that the change took effect (VLC used more
> memory to accommodate the buffer), even though I did not check the
> checkbox for the stream prefetch filter (= add "prefetch" to the text
> box). Does the stream prefetch filter activate itself because I
> changed its settings, or is it (and by implication all of the other
> stream filters) active by default? I can't imagine that's the case.

By default vlc loads prefetch,cache_read modules for stream filtering for
access modules that have pf_read defined, and prefetch,cache_block for the ones
that have pf_block defined. So you don't need to define any of those to be

> 3. By "remove cache_read", do you mean not have it activated in the
> stream filters settings I mentioned before, or build VLC s.t. it is
> not there at all? Because if it's the former, I never had the
> cache_read filter activated anyway. I only ever used prefetch on its
> own or nothing at all.

By remove to remove the libcache_read.so from plugins-directory. But you should
be also be able to see which module is unsed from gui from
view->messages->module tree tab. There should be either prefetch or cache_read
in the tree.

> cache option was gone from the list of filters afterwards). No change
> in behavior, prefetch with default settings doesn't help with the
> problem and only by setting the read size to something like 262144 can
> I get VLC to use enough bandwidth to keep up with the bitrate of the
> video.

Thanks for testing.

So it might be that the prefetch-filter starves for some reason, meaning buffer
is full and doesn't get into refilling when it's consumed in pace that would
prevent stalling the playback.

If it would be possible to check if tuning the prefetch-buffer-size helps
instead of tuning the prefetch-read-size?

Ilkka Ollakka

More information about the vlc-devel mailing list