This project has moved and is read-only. For the latest updates, please go here.

File Lock Failing?

Sep 23, 2015 at 12:08 AM
Edited Sep 23, 2015 at 12:08 AM
This has happened several times now; MCE starts processing the video file before the recording has finished, which of course fails.

I'm not sure if SageTV (using WinTV-HVR-2255's and infinitv 4) is intermittently releasing the lock at some point (SageTV does not create a new file, so I'm not sure that is happening) or if somehow MCE is failing to handle the lock correctly.

Whatever the cause it's making a mess of my recording system.

I will say the use of WatchDirectory in my old setup (same computer) does not have this problem, but then in WatchDirectory you can specify how long to wait after a lock has be released before checking again...

Any Idea's
Sep 23, 2015 at 12:52 AM
Same concept the use delay in the settings page I wait before processing.

Sep 23, 2015 at 1:28 AM
I'm sure it's right in front of my face, but I don't see a delay setting? I see a poll setting?
Sep 23, 2015 at 2:16 AM
It's called Min Age before conversion

Sep 23, 2015 at 11:57 AM
I saw that, but that is in hour increments. I don't want to wait an entire hour before conversion starts. I think I have WatchDirectory set at 60 Seconds.
Sep 23, 2015 at 1:09 PM
Since sageTV doesn't lock the file there is no way to know when the recording finishes. You can only set a delay from the time the file is *created* so estimate recording time

Sep 23, 2015 at 6:20 PM
Edited Sep 23, 2015 at 7:10 PM
Is there a way to add an option to evaluate files based on time and file size? Example: If files size has not increased over x minutes, process video?

I have some sporting shows that can run for several hours, while others that are 30 min.
Sep 23, 2015 at 10:34 PM
We've looked at that strategy before it's pretty unreliable since some software writes in batches and we've even seen Windows NOT update the size while files are being actively written into. Will look into again

Sep 23, 2015 at 10:58 PM
It's got to be possible, as WatchDirectory is able to handle the same files 100% of the time :-)

Seriously though; thank you for revisiting this issue. This issue; turns out; is a pretty big one for me, as a matter of fact I'm willing to "donate" more money for a working solution for this issue.

I really like the multi-threaded/process architecture of MCEBuddy, and really want it to work.... it would be an HUGE improvement over my hodgepodge of programs that I'm using now...
Sep 24, 2015 at 12:54 AM
They only via way which probably WatchDirectory is using to check for a exclusive ReadWrite lock on the fie (MCEBuddy only checks for exclusive Read lock). If some process is writing then the exclusive ReadWrite lock will fail. It used to be that way earlier but we changed it since it was causing issues with Read only files. It would refuse to process them which is incorrect, hence we had to change it but the compromise is that you can't know if anyone is writing to a file so use the aging option instead.

Will look around for alternative mechanisms to check for file write in progress.

Sep 24, 2015 at 3:26 PM

Can you hook the NTFS Notification and monitor the file close event?

Sep 24, 2015 at 6:41 PM
Would that work for NAS?

Sep 24, 2015 at 11:34 PM
In my case its an NTFS file system. (64bit Windows 7 Pro)
Oct 7, 2015 at 12:39 AM
Any progress on this? I'm kind of dead in the water right now.
Oct 15, 2015 at 10:26 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Marked as answer by rboy1 on 10/15/2015 at 2:27 AM
Oct 15, 2015 at 10:46 AM
I just thought of a simple fix, instead of the delay looking at delay from creation time, it could just look at delay from last written activity. So say the delay is set to 5 minutes, then it'll look to see if 5 minutes have passed since the last write and if so then start processing the program. That would serve to both provide people an option to delay processing for an intentional period of time and to use it to delay processing until the writing is complete (by a few minutes).
Oct 15, 2015 at 12:16 PM
Sounds like a solution to me.

I have found although during testing that some shows never have a problem with MCE starting the processing "early". I have not done enough testing to know what the differences are between the ones that always work and those that do not.

In any event thanks for the consideration.
Oct 15, 2015 at 2:37 PM
@ServiceXp, try the latest 2.4.3 BETA build - we've added some logic to check for file that are being written to and locked for writing/reading. It's not the logic I spoke of above but something more intrinsic to the OS. Let me know if it solves your issues (you can disable the minimum age option while trying it).
SageTV should have locked down the file for writing (even though it gives read access), we are trying to detect this condition. Works in our labs but need a real world spin.
Oct 15, 2015 at 11:08 PM
Will report back.

Oct 21, 2015 at 12:38 AM
So far MCE has not started processing before the completion of the recording. If I get past next Monday with out a problem then I will be able to call this a success!!