ozmartian / vidcutter

A modern yet simple multi-platform video cutter and joiner.
GNU General Public License v3.0
1.77k stars 137 forks source link

The LIKELY CAUSE of most 'hung in saving' reported issues (at least on LINUX). #367

Open rickst29 opened 1 year ago

rickst29 commented 1 year ago

I am surprised to see that the working directory (for saving clips, and then for re-assemblng them into the save video) is the system root TMP directory - probably not a good choice saving many gigabytes of numerous and long clips.

I don't know how to write python code, and have no idea how that default location is obtained.

RFE: I think that it would be better to obtain the final save destination filename and directory FIRST, and then use that 'fianl export' directory to write and read these temporary files. The selected Directory should obviously be writable, and might be on a larger $HOME device.

rickst29 commented 1 year ago

Still not writing any code, but vidcutter is creating these files in the QDir::tempPath() location.

On Linux, this can be defined by the TMPDIR environment variable. (It defaults to the system' /tmp' if TMPDIR is not defined.) When /tmp has not be defined to a different size within /etc/fastab, it is created (using filesystem tmpfs) with the amount of remaining 'free' memory at initialization time.

In my "small" 16GB system, the resulting file size was about 7.8 GB. Most of my videos are larger than that.

LINUX WORKAROUND:

I created a new directory "/home/myself/tmp" within $HOME on my large SSD. Then, within my .bash_rc, I export this new variable:

export TMPDIR={$HOME}/tmp

Creating 8 clips from a large video, the total size of my new {$HOME}/tmp reached about 34 GB during the "save" process, but the final video (17 GB) saved successfully - and works great.