Encoding videos: writing while copy, mount.. What happens?

Hi all!
I have got a question
I use Windows 10 and rclone 1.51.0
I record my gameplays, encode them and upload them on GDrive. So, I do those things:

  1. Record gameplays: they are in the folder "recorded" (NOT copied by rclone to gdrive)
  2. Encode gameplays: put them in the folder "encoded" (copied by rclone to gdrive)

So, I was thinking about the best way to optimize those things with rclone. I use Handbrake to encode

  1. What happens if I encode a video in the folder "recorded" and set the output to the folder "encoded"? So, does rclone starts the copy while the file is still being written? Can this cause some file corruption or problems with rclone?

Thanks :slight_smile:

Up, I did some tests and strange things happens if I set the output folder to a mounted gdrive folder or if I set as input a file on a mounted gdrive folder, so I can't use those ways.
So, the question is just one.

What happens if I encode a video in the folder "recorded" and set the output to the folder "encoded" (remember that "encoded" is always copied to gdrive)? So, does rclone starts the copy while the file is still being written? Can this cause some file corruption or problems with rclone?

I think that

  1. If upload speed < writing speed (in mb/s), than there aren't problems, because rclone will always be "behind" the encoding

But what happens if

  1. Upload speed > writing speed? So, rclone will "finish to upload the file" while it is still being written. Also what happens if I pause the encoding?

Rclone shouldn't start the copy while the file is being written unless the writing app opens and closes it multiple times, which I guess it might. Rclone should pause the app while the upload is happening so I think that the worst that will happen is that the file will get uploaded multiple times.

You'll probably need --vfs-cache-mode writes for your app to work properly I'd guess.

This is my code
rclone mount "Roba - ccsf:" X: --vfs-cache-mode writes --cache-dir "D:\Programs\ProgrammiNonInstallati\Rclone\VSFCache"
I use "Handbrake" to encode
So, I tried to:

  1. Encode a local video putting the output to X: (mount). Handbrake used 100% CPU (normally) but blocked at 99% for 2-3 minutes, than the file just disappeared from the mount.

1b) Again, encode a local video with output to X:. Worked good, Handbrake didn't block at 100% but the output file was corrupted and couldn't open it.
Meanwhile, the 1) file re-appeared in X: and it was ok, I can open it

  1. Used the 1) file (on mount) to encode it putting the output on X:. So, input from mount and output into mount. Handbrake used only 15% CPU (strange thing), the output was corrupted

So, I'm not an expert and I don't know what's happening here, but 2 files on 3 got corrupted doing this process so this isn't a reliable process I think

So, I can't use mounts. I have got only a question: what happens if I encode a local video putting the output into a local folder but that rclone copies to GDrive?

command:
rclone.exe mount --vfs-cache-mode=minimal --file-perms=0777 wasabieast2:handbrake01 x:

handbrake location=C:\data\M\handbrake\handbrake\HandBrake.exe
source=C:\data\rclone\scripts\rr\other\test\test.mp4
dest=x:\encoded\test.from.local.mkv
using vlc, i was able to play x:\encoded\test.from.local.mkv

handbrake location=C:\data\M\handbrake\handbrake\HandBrake.exe
source=x:\recorded\test.mp4
dest=x:\encoded\test.from.mount.mkv
using vlc, i was able to play x:\encoded\test.from.mount.mkv

in addition, i copied handbrake folder to x:
i was able to run handbrake.exe from x:

handbrake location=x:\handbrake\HandBrake.exe
source=x:\recorded\test.mp4
dest=x:\encoded\test.from.mount.mkv
using vlc, i was able to play x:\encoded\test.from.mount.mkv

image

Uhm
I don't have "--file-perms"
How does this works?
Maybe this is the "problem?

--file-perms=0777 - i do not think that is your problem.
it is an obscure flag, most users do not know about it and do not need it.

normally, a rclone mount can be use as a virtual drive.
you can copy files, delete files, and your windows programs can access those files, as if local.
but you cannot execute a program on the x:

when you run handbrake, you run it from local hard drive, c:.
but with that flag, you get an extra feature, the ability to run programs that are stored on the mount.
as i demonstrated, i execute handbrake from that x:, not from local c: drive.

Understood
But well, so I don't understand why I got 2 corrupted output files..

what version of winfsp are you using?

it can be very confusing to find the most recent stable version
if you goto http://www.secfs.net/winfsp/download/ you will not find it
so goto https://github.com/billziss-gh/winfsp/releases/latest and install v1.6 and test again?

i do not use mounts at all for anything as mounts are much more finicky and slow.
when a windows user has a problem with mount, i try to replicate it, to make sure there are no bugs with the mount command on windows. my small contribution to rclone.

do what i would do - write a simple script.

  1. run handbrake.exe and save encoded files to c:\path.to.encoded.folder\
  2. rclone sync/move/copy c:\path.to.encoded.folder\ "Roba - ccsf:\encoded"
  3. https://rclone.org/donate/
  4. live long and prosper
1 Like

You're right, I have the v1.4!
Will winfsp auto update or notify me when an update is avaiable? And rclone?

neither will notify you. it is up to you!

with winfsp, my suggestion is to uninstall winfsp, reboot and then install v1.6

1 Like

Understood thanks. I will try later with 1.6 :slight_smile:

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