Optimize for 4K Plex Direct Play from Gdrive

What is the problem you are having with rclone?

Setup:
Google Drive mounted with RClone on a Windows machine that I run at home.
Internet fiber 500/500 Mbit/s
LG TV with Plex app installed, connected wired 1 Gb directly to switch

Direct Play a 4K 60Gb files works with the occasional Plex micro buffer (1 second or less), but if file size get larger then Plex buffering is happening more often.

Any suggestions on the config below to further optimize the experience?

What is your rclone version (output from rclone version)

1.53.3

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Windows 10

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

Google Drive

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

mount gdrive: P: --config D:\RcloneCache\rclone.conf --vfs-cache-mode full --buffer-size 1G --vfs-read-ahead 500M --vfs-cache-max-size 150G --vfs-cache-max-age 336h --cache-dir D:\RcloneCache\CacheDir --dir-cache-time 1000h --poll-interval 15s --timeout 1h --log-file D:\RcloneCache\Rclone.log --log-level INFO --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"

The rclone config contents with secrets removed.

[gdrive]
type = drive
client_id = xxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
client_secret = xxxxxxxxxxxxxxxxxxxxxxxxxx
scope = drive
root_folder_id = xxxxxxxxxxxxxxxxxxxxxxxxxx
token = {"access_token":"xxxxxxxxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxxxxx","expiry":"2021-06-18T17:28:37.6595919+02:00"}
plex_url = http://127.0.0.1:32400
plex_username = xxxxxxxxxxxxxxxxxxxxxxxxxx@gmail.com
plex_password = xxxxxxxxxxxxxxxxxxxxxxxxxx

hi,
best to update rclone and test again.

Will do that for sure.
Do you know if there are any specific changes since 1.53.3 that will help with this issue?

best to update and test again

also, make sure to have latest winfsp
https://github.com/billziss-gh/winfsp/releases/tag/v1.9

Now running latest version of Rclone (1.55.1) and WinFsp (1.9.21096) but the short Plex buffer issue remains.

Be super awesome to see a log file as it's just guessing at this point. That's why it's part of the help and support template.

If you're using Plex directly via the LG, then that is the cause of the buffering. The TV only has a 10/100 Mbps port, which is the limiting factor here. The solution is to either get a gig-speed USB adapter and plug that into the LG, or buy a Shield, which is what I'd recommend.

Yeah, sorry.
Here you go: https://file.io/cbvMLapUixwK

During playback of Shazam!.2019.REMUX... it buffers

There nothing in rclone so most likely as @VBB stated, it's your player.

You can see it open/closes the file like 96 times while it's playing:

grep -i shazam Rclone\ -\ Copy.log | grep Flush | wc -l
      96

So player is doing something odd. I also doubt that's direct playing as from that container, I can't imagine that TV can play directly.

Can you share what plex shows while it's playing in the Dashboard?

image

Should be something like that.

On my switch it shows as 1 Gb connection. Although on the internet there are some reports about it being 100Mbps indeed: wired lan port speed on 2019 LG C9 | AVForums

2021-06-18 20_07_31-Plex

It is in Dutch: "Afspelen zonder transcoding" = "Direct Play"

Yeah, that's not direct play as it's transcoding so you need a pretty beefy server to transcode 4k so if your server can't keep up, that causes stutters.

Direct play will have that in it.

image

I have an LG myself, and I've tried to use the built-in Plex client in the past. It works fine for pretty much everything except 4K remuxes. Unfortunately, there are no TVs with gig-ports out there. I used a PC for playback for almost a decade until recently, when I switched to a 2019 Shield Pro. That can play whatever you throw at it :wink:

It is Direct Play, CPU is doing nothing at the moment
I switched the interface to English so it doesn't confuse :slight_smile:

image

I might try the USB 3 Gigabit adapter first. Any experience with those? Which model works for sure?

Might want to check AVS or AV forums, since you're in the Netherlands. I never bothered with the adapter, but those that work will get you right around 500Mbps.

Ok, just ordered this one: https://www.amazon.nl/dp/B00BBD7NFU?psc=1&smid=A2HI77ZYQGGRR3

In the comments a few reactions that it works great with LG tvs and they say it improves performance a lot.

Should arrive tomorrow, flingers crossed

1 Like

I received the USB ethernet adapter. It works and gives more than double the download speed that I had before. 97 Mbps vs 221 Mbps so that is a good improvement and I assume it is enough to play the 83,4 Mbps bitrate file i'm testing with.

Unfortunately the buffering is still there with this 83,4 Mbps file :cry: , but network wise it should not be an issue.
I also tested with the xplay client as a read that other people had better experience with that client, but it shows the same behavior.
Wifi is disabled on my tv

Also tested with a 72,3 Mbps file, that also buffers regularly.
Playing a 60 Mbps files works without any problem.

If we go back to my Rclone config.
Is there anything I can optimize?

@Animosity022 You mentioned that the file is opened and closed a lot. Is that unexpected behavior?
A new debug log: https://file.io/emoZyOzo7m0Z

Built in NIC

USB Adapter

Is your Plex server local or remote? If remote, how far away? Even with my Shield, I do experience the occasional buffer, especially with very high bit-rate stuff. It all comes down to latency. In my case, the Plex server is far away, and it is unfortunately my bottleneck. Well, the connection between it and my local ISP, really. When I access my media directly from the mount, bypassing the remote server, I never have any issues.

EDIT: I can see from your screenshot that you're hosting Plex locally. So, it's likely that your latency to Google's servers is the culprit here.

If I were you, I'd try @Animosity022 settings first: homescripts/rclone.service at master · animosity22/homescripts · GitHub

Alternatively, you could try mine, which are based on his, but without the cache, and read-only:

rclone mount --attr-timeout 5000h --dir-cache-time 5000h --drive-pacer-min-sleep 10ms --poll-interval 0 --rc --read-only --user-agent ******* -v

I refresh the mount once a day with this:

rclone rc vfs/refresh recursive=true --drive-pacer-min-sleep 10ms --timeout 30m --user-agent *******