How to increase video buffer/cache

What is the problem you are having with rclone?

Video read ahead is only 1 second

Run the command 'rclone version' and share the full output of the command.

rclone v1.57.0

  • os/version: Microsoft Windows 10 Pro 2009 (64 bit)
  • os/kernel: 10.0.19044.1586 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.17.2
  • go/linking: dynamic
  • go/tags: cmount
[GDrive]
type = drive
client_id = XXXXXXXX
client_secret = XXXXXXXX
scope = drive
root_folder_id = 
token = {"access_token":"ya29.A0XXXXXXX"}
team_drive = 0AMXXXXXXXX

Rclone config:

taskkill /im rclone.exe /f
start rclone --no-console mount GDrive: C:\Users\User1\Documents\.Mount\GDrive --no-modtime --rc --rc-addr=:3750 --vfs-cache-mode writes --buffer-size 500M --vfs-cache-max-age 30m --vfs-write-back 25s --cache-dir E:\cache --dir-cache-time 25m
TIMEOUT /T 15
rclone rc vfs/refresh recursive=true --rc-addr=:3750 --timeout 15m -q
ECHO Priming Backup Cache... Complete
msg %username% Cache is Primed.
exit

When playing back a video from Google Drive through rclone, the video buffers ahead only 1 second
image

When playing back the same video with an Index link, the video keeps buffering ahead
Imgur

Expected Behaviour: The video will buffer ahead using upto 500MB of system memory.

If you've shared a log file, we might be able to answer your question to why, but without a log file, it's a guessing game.

Buffer size in rclone drops when a file is closed and it's only used for reading the file.

Players/Apps that use seek to do stuff won't benefit from buffer size since they open and close the file.

Here's the log file: https://cdn.discordapp.com/attachments/474545817206652949/953256494021877780/rclonemount.txt

All I want to do is set rclone to cache more than 1 second (2-3 minutes) into the video.

Again, buffer works by sequential reads in the file, if the app/program is reading sequentially, it'll read and keep it in the buffer which based on your log, it is doing.

Buffer does not really do much with caching per se as it's only storing things it's reading.

If you want caching and read ahead, you'd want full mode:

      --vfs-read-ahead SizeSuffix              Extra read ahead over --buffer-size when using cache-mode full

I've added --vfs-read-ahead 500M and still the same behaviour
Or did you mean, to use --vfs-cache-mode full? I want it to cache a couple minutes ahead of the video into the memory, not the disk like it does when I play the same video using a Google Drive Index link.

taskkill /im rclone.exe /f
start rclone --no-console mount GDrive: C:\Users\User1\Documents\.Mount\GDrive --no-modtime --rc --rc-addr=:3750 --vfs-cache-mode writes --vfs-read-ahead 500M --vfs-cache-max-age 30m --vfs-write-back 25s --cache-dir E:\cache --dir-cache-time 25m 
TIMEOUT /T 15
rclone rc vfs/refresh recursive=true --rc-addr=:3750 --timeout 15m -q
ECHO Priming Backup Cache... Complete
msg %username% Cache is Primed.
exit```

Yes as I noted in my comment above:

That's all dependent on how the app works. If the app closes the file, the buffer is dropped so you'd have to use full mode if that's your use case. The buffer is dropped when the file is closed as that is how rclone works.

No idea what a Google Drive Index link is or what that means.

I understand. But I don't it to retain the cache after the file is closed. What I'm trying to do is to cache ahead in the video while it's playing back only and I want to cache it into the RAM temporarily and not the disk as full mode caches to disk

I understand what you want it to do.

I'm telling what you rclone does.

Feel free to track this issue as that is what you are asking:

Set a timeout for dropping in-memory rclone mount buffer · Issue #5592 · rclone/rclone (github.com)

There's little value in this so it's been sitting for some time without a taker so full is really the way to go.

Good luck.

Oh so it's no possible to cache a couple of minutes ahead into the video while playing back only to RAM.

Thanks a lot for the info!

Buffer cache works as expected if the file is read sequentially and not closed. You'd read ahead and cache in memory.

If the application closes the file, you drop the buffer. Rclone can't control what the application does.

The feature I linked is specifically about those applications that behave that way.