Media freezing randomly

What is the problem you are having with rclone?

Streamed video freezes occasionally on Jellyfin. Almost entirely only happens with high bitrate 4K videos.
VIdeo might freeze for a few seconds and then resume, or freeze for good. It can also freeze repeatedly. After a minute or two, it can be restarted and it continues playing.
I suspect OneDrive throttling, hence the post here to ask for advice as to the best settings to use for OneDrive mounts, however if I exit the app (Jellyfin) and re-enter it, the movie can resume immediately with (usually) no more freezing, which suggests it is not to do with throttling.

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

rclone v1.65.0
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-91-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.21.4
- go/linking: static
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

OneDrive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount \
        --config=/home/dinosm/.config/rclone/rclone.conf \
        --vfs-cache-mode full \
        --vfs-cache-max-age 30m \
        --vfs-cache-max-size 5G \
        --vfs-fast-fingerprint \
        --union-min-free-space 15G \
        --vfs-read-ahead 2G \
        --allow-other \
        --user-agent "ISV|rclone.org|rclone/v1.65.0" \
        --log-file=/home/dinosm/log/rclone_mediaa.log \
        --log-level INFO \
        mediaa: /home/dinosm/media/MediaA

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[mediad]
type = union
upstreams = mediad1enc: mediad2enc: mediad3enc: mediad4enc: mediad5enc: mediad6enc:
cache_time = 0

[mediad1]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX
drive_id = XXX
drive_type = personal

[mediad1enc]
type = crypt
remote = mediad1:dir/
password = XXX
password2 = XXX

[mediad2]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX
drive_id = XXX
drive_type = personal

[mediad2enc]
type = crypt
remote = mediad2:dir/
password = XXX
password2 = XXX

[mediad3]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX
drive_id = XXX
drive_type = personal

[mediad3enc]
type = crypt
remote = mediad3:dir/
password = XXX
password2 = XXX

[mediad4]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX
drive_id = XXX
drive_type = personal

[mediad4enc]
type = crypt
remote = mediad4:dir/
password = XXX
password2 = XXX

[mediad5]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX
drive_id = XXX
drive_type = personal

[mediad5enc]
type = crypt
remote = mediad5:dir/
password = XXX
password2 = XXX

[mediad6]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX
drive_id = XXX
drive_type = personal

[mediad6enc]
type = crypt
remote = mediad6:dir/
password = XXX
password2 = XXX

The log doesn't seem to show anything while the media is playing (and stuttering/freezing), maybe I need a different logging mode in the systemd file?

A log from the command that you were trying to run with the -vv flag

2023/12/31 01:14:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 1.870Gi (was 1.870Gi)
2023/12/31 01:15:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 1.870Gi (was 1.870Gi)
2023/12/31 01:16:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 1.870Gi (was 1.870Gi)
2023/12/31 01:17:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 1.870Gi (was 1.870Gi)
2023/12/31 01:18:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 1.870Gi (was 1.870Gi)
2023/12/31 01:19:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 1.870Gi (was 1.870Gi)
2023/12/31 01:20:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 1.870Gi (was 1.870Gi)
2023/12/31 01:21:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 1.870Gi (was 1.870Gi)
2023/12/31 01:22:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 1, to upload 0, uploading 0, total size 1.995Gi (was 1.995Gi)
2023/12/31 01:23:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.096Gi (was 2.096Gi)
2023/12/31 01:24:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.096Gi (was 2.096Gi)
2023/12/31 01:25:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.096Gi (was 2.096Gi)
2023/12/31 01:26:34 INFO  : Movies/2020 - 2029/movie/movie - 1080p Atmos.mkv: vfs cache: removed cache file as Removing old cache file not in use
2023/12/31 01:26:34 INFO  : vfs cache RemoveNotInUse (maxAge=0, emptyOnly=false): item Movies/2020 - 2029/movie/movie - 1080p Atmos.mkv was removed, freed 2250095923 bytes
2023/12/31 01:26:34 INFO  : vfs cache: cleaned: objects 1 (was 2) in use 1, to upload 0, uploading 0, total size 1.749Gi (was 3.845Gi)
2023/12/31 01:27:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 1, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:28:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 1, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:29:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:30:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:31:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:32:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:33:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:34:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:35:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:36:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:37:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:38:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:39:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)
2023/12/31 01:40:34 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 2.662Gi (was 2.662Gi)

At this point, all I'd like is to try and exclude rclone as a possible culprit. The fact that, once a movie starts freezing, if I exit and re-enter the app, the movie can resume fine, leads me to believe it's an app issue and not an rclone/OneDrive issue.

I would appreciate any advice or guidance as to how to troubleshoot this definitively, as well as any suggested changes/tweaks to my mount command, to reach a conclusion as to whether rclone/OneDrive are to blame here or not.

Why so short cache time? It expires before you finish watching any film. Ideally your cache size should be big enough to keep all film in it + its max age should be long enough not to expire when still needed. If you have not enough space on your disk then maybe connect external cheap SSD and use this for cache.

I use for onedrive (as it is polling remote) 9999h. Simply keep stuff in cache forever as long as there is enough space.

It's a cloud VPS with limited storage (compared to the size of the files I watch) and storage is expensive :sweat_smile:

The way I understand this cache setting, it keeps a portion of the file in cache, not the whole file anyway, limited by the cache size setting, so even if I set it to a longer interval it will still not be keeping the whole movie in the vfs cache... right?

Basically there is not enough space to even keep one whole movie in it, if I am watching something really huge.

hi,
i might try the following, to simplify the setup
--- test without --vfs-read-ahead 2G
--- make sure the issue is not jellyfin transcoding that video
--- test direct to onedrive remote, without union
--- test without jellyfin, play a video direct from the mount, using vlc

1 Like

I put that there to see if it would help at all. Not sure it has, maaaaaybe it has decreased the frequency of the freezing? I can take it out and see how it goes.

Nothing is ever transcoded when I watch on the Shield, everything always direct plays (I check).

Is there a technical reason why the union might cause this?
Sure, I'll give it a go.

Not sure how to do that, it's a cloud VPS so still need something to serve/stream the file. I can mount the remote on my local laptop, but a) that will bypass the server and b) I can't test it on the Shield with full on 4K videos direct playing, so that won't tell me much.

just offereing suggestions.

no need to suspect, use a rclone debug log.

1 Like

Ah right, I wasn't aware there was a debug option, I'll set the logging to debug and see what happens if/when a video freezes again.

Happy New Year everyone!

Here is a log from trying to play a 1080p movie on my laptop. The movie kept freezing almost from the start, I only played it for a minute or so. I suspect the problem with freezing on laptop is entirely different to freezing on the Shield (Android TV), seeing as on laptop all movies are unwatchable at present, but I thought I'd post the log, at least to know if the log looks normal.

A movie just froze again, and now this is what I can see in the rclone log:

2024/01/13 14:37:51 DEBUG : vfs cache RemoveNotInUse (maxAge=1800000000000, emptyOnly=false): item Movies/2020 - 2029/moviename.mkv not removed, freed 0 bytes
2024/01/13 14:37:51 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 1, to upload 0, uploading 0, total size 1.875Gi (was 1.875Gi)

OneDrive root 'folder': Change notify listener failure: invalidRequest: [token.String] A value is required but was not present in the request.

EDIT: and again with this:

2024/01/13 14:53:39 DEBUG : &{Movies/2020 - 2029/moviename.mkv (rw)}: Read: len=131072, offset=53195476992
2024/01/13 14:53:39 DEBUG : Movies/2020 - 2029/moviename.mkv(0xc000814380): _readAt: size=131072, off=53195345920
2024/01/13 14:53:39 DEBUG : vfs cache: looking for range={Pos:53195345920 Size:131072} in [{Pos:0 Size:30400512} {Pos:51181830144 Size:2013261824} {Pos:71641124864 Size:2055000}] - present false
2024/01/13 14:53:39 DEBUG : Movies/2020 - 2029/moviename.mkv(0xc000814380): _readAt: size=131072, off=53195476992
2024/01/13 14:53:39 DEBUG : vfs cache: looking for range={Pos:53195476992 Size:131072} in [{Pos:0 Size:30400512} {Pos:51181830144 Size:2013261824} {Pos:71641124864 Size:2055000}] - present false
2024/01/13 14:53:49 DEBUG : /: Lookup: name="Movies"
2024/01/13 14:53:49 DEBUG : : Re-reading directory (7m12.137369136s 

EDIT 2:
Every time this happens, the mount freezes, as in I can't even list files. I have to force unmount, then restart the systemd service.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.