File lock(release) on imported video files [Windows]

Hi,
first of all thanks for the great work. I really appreciate and i’d like to contribute where possible.

I found the following behaviour under Windows 7 which i cannot really understand:
(There was already a thread covering one part of this, but it is closed)

Once i add video files to my project, those files get locked in the VFAT filesystem on my Windows machine. Meaning, that i cannot delete those files from my harddrive as long as shotcut is open.
This applies also when i remove the clips from timeline AND playlist.
Even when i close the project, starting a new one, those files stay locked.

So today i wanted to take advantage of this, deleting all the video files in my project folder, that i didn’t use for my project.
I selected all files in the folder with the explorer an pressed delete to move them to the paperbin in windows while i had the project open in shotcut.
To my suprise all files where gone!
Even the files in the timelime that i just exported as a movie.
I just got a black screen, when moving the playhead to those clips in the timeline without any error message.

Can anyone explain to me, what conditions lead to the files in an MLT project to be locked in the windows filesystem and which conditions lead to unlock them?

It’s no mayor issue, but would be nice to know about it to use shotcut to my advance.

My goal is to determine unused files to remove them from my harddrive.

Regards
Martin

Choose close twice.

The Shotcut engine does not try to keep every file in your project open because then it could run out of maximum file handles or use too much memory. It only keeps around 3*(number of tracks + 1). There are separate counters for A/V clips versus still images. It is not easy to predict as it is automatic based on N most recently accessed.

1 Like

Thanks for this quick reply!
I will try to close twice :slight_smile:

And i was also wondering how shotcut deals with a lot of clips.
So this is the answer.
And i can imagine how difficult it might be to predict what the user wants next :wink:

Last question before closing this topic:
Does the release of the file handles also depend on the time of user interaction in terms of inactivity? Because i could delete all files after a big export while i was not using shotcut.

You could always copy the MLT file (.mlt), open the copy in an editor (like Notepad++) and extract all the filenames, sort them and delete anything that wasn’t in the sorted list.

1 Like

No

Because i could delete all files after a big export while i was not using shotcut.

Export occurs in a background process, so whatever it acquires is certainly released when it ends and no longer a consideration. However, simply loading a project is going to open each file at least once while releasing some per my prior description (not N most recent). I can only talk about what Shotcut does. Windows has some implicit file locking, and it may have some rules I do not completely understand about the release of the locks.

I definitely recommend @Elusien’s advice to find out which files are being used and not depending on file locks. Lines that reference a file name also have one of the following words:

  • resource (most common)
  • src
  • file
  • luma
1 Like

I am already on the way to this solution … :wink:

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