whyboris/Video-Hub-App

clips and filmstrips are not generated when using an Rclone mount

gemini0x2 opened this issue · 2 comments

Hello, I moved all my local media to google drive and I use Rclone with macFUSE to mount my google drive as a local folder in my machine. This allows me to access my remote files as if they were locally in my machine similar to a NAS folder. So far all programs I've used to open my files work normally, but when testing VideoHubApp I noticed that it only creates the video thumbnail, but not the clips or filmstrips. When checking the Rclone logs I can see that the file is being processed (ChunkedReader.Read) by VHA, but then after some time the file is released (ReadFileHandle.Release) by VHA and closed. It appears that VideoHubApp does not process the complete file.

Note: When using iina, the video player does not have any issues playing or generating filmstrips, this suggest that VideoHubApp could be having trouble handling the files.

I suspect this is due to the timeout I have set up:

https://github.com/whyboris/Video-Hub-App/blob/main/node/main-extract.ts#L262

I have not found any satisfactory way of making sure that VHA doesn't get stuck on a single file for a very long time (if it is corrupt in some weird way). So I set a timeout to make sure that if the process takes "too long" it will be shut down.

In your case - in order to extract screenshots from the video, I suspect the video file needs to be downloaded from the remote folder (either in full, or at least as many smaller chunks as there are screenshots).

I'm unsure, but if you are able to run the code from source (see README for instructions), you could modify the setExtractionDurations function to return larger timeouts.

I'm a little worried that running VHA against a remote folder will result in downloading the entire folder in the process (into temporary memory).

Hey @whyboris , thanks for the quick response. Regarding the issue, I'm pretty sure you are right! It has to do with the processing timeout. I did some tests with generate_screenshot_strip_args() and generate_preview_clip_args() functions to generate the ffmpeg args for a given file. Then, I executed the generated commands in my cli and ffmpeg had no issues creating the clip and screenshot strip. Modifying the setExtractionDurations should be easy for me, thanks.

I'm a little worried that running VHA against a remote folder will result in downloading the entire folder in the process (into temporary memory).

If files are processed one by one then there should be no issue, but even if multithreading is used to process multiple files rclone should be able to handle it. With my current set up I'm able to play four 4K files simultaneously with no issues. By the way, I always run rclone mount with --vfs-cache-mode off flag, meaning no files are ever downloaded and they are directly read from memory. This is mostly fine if you are only reading from the files, hence ffmpeg and most programs don't complain. On the other hand, when writing into files is recommended to use --vfs-cache-mode full or --vfs-cache-mode writes flags, which downloads the files you are editing. Anyways, I will see how things work out. Thanks again for your assistance!