Welcome, Guest
Username Password: Remember me

TOPIC: Lightworks Project Fixer - Beta Version

Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99170

  • khaver
  • Pro User
  • OFFLINE
  • Platinum Boarder
  • Posts: 3282
  • 2 years, 10 months ago
This program is for when you have Media Off-line problems. It can check the status of a selected project or all projects at once. Green status means the project does not need fixing. Yellow means the project has off-line media but you should be able to re-link to the media using Lightworks' "Re-link Media" function. Red means there are problems with the project but should be fixable. Black means the project is not fixable.

When you run the program it will generate a list of all your projects sorted with the newest at the top. Select one to check and click the Check Selected button or click the Check All button to check all the projects. If you have a large number of projects, checking them all can take several minutes.

Once you've checked the project(s), select the one to fix and click the Fix Selected button. Please note, fixing projects can potentially take several hours if it needs to move link files of clips that were transcoded or copied local from a media drive location that's no longer set as an active media drive for Lightworks to use. If this is the case and you choose to Fix All, you may need to let it run all night.

After each project is fixed, it checks it again and updates the status. Again, if it's yellow, you should now be able to use the Re-link Media function from within Lightworks if you were not able to before.

This program shouldn't destroy your projects but I can't guarantee 100% that it won't. Use at your own risk and don't test it in a production environment. Please provide feedback if you do try it.

FOR NOW DO NOT USE IN A SHARED ENVIRONMENT!

Note: Myself or Editshare has no responsibility for any damage it may do.

v1.0 updated 3/2/18
Major update.

This version fixes a major bug and adds a new feature.
First the bug: The previous versions only searched the root directories of fixed, removable, and network drives for Lightworks media locations not defined in Lightworks. Therefore, if you had media locations in sub-directories of drives, they were not found. This could result in duplicate link files existing in multiple locations after using the "Fix" function.

In this new version, all the drives are fully searched for media locations. Because this can now take considerably more time for every drive, especially mapped network drives, when you first start the application, a dialog box will open allowing you to deselect drives to search that you know have no possibility of having media locations on them.

I've also added a "CLEAN" function. This will create a list of every link, transcoded and copied local file created by Lightworks from every media location found, and compare it with a list of every imported clip in every Lightworks project. If there are files in the media locations that are not referenced in any project, they will be moved to a new folder named "ORPHANS" created in one of the media locations you have defined in Lightworks. This allows you to check your projects before deleting the orphaned files. Be aware that the Clean function can take a while to run if you have many projects with many imported clips.

Please provide feedback in this thread for any bugs found.
v0.8 updated 7/13/17
Fixed some more bugs.
v0.7 updated 5/13/17
Fixed "error - line 2428 Variable used without being declared" bug.
v0.7 updated 1/14/17
A few bug fixes.
Compatible with projects created in Lightworks v14.
No longer lists projects with no imported media (0 shots).
Slight speed increase.
v0.6 updated 5/5/16
If the project folders can't be found in the usual places, a "Select folder" dialog
box will open.
You can select multiple projects to check and fix.
v0.5 updated 11/20/15
Double click on a project to bring up the shot list.
Link individual files button: You will be asked to re-link each file that needs re-linking.
Link parent folder button: Select the parent folder that contains all the source files that need re-linking. It will also find them in sub-folders of the parent folder.

This image is hidden for guests. Please log in or register to see it.


This image is hidden for guests. Please log in or register to see it.


Zip password is khaver.

Note: I code using AutoIt and some AV programs flag apps compiled using it as suspicious. LWKSProjFix.exe does not contain a virus.

This attachment is hidden for guests. Please log in or register to see it.
Work Comp: Retired!
Home Comp: Newer! Bigger! Faster!
Send me a tip: paypal.me/4khaver
Last Edit: 3 months, 2 weeks ago by khaver.

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99188

  • asilnevs
  • Pro User
  • OFFLINE
  • Gold Boarder
  • Posts: 252
  • 2 years, 10 months ago
Hi, this looks nice.
Because I´m working on Ubuntu I was trying to get it work with Wine but at the moment I double-click on LWKProjFix.exe I get the following error:
error: variable used without being declared
So I was googling this error and find some links to AutoIt.
I also tried your program in Win XP that is installed within Virtualbox (no LWKS is installed on this Win XP) and this gives the same error only the path in the first line (see picture) is different.
I was wondering that this error has something to do with the path of the LWKSprojects directory because in my Ubuntu environment I moved this to another directory. Is there a way that your program can find that LWKSproject directory or is it just looking for the default directory ?
This image is hidden for guests. Please log in or register to see it.
Laptop: Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz / System memory: 4GB / 64 bits / NVIDIA GeForce 9600M GT / Intel 82801I (ICH9 Family) HD Audio Controller / Harddisks: 2 x 500GB SSD / OS: Ubuntu 16.04 LTS / Lightworks Pro 14.0

Desktop: Intel(R) Core(TM) i7-4790K CPU @ 3.60GHz / System memory: 16GB / 64bits / Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller / Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller / Harddisks: SSD 128GB - HD 500GB - HD 2TB / OS: Ubuntu 16.04 / Lightworks Pro 14.0

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99197

  • khaver
  • Pro User
  • OFFLINE
  • Platinum Boarder
  • Posts: 3282
  • 2 years, 10 months ago
It reads the Windows registry to find the projects folder so I don't think you will have any luck on Linux. If you could tell me how Lightworks finds the project folder on Linux ( is there a file it reads?) I might be able to add that if it can't find the info in a Windows registry.
Work Comp: Retired!
Home Comp: Newer! Bigger! Faster!
Send me a tip: paypal.me/4khaver

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99199

  • asilnevs
  • Pro User
  • OFFLINE
  • Gold Boarder
  • Posts: 252
  • 2 years, 10 months ago
In /home/username/Lightworks/UserSettings.txt this text gives the path to the projects:
Local Projects=/media/jef/e2d2c9b0-b61c-4e3b-be18-585e70886578/ProjectenLightworks/
Is it difficult to add a button just to navigate to that folder and select it?
Laptop: Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz / System memory: 4GB / 64 bits / NVIDIA GeForce 9600M GT / Intel 82801I (ICH9 Family) HD Audio Controller / Harddisks: 2 x 500GB SSD / OS: Ubuntu 16.04 LTS / Lightworks Pro 14.0

Desktop: Intel(R) Core(TM) i7-4790K CPU @ 3.60GHz / System memory: 16GB / 64bits / Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller / Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller / Harddisks: SSD 128GB - HD 500GB - HD 2TB / OS: Ubuntu 16.04 / Lightworks Pro 14.0

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99200

  • rhinox202
  • Pro User
  • OFFLINE
  • Platinum Boarder
  • Posts: 1689
  • 2 years, 10 months ago
Out of curiosity, I decided to test this and I'm also having issues.

For starters, one of my projects is not listed. After enabling "Show project locations" in Lightworks, I think the issue is that the project is really old. I say that because Lightworks used to use a "[" in the cookie (eg. P[0800DT) . The Devs have since removed this for, I believe, compatibility reasons.

Another issue is that none of my projects are green (all are red), even though I know for sure that at least one of them is good. There is no media offline when viewing all the clips in the project in Lightworks. One of the other projects I even removed all logs that were offline and the project still comes up as red.

The last issue, really a minor annoyance, is that "P0001000" is listed. This "project" is automatically generated by Lightworks. I can see people wondering what it is and why it's not listed in Lightworks. No biggie.

So, while I'm not worried that something is broken in my project, it makes me curious what is going on. Any ideas? Need more information? Let me know. Thanks.

p.s. I can wait :-) Get asilnevs "squared away" first.
Intel Core 2 Quad (Q6600) :: 4GB :: 256GB SSD :: 1TB HD :: EVGA Geforce GTX 1050 Ti :: Win 10 Pro (1709) :: Lwks 14.1 Beta
Last Edit: 2 years, 10 months ago by rhinox202.

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99204

  • khaver
  • Pro User
  • OFFLINE
  • Platinum Boarder
  • Posts: 3282
  • 2 years, 10 months ago
I'm really reluctant to try to add Linux functionality into a Windows application. The file system is very different and I would be afraid I'd really mess up someones projects. I will still consider adding this but I have no way of finding out where link files are kept and where they would need to be moved and I have no way of testing it.

For now I will concentrate on fixing Windows bugs.

rhinox, none of my projects use the "[" character so I didn't know to look for it. I can add this. Also, I have no P0001000 project in my Projects folder, but I can filter that out.

Here's the process that it uses to determine if the project is "Green"(good), "Red"(broken), "Yellow"(you should be able to use the Re-link Missing Media function in Lightworks), or "Black"(not fixable).

It first makes a list of all possible places that link files might be in and then removes the locations that are in the "DefNetDrive.txt" file. This becomes my "not usable" list. The locations in the DefNetDrive.txt file are my "usable" list.

It then parses each project's odb file looking for records with a "Type" value of "shot" and a "Flags" value of "1". If it can't find any "shots" the project is set to black (not fixable).

For each shot in the list it finds, it parses the shot's ED5 file and finds the original source clip location. It then looks for the original source clip and for the link file in the "usable" list. If it finds the original clip and the link file, and the link file is 512 bytes (it's a true link file), that shot is flagged OK. Also, if the link file size is not 512 (the clip was copied local or transcoded), it's also flagged OK. If the source clip is not found but the link file is and it's only 512 bytes, then that shot is flagged as not OK but re-linkable. It only takes one shot that's flagged as not OK for the project to be marked Yellow.

When a project it "Fixed", shots flagged as above will not have anything done because it's either OK or the clip can be re-linked in Lightworks.

If any required link file is not found in the "usable" list, the project will be marked Red.

When "Fixing", if a link file is not found in the "usable" list, it searches for it in the "not usable" list. If it finds it in this list, the link file is moved from it's current location to the best location in the "usable" list. If the source clip is also found or the link file is an actual clip (copied local or transcoded), then that shot will be OK. If the link file is not found at all, but the source clip is, a new link file is created in the best "usable" list location that points to the source clip. If both the link and the source clip can not be found, a new link file is created that contains the clip path that was extracted from the shot's ED5 file. This will allow relinking from within Lightworks.

rhinox, do you have a DefNetDrive.txt in the "Projects" folder? My app uses the locations listed in this file as the "usable" locations. It's my understanding this file must exist so Lightworks knows to use only these locations to put link files in. If any link files are found in locations other than what's listed in that file it will mark the project Red. If Lightworks doesn't really need this file and you don't have it in your Projects folder, then that may be the reason it's marking all your projects as Red.

With the above info, can you see where the app may be in error?

Thanks for you input.
Work Comp: Retired!
Home Comp: Newer! Bigger! Faster!
Send me a tip: paypal.me/4khaver

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99209

  • rhinox202
  • Pro User
  • OFFLINE
  • Platinum Boarder
  • Posts: 1689
  • 2 years, 10 months ago
Thanks for the detailed breakdown. Very helpful. The problem appears to be with my "DefNetDrive.txt" file. It's totally blank. Not sure why. I doubt it will shed any light on the subject, but I have 3 hard drives and use the LW Free. Projects are stored on C:, while my media and logs are on E: drive. All clips are imported with "Create link".

As for the P0001000 project, I tried deleting it and Lightworks just recreates it upon launch. Not sure what that's all about, however, a quick forum search shows entries dating back to February 2013. According to a post by RWAV, these are "LW's Project and Bin/Rack template directories". P0001000 and G0001000 respectively.
Intel Core 2 Quad (Q6600) :: 4GB :: 256GB SSD :: 1TB HD :: EVGA Geforce GTX 1050 Ti :: Win 10 Pro (1709) :: Lwks 14.1 Beta

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99210

  • rhinox202
  • Pro User
  • OFFLINE
  • Platinum Boarder
  • Posts: 1689
  • 2 years, 10 months ago
Just for kicks and giggles, I opened a project and added a directory with sub-directory to the Media tab on the Project Card. That directory now shows up in the "DefNetDrive.txt" file. So I tried adding just a directory and it works as well. "C:\ATI" and "D:\" both show up in the TXT file. Not sure why "E:\" isn't there. Is there any reason why you don't automatically look for a "Material" folder in the root of each hard drive? That's what I did for a script I wrote. It won't catch custom directories but that didn't matter to me.
Intel Core 2 Quad (Q6600) :: 4GB :: 256GB SSD :: 1TB HD :: EVGA Geforce GTX 1050 Ti :: Win 10 Pro (1709) :: Lwks 14.1 Beta

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99217

  • khaver
  • Pro User
  • OFFLINE
  • Platinum Boarder
  • Posts: 3282
  • 2 years, 10 months ago
It does look for MATERIAL and SOUND folders on every drive and looks for link files in these but if they are found in folders not listed in the DefNetDrive.txt file the project is marked red. I'm wondering what the purpose of the DefNetDrive.txt file is? Maybe it's for all future imports only.
Work Comp: Retired!
Home Comp: Newer! Bigger! Faster!
Send me a tip: paypal.me/4khaver

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99228

  • asilnevs
  • Pro User
  • OFFLINE
  • Gold Boarder
  • Posts: 252
  • 2 years, 10 months ago
khaver, it´s not a problem for me that you are reluctant concerning this Linux situation but I´m always curious about such Windows programs that I can get it to work in Linux or not. I don´t really have a problem with off-line media but maybe other Linux users have.
I wanted to give it a try because I´m also using Eyeframeconvertor and this works great with Wine in Linux.
But as I mentioned before, just a button to select the projects folder myself could solve the problem.
But I leave it to you to add this extra functionality, no hard fealings if you won´t
Laptop: Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz / System memory: 4GB / 64 bits / NVIDIA GeForce 9600M GT / Intel 82801I (ICH9 Family) HD Audio Controller / Harddisks: 2 x 500GB SSD / OS: Ubuntu 16.04 LTS / Lightworks Pro 14.0

Desktop: Intel(R) Core(TM) i7-4790K CPU @ 3.60GHz / System memory: 16GB / 64bits / Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller / Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller / Harddisks: SSD 128GB - HD 500GB - HD 2TB / OS: Ubuntu 16.04 / Lightworks Pro 14.0

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99251

  • billdiver
  • Edu User
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • 2 years, 10 months ago
hi, this looks really helpful,
but when I run it, it only finds the "basic/standard" P0001000 project . . . which is in the same folder as all the others (Windows 8.1) (C:\Users\Public\Documents\Lightworks\Projects); the others however all have a "(" in the name as : PU0(00KG. Is this the reason ? Is there any way to encourage it to look at these projects ?
Sony Vaio Windows 8.1
Intel Core i7-3632QM CPU 2.20GHz
8GB DDR3 RAM
AMD Radeon HD 7650M 2GB RAM

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99252

  • khaver
  • Pro User
  • OFFLINE
  • Platinum Boarder
  • Posts: 3282
  • 2 years, 10 months ago
I'll try to make changes latter today.

Thanks for testing and letting me know about the problems.
Work Comp: Retired!
Home Comp: Newer! Bigger! Faster!
Send me a tip: paypal.me/4khaver

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99277

  • RWAV
  • Moderator
    Pro User
  • OFFLINE
  • Moderator
  • Posts: 5121
  • 2 years, 10 months ago
I'm wondering what the purpose of the DefNetDrive.txt file is?
Defines media locations for shared projects.
BETA System
Microsoft Windows 7 Professional 64BIT
HP Z800 Workstation

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99295

  • khaver
  • Pro User
  • OFFLINE
  • Platinum Boarder
  • Posts: 3282
  • 2 years, 10 months ago
I've made some changes. It should find all projects now. P0001000 is filtered out of the list. If you have no DefNetDrive.txt file or it is empty, your usable media locations will be anywhere MATERIAL and SOUND folders are found off the root drive minus any drives found in the UnmountedDrives.txt file.

LWKSProjFix.zip
Work Comp: Retired!
Home Comp: Newer! Bigger! Faster!
Send me a tip: paypal.me/4khaver

Re: Lightworks Project Fixer - Beta Version 2 years, 10 months ago #99319

  • rhinox202
  • Pro User
  • OFFLINE
  • Platinum Boarder
  • Posts: 1689
  • 2 years, 10 months ago
AutoIt Error - Line 10200 - Error: Variable used without being declared.
Intel Core 2 Quad (Q6600) :: 4GB :: 256GB SSD :: 1TB HD :: EVGA Geforce GTX 1050 Ti :: Win 10 Pro (1709) :: Lwks 14.1 Beta
Time to create page: 0.50 seconds
Scroll To Top