Post Capture help on restoration / correction

1. OK .. thanks for that 'lesson' (appreciated) now defined the path to video to suit my files locations ... and also amended the path for plugin folder ...
Installed these and now get:

RemoveGrain; invalid mode 20
(QTGMC-3.32.avsi, line 756)
(QTGMC-3.32.avsi, line 781)
(QTGMC-3.32.avsi, line 614)

2. You do need the '25' version of masktools. But don't have SSE2 and SSE3 dll's in your plugins at the same time. Just keep SSE2. SSE3 has bugs. Here's the rule: if you're using AVisynth 2.6, you'll run into some incompatibilities with several plugins. the masktools '25' version is for AVisynth 2.5x. The '26' version is for Avisynth MT-2.6.x. Avisynth 2.6 gave me so many problems, I had to stop using it. You can clear that by replacing the 2.6 version of Avisynth.dll in your System folder (or SYSWOW64) with the 2.5 version of Avisynth.dll. No need to reinstall.

Some plugins will work with both YV12 and YUY2 colorspaces. QTGMC is one of the plugins. There are others. With 2.6 versions of those support files, you can't use those plugins in YUY2. (And that's another reason I'm keeping Avisynth 2.6 on hold for now).

Take a look at the two RemoveGrain dll's and let us know which versions you have. You can tell by the date shown in your list of plugins. RemoveGrainSSE2.dll and RepairSSE2.dll should be the August 2005 version or later. You might have older ones.

Yes, I know. Everyone goes through this at first.
RemoveGrain; invalid mode 20
(QTGMC-3.32.avsi, line 756)
(QTGMC-3.32.avsi, line 781)
(QTGMC-3.32.avsi, line 614)
Wrong version of RemoveGrain. Try these until you find the right one:

http://avisynth.nl/index.php/Removegrain
4. Originally Posted by sanlyn
You do need the '25' version of masktools. .....
etc.
OK .. as per previous advice I have AVIsynth 2.5
The ver of avisynth.dll in my SYSWOW64 is 2.5.8.0
Removed SSE3 file
versions:
RepairS 01/May/2005
RemoveGrain 01/May/2005
RemoveGrainSSE2 01/August/2005
RemoveGrainS 01/May/2005

it has no later ver that I have installed ... if I need later where do I get this ?
5. Just run script again it's back to previous error (before I added masktools-26) .. i.e

Script error: SmoothLevels does not have a named argument "smooth"
6. Originally Posted by manono
RemoveGrain; invalid mode 20
(QTGMC-3.32.avsi, line 756)
(QTGMC-3.32.avsi, line 781)
(QTGMC-3.32.avsi, line 614)
Wrong version of RemoveGrain. Try these until you find the right one:

http://avisynth.nl/index.php/Removegrain

Thanks ...my post just crossed on this one ... those are the versions I have installed
Just run script again it's back to previous error (before I added masktools-26) .. i.e

Script error: SmoothLevels does not have a named argument "smooth"
Then you have a different version of SmoothAdjust.dll. So remove the "smooth" part from this statement:
Code:
SmoothLevels(20,1.0,255,16,240,chroma=200,limiter=0,tvrange=true,smooth=200,dither=100,protect=6)
and make it:
Code:
SmoothLevels(20,1.0,255,16,240,chroma=200,limiter=0,tvrange=true,dither=100,protect=6)
Originally Posted by manono
RemoveGrain; invalid mode 20
(QTGMC-3.32.avsi, line 756)
(QTGMC-3.32.avsi, line 781)
(QTGMC-3.32.avsi, line 614)
Wrong version of RemoveGrain. Try these until you find the right one:

http://avisynth.nl/index.php/Removegrain
Thanks ...my post just crossed on this one ... those are the versions I have installed
That link has two versions of RemoveGrain: 0.9 and 1.0. Don't use both. v1.0 is the Aug 2005 version to keep.
8. OK ... that worked ... on sample ... will run it on main file.

Any extras I need to be aware of for step 2 (getting late so that will be tomorrow)
9. I suggest that you first work with shorter samples to get a better idea of the way the filters work, and how the various stages fit together. Most people work that way while they tweak their setup. It's also likely that you might have to simplify or change some settings to suit some segments of the videos. It's far less grief to make an adjustment early than to have to sit through an entire reprocess again.

I might be thinking of another thread, but it seems that you might have seen some of these plugins earlier. In any event, Step2 uses MCTemporalDenoise (aka MCTD). That's another big fella that has a dozen support files, but you should have most of them by now. And, yes, MCTD uses RemoveGrain and others that you've seen earlier. If you have a problem finding some, let us know. They are posted all through the forum in various threads due to the great popularity of MCTD.

OK ... that worked ...
Fantastic! Good work.
10. Yep ... agree, somehow I have just screwed things up .... all I did was change file name and now it keeps failing on line 4 ...
It's now late I'll have to start again tomorrow.

FFAudioSource: Can't open 'E:\Users\Rick\desktop\Sandhurst\Clip2
(E:\Users\Rick\desktop\Sandhurst\Step1.avs, line4)

resolved with help of DB83, had left of the .avi off path name ... time to go sleep I think
11. The name of your new source file from the first step should be Step1.avi, not Syep1.avs. vWen you open the step1 script in VirtualDub, you save the results of that first script as follows:

- "Video..." -> "Color depth..." -> "4:2:0 planar YCbCr (YV12)"
- "Video..." -> "compression...: -> set Lagarith compression for YV12
- "Video..." -> "fast recompress"

Then "Save Avi.." as "Step1.avi", or whatever name you want.

Because you've already set up the audio within the avi output in Step 1, you can open the new results as follows:
Code:
AviSourc("E:\Users\Rick\desktop\Sandhurst\Step1.avi")  ## <- or whatever name you gave to the Step1 file.
If your output file is really named "Clip2" with no file ending, Avisynth likely is confused. I used ffms2 to oipen the file in the first script because for some reason "AviSource" was screwing up the opening frames.

The output of the second script should be saved the same way in VirtualDub as "fast recompress", but this time the output is RGB, not YV12. Be sure you set VDub's "Video" settings for that change in output.
12. OK had some 'play time' on different clips ... impressive results.

Time to move onto "Step2" script .... stalling when I try to run it with error:
"Here is no function named remove dirt" line 16

On Line 16 you have RemoveDirt(20,0,false)
Do I need to add to the Ste2 script as have read a comment form you elsewhere that RemoveDirt.avs is a script that must be imported manually with the "Import" statement.

I checked plugins, and loaded same Removedirt dll & avs as you posted in RemoveDirtv09 zip file in a thread response to someone else.
Don't have the RemovedirtS or SSE2 versions installed.
13. There are dozens of versions of RemoveDirt, but attached is the one seen most often and is the one I used (which I got a long time ago from jagabo). RemoveDirt 0.9 requires the .avs script as well as the .dll plugin. The attached zip contains all of the original RemoveDirt download, but you only need RemoveDirt.avs and RemoveDirt.dll. Ignore the others. RemoveDirt was used here to smooth some bobbibg motion and to clean up some more chroma junk.

Hm. I thought you already had this stuff from another thread. Perhaps I'm thinking of something else.
14. Originally Posted by sanlyn
Hm. I thought you already had this stuff from another thread. Perhaps I'm thinking of something else. ANyway, it's a good thing you now have RemoveGrain, which RemoveDirt uses.

That is the file I saw you posted in another thread ... so I had used it and installed RemoveDirt.dll and RemoveDirt.avs from that zip pack. (Just did it again to be sure)

Still get error .. "There is no function named Removedirt" line 16

Step2 script attached
15. You ahve to import the function.

Import("path\to\plugins\RemoveDirt.avs")
16. OK ... didn't realise that .. added it to the script ...

moved me on a bit ...

Now complaining of Script Error:
there is no function named "FluxSmoothST"

..... in RemoveDirt.avs line 8

This is pretty complex stuff for sure
17. Now, there's a surprise. I picked that up years ago, one of the first Avisynth plugins I ever used. And the first time a newcomer has seen that error, as far as I can recall. Anyway, it's attached.
18. Double post
19. Sorry about that simple missing dll .... I thought it was more complex than that .... also found next step that it was after "VagueDenoiser" went and found that and "Step2" now running OK ...... working hard judging by how slow it is.
Thanks for your help .... I'll play with Step2 a few times before moving on.

My PlugIns folder is certainly growing in size.
20. My plugins folder has 137 dll'[s (!). That doesn't even count the separate "scripts"folder (!). Likely you won't be going that far.

Sorry about VagueDenoiser, it must have slipped my aging memory. If you run into another of these and have trouble finding it, let us know.
21. No probs .... I'm glad for all the help you are giving .... assume for STEP3 I manually load filters into VD and then load the vcf settings file ... no Avisynth used in this step
22. The 3rd step was VirtualDub only. You don't even have to load the filters. Just load the avi video from step2, then load the .vcf file. The filters load with settings as originally used. But insure that the .vdf's are in your VirtualDub plugins folder.

The results should be saved as RGB (which will be the defautl) using Lagarith-RGB and "full processing mode".
23. Need help on the Plugin 'GrainFactory3.avsi'
neither of the 2 main sites have this ..
http://avisynth.nl/index.php/External_filters
http://www.avisynth.nl/users/warpenterprises/

I did find it listed under a search on:
http://avisynth.nl/index.php/GrainFactory3

Can you point me to a location for this ?
24. Hm, another oddity. I'm encountering some dead links on the old archive sites myself recently. But it's up to date in the listing on this site: http://avisynth.nl/index.php/External_filters , and the original avsi script appears here: .http://forum.doom9.org/showthread.php?p=1191292#post1191292

But just in case there are any differences, a copy of the "tried and true" version is attached.
25. Working with Clip1. Almost there, using a similar but slightly shorter script. Along the way, I couldn't resist repairing some of the bad frames in Clip1. There are many tricks for this sort of thing. Some work, some don't. Here a few that did.

Left-click on the images to view them enlarged, and to switch back and forth between "before" and "after".

Clip 1, frames 186-187-188 (these are deinterlaced frame numbers). The original frame 187 (below, middle frame) has a gray horizontal "rip", and something odd: The men appear to be marching backward for one frame. A frame interpolation plugin was used to create a new frame 187 from the previous and following frame, both of which happen to be useable frames. This doesn't work well if the damage exists over several frames. But it worked here. It's one of jagabo's contributions. Original frames 186-187-188:

Fixed:

Clip 1, frames 519-520. The original frame 520 on the right-hand side has a bad flag or "tear" across the entire lower portion. Unfortunately there is no following frame from which to create a new one. So I borrowed the same area from the previous frame 519 and overlaid it onto frame 520. There wasn't much movement, so this worked fairly well.

Clip 1, frames 521-522-523. Thanks to damage in the previous frame that made the tape "bounce", frames 521-522 are a mess, and mostly monochrome. A routine was used to copy the chroma channels from frame 523 into frames 521 and 522. The camera was zooming in, so it's not a perfect fit. But it's pretty close (again, thanks to jagabo).

Of course there are always things that cannot be fixed. I'll include the code in the next post with an mkv attempt at Clip1.
26. This mkv effort doesn't use VirtualDub or RemoveDirt. But that blasted top-border flashing is worse here, so I had to go with MCTD again in a separate step. Fortunately it uses the same plugins as before but with different color settings. Three new plugins were used; the attached .zip contains FixChromaBleeding2.avs, ReplaceFramesMC2.avs, plus RemapFrames.dll and its html help. I could have used stronger filters for the color flashing, but most of it is gone and I didn't want to over filter.

Moral: it should be illegal to manufacture consumer cameras that have zoom lenses, autogain, and autocolor.
27. Like the comment "it should be illegal to manufacture consumer cameras that have zoom lenses, autogain, and autocolor."

So running the 3 steps of the 'Clip1 script' should show improvements over the previous 4 steps ? .... assuming I followed you OK.

I'll run both and do a compare ... be good to see both end results.
found it needed extra plugins ... TDeint and VerticalCleaner
Also errored on DEdgeMask ... reinstalled Masktools 1.5.8 that seemed to clear that.

But stuck on following: Script Error
"There is no function named "mt_makediff" (QTMGC-3.32.avsi, line 776) (QTMGC-3.32.avsi, line 3866)

Can't find any mention of a plugin of that name so assume it's more complex that that.

"
29. Probably wrong version of MaskTools. Try this one: