How to remove horizontal lines caused by damaged tape? - digitalFAQ Forum
 Forum How to remove horizontal lines caused by damaged tape?
 Ask Question Join / Register FAQ Search Today's Posts Mark Forums Read

#1
05-27-2018, 05:35 AM
 spanak Free Member Join Date: Sep 2017 Location: Blugaria Posts: 23 Thanked 4 Times in 3 Posts
I am trying to figure out if it is possible to restore a video having horizontal lines. I am not sure if this called jitter or not. Check out the attached samples. The first ones is what comes out of the VCR, the second one is corrected with a Panasonic DMR-ES 10.

I know these lines occur due to tape damage, because I can hear the tape rattle inside the VCR when they appear. Some of the tapes were captured "professionally" some 15 years ago, and I can see the same on the copies, so it is definitely a tape problem.

I've tried to use DeVCR for Avisynth, but I did absolutely nothing. I have also tried to use some other scripts that I found on the Internet, but they depend on RemoveSpotsMC, and I couldn't find a working version of this script. Where do you guys get it from? Also, where do I find its dependencies?

And, final and most important - is it possible to fix this kind of error?

Attached Files
Someday, 12:01 PM
 Ads / Sponsors Join Date: ∞ Posts: 42 Thanks: ∞ Thanked 42 Times in 42 Posts
#2
05-27-2018, 10:43 AM
 themaster1 Free Member Join Date: Feb 2011 Posts: 262 Thanked 58 Times in 47 Posts
One of your best bet is this script (it's the same script i have posted here slightly tweaked. But even with that script that'll not be enough

Code:
avisource()
assumetff()
converttoyv12(interlaced=true)
separatefields()
#DeGrainMedian(limitY=0,limitUV=220,mode=3,norow=true,interlaced=true)
a=last
#clense(reduceflicker=false).merge(last,0.5).clense(reduceflicker=false)
mot=removegrain(8,0).DepanEstimate(range=2)
take2=a.depaninterleave(mot,prev=2,next=2,subpixel=2)
clean1=take2.DeGrainMedian(limitY=255,limitUV=255,mode=5,norow=true,interlaced=false).selectevery(5,2)

sup1 = clean1.minblur(1).removegrain(11,0)
\           .mt_lutxy(clean1,"x 1 + y < x 2 + x 1 - y > x 2 - y ? ?",U=2,V=2)
\           .msuper(pel=2,sharp=0)
sup2 = a.msuper(pel=2,levels=1,sharp=2)
###### Good mvtools values, Do not change, checked##########
bv22=sup1.manalyse(isb=true, truemotion=true,global=true,delta=2,blksize=16,overlap=8,search=5,searchparam=4,DCT=5)
bv21=sup1.manalyse(isb=true, truemotion=true,global=true,delta=1,blksize=16,overlap=8,search=5,searchparam=4,DCT=5)
fv21=sup1.manalyse(isb=false,truemotion=true,global=true,delta=1,blksize=16,overlap=8,search=5,searchparam=4,DCT=5)
fv22=sup1.manalyse(isb=false,truemotion=true,global=true,delta=2,blksize=16,overlap=8,search=5,searchparam=4,DCT=5)

interleave(a.mcompensate(sup2,fv22),a.mcompensate(sup2,fv21),a,a.mcompensate(sup2,bv21),a.mcompensate(sup2,bv22))
mergeluma(TMedian2(),0.9).mergechroma(TMedian2(),1).selectevery(5,2)

sup3 = last.msuper(pel=2,sharp=2)
bv33=sup3.manalyse(isb=true, truemotion=true,global=true,delta=3,blksize=8,overlap=4,search=5,searchparam=4,DCT=5)
bv32=sup3.manalyse(isb=true, truemotion=true,global=true,delta=2,blksize=8,overlap=4,search=5,searchparam=4,DCT=5)
bv31=sup3.manalyse(isb=true, truemotion=true,global=true,delta=1,blksize=8,overlap=4,search=5,searchparam=4,DCT=5)
fv31=sup3.manalyse(isb=false,truemotion=true,global=true,delta=1,blksize=8,overlap=4,search=5,searchparam=4,DCT=5)
fv32=sup3.manalyse(isb=false,truemotion=true,global=true,delta=2,blksize=8,overlap=4,search=5,searchparam=4,DCT=5)
fv33=sup3.manalyse(isb=false,truemotion=true,global=true,delta=3,blksize=8,overlap=4,search=5,searchparam=4,DCT=5)
last
weave()

#################################################################
function EdgeCleaner(clip c, float "strength", bool "rep", int "rmode", int "smode", bool "hot", bool "fix") {

strength    = default(strength, 8.0)
rep         = default(rep, true)
rmode       = default(rmode, 17)
smode       = default(smode, 0)
hot         = default(hot, false)
fix         = default(fix, true)

c           = (c.isYV12()) ? c : c.ConvertToYV12()
strength    = (smode==0) ? strength : strength+4

main        = c.aWarpSharp(strength,1)
main        = (rep) ? Repair(main,c,rmode) : main

final       = (fix) ? Overlay(final,c.ConvertToRGB24().Crop(0,1,-c.width+1,-c.height+2),x=0,y=1) : final
final       = (smode != 0) ? mt_merge(final,c,c.StarMask(smode)) : final

return final

}

function StarMask(clip c, int "mode") {

mode        = default(mode, 1)

clean       = (mode==1) ? c.RemoveGrain(17) : Repair(c.Deen("a3d",4,12,0),c,15).RemoveGrain(21)
diff        = (mode==1) ? mt_makediff(c,clean) : NOP

final       = (mode==1) ? diff.Greyscale().Levels(40,0.350,168,0,255).removegrain(7,-1).mt_edge("prewitt",4,16,4,16) : \
Subtract(mt_merge(clean,c,c.mt_edge("roberts",0,2,0,2).mt_expand(mode=mt_circle(1)).mt_invert()),c).mt_edge("roberts",0,0,0,0).mt_deflate()

return final

}

function MinBlur(clip clp, int r, int "uv")
{
uv   = default(uv,3)
uv2  = (uv==2) ? 1 : uv
rg4  = (uv==3) ? 4 : -1
rg11 = (uv==3) ? 11 : -1
rg20 = (uv==3) ? 20 : -1
medf = (uv==3) ? 1 : -200

RG11D = (r==0) ? mt_makediff(clp,clp.sbr(),U=uv2,V=uv2)
\    : (r==1) ? mt_makediff(clp,clp.removegrain(11,rg11),U=uv2,V=uv2)
\    : (r==2) ? mt_makediff(clp,clp.removegrain(11,rg11).removegrain(20,rg20),U=uv2,V=uv2)
\    :          mt_makediff(clp,clp.removegrain(11,rg11).removegrain(20,rg20).removegrain(20,rg20),U=uv2,V=uv2)
RG4D  = (r<=1) ? mt_makediff(clp,clp.removegrain(4,rg4),U=uv2,V=uv2)
\    : (r==2) ? mt_makediff(clp,clp.medianblur(2,2*medf,2*medf),U=uv2,V=uv2)
\    :          mt_makediff(clp,clp.medianblur(3,3*medf,3*medf),U=uv2,V=uv2)
DD    = mt_lutxy(RG11D,RG4D,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?",U=uv2,V=uv2)
clp.mt_makediff(DD,U=uv,V=uv)
return(last)
}

# median of 5 clips from Helpers.avs by G-force
Function Median2(clip "input_1", clip "input_2", clip "input_3", clip "input_4", clip "input_5", string "chroma")
{
chroma = default(chroma,"process") #default is "process". Alternates: "copy first" or "copy second"
#MEDIAN(i1,i3,i5)
Interleave(input_1,input_3,input_5)
chroma == "process" ? Clense(reduceflicker=false) : Clense(reduceflicker=false,grey=true)
m1 = selectevery(3,1)
#MAX(MIN(i1,i3,i5),i2)
m2  = input_1.MT_Logic(input_3,"min",chroma=chroma).MT_Logic(input_5,"min",chroma=chroma).MT_Logic(input_2,"max",chroma=chroma)
#MIN(MAX(i1,i3,i5),i4)
m3  = input_1.MT_Logic(input_3,"max",chroma=chroma).MT_Logic(input_5,"max",chroma=chroma).MT_Logic(input_4,"min",chroma=chroma)
Interleave(m1,m2,m3)
chroma == "process" ? Clense(reduceflicker=false) : Clense(reduceflicker=false,grey=true)
selectevery(3,1)
chroma == "copy first" ? last.MergeChroma(input_1) : chroma == "copy second" ? last.MergeChroma(input_2) : last
ConverttoRGB32(matrix="rec601",interlaced=false)
CCD(7,1) # de 0 à 100 # Défaut =30 /
converttoyv12(matrix="rec601",interlaced=false)
Return(last)
}

function TMedian2(clip c) {
Median2( c.selectevery(1,-2), c.selectevery(1,-1), c, c.selectevery(1,1), c.selectevery(1,2) ) }

function RemoveDirt(clip input, int limit, bool _grey)
{
clensed=input.Clense(grey=_grey, cache=4)
alt=input.RemoveGrain(2)
return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,dmode=2,debug=false,noise=limit,noisy=4, grey=_grey)

# Alternative settings
# return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=4,cthreshold=6, gmthreshold=40,dist=1,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=true)
# return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,tolerance= 12,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=false)
}
#3
05-27-2018, 04:56 PM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,259 Times in 970 Posts
Thanks for the samples.

Quote:
 Originally Posted by spanak I am trying to figure out if it is possible to restore a video having horizontal lines. I am not sure if this called jitter or not.
The horizontal lines are called dropouts, or rips. Sometimes these things can be fixed completely, but most of the time you can get only a partial fix or none at all. The worst of them involves dropouts that persist in the same place for a long string of consecutive frames (in this case, one series of dropouts remained in the same place for over 20 frames). Anything that looks "the same" for that many frames isn't interpreted as noise -- and even if did look like noise to a filter, the filter has no good frame in the series from which to draw valid data for repairing the bad guys. So if a filter uses averaging techniques to clean those long rips, you end up with what will be the "average noise" in those frames. In this case the filters I used didn't work 100% (they can't), but it made things tolerably viewable IMO.

Quote:
 Originally Posted by spanak I know these lines occur due to tape damage, because I can hear the tape rattle inside the VCR when they appear.
Tape rattle indicates very severe damage. It also indicates that tape motion from the feed reel is uneven. Sometimes this can be improved by repacking the tape, which people have been doing for many years with some success. Repacking means to fast-forward without playing to the end of the tape, then fast rewind without playing to the beginning again. This might have to be repeated a time or two. The idea is to smooth the tape windings on the feed reel so that there are fewer bumps and ridges in the windings. Let the tape rest overnight to allow its natural elasticity to flatten out a few things. Then try capturing again.

And just a note: a tbc can't prevent dropouts as extensive as these.

Quote:
 Originally Posted by spanak I've tried to use DeVCR for Avisynth, but I did absolutely nothing. I have also tried to use some other scripts that I found on the Internet, but they depend on RemoveSpotsMC, and I couldn't find a working version of this script. Where do you guys get it from? Also, where do I find its dependencies?
Ah, good ole DeVCR. Haven't seen that in a while. It was designed for problems far less severe than those at hand, so no surprise.

I used a combination of a median averaging routine called FixRipsP2 that was posted by poisondeathray some time ago, followed by RemoveDirtMC to help clean up some dropout remnants. They aren't 100% effective, but at least you have some video left to watch. Much of the time with many recent submissions, the damage is so severe that all that's left from using these two filters is bizarre distortion that looks worse than the original.

Quote:
 Originally Posted by spanak is it possible to fix this kind of error?
It's possible, but only up to a point, as explained earlier. We've seen quite a large number of similar tapes recently. Many were simply hopeless.

First, RemoveDirtMC.avs and dependencies: There are several versions of it as .avs scripts. The one I'm linking to is the one I used and is the version I've seen used most often, appearing originally in Doom9 as part of a series: http://www.digitalfaq.com/forum/atta...emovedirtmcavs. You could make it an .avsi instead of .avs, but it includes its own persnickety version of the original RemoveDirt inside and might interfere with other RemoveDirt routines if it loads as an automatic .avsi. So most people keep it saved as .avs and import it explicitly using the Import() function.

If you are using Windows 7 or later, you might need two Visual C++ runtime support dll's that Microsoft with their expertise in designing for outright obsolescence didn't include with Windows7 or later: msvcp71.dll and msvcr71.dll. In 64-bit Windows they should be in the SYSWOW64 folder (they are 32-bit dll's). In a 32-bit system they'll be in System32. Here's a link to a post explaining it all and providing the sources: Fix for problems running Avisynth's RemoveDirtMC
The post also has attachments for the required RemoveDirt_v0.9 dll's, as well as RemoveGrain_v1.0.

The script also uses the FixRipsP2.avs plugin, previously posted here: http://www.digitalfaq.com/forum/atta...d-fixripsp2avs.

Requires DeFlicker.dll http://avisynth.org.ru/deflicker/deflicker04.zip
Requires DeSpot.dll http://avisynth.org.ru/despot/despot3610.zip
For the filter's median averaging you will need 32-but dll's for DePan tools version 1.13.1 and DePanEstimate version 1.10. These two specialized functions also require the FFTW library version 3.

If you already have QTGMC or FFT3D filter installed on your PC, you already have the FFTW library files. This involves two files: FFTW3.dll and libfftw3f-3.dll. If you don't have these, get FFTW3.dll at ftp://ftp.fftw.org/pub/fftw/fftw3win32mingw.zip. Unzip that file and do this:
(a) In the unzip'd files, find FFTW3.dll
(b) Make an exact copy of the FFTW3.dll file, and rename the copy as libfftw3f-3.dll.
If you think this means you will have two copies of the same .dll using two different names, you're correct.
(c) Copy FFTW3.dll and libfftw3f-3.dll into C:\Windows\SYSWOW64.

The FFTW3 library files are NOT Avisynth filters. They are Windows 32-bit system files. Do not put FFTW3 or libfftw3f-3 in your Avisynth plugins folder.

Another filter used in the script, and in a great many scripts you'll see on the uintenet6, is LimitedSharpenFaster. Get it here: http://www.digitalfaq.com/forum/atta...arpenfasterzip.
Requires RgTools: http://avisynth.nl/index.php/RgTools
Requires MS Visual C++ 2015 runtime, linked on the RGTools wiki page at above website.
Requires aWarpSharp: aWarpSharp2_2015.zip

While you're at it, you might check your Installed Programs in Control Panel to see if you have the following Microsoft Visual c++ Runtime redistributables in the installed software listing (a lot of Avisynth filters use these msvcrt*.dll files):

2005 https://www.microsoft.com/en-us/down...s.aspx?id=3387
2008 https://www.microsoft.com/en-us/down...ils.aspx?id=29
2010 https://www.microsoft.com/en-us/down...s.aspx?id=5555
2012 https://www.microsoft.com/en-us/down....aspx?id=30679
2013 https://www.microsoft.com/en-us/down....aspx?id=40784
2015 https://www.microsoft.com/en-us/down....aspx?id=48145

Attached is an mpg sample (Panny_sample_for_DVD.mpg) encoded for DVD (no audio). Below is the script I used to create the file:

Code:
Import("Drive:\path\to\Avisynth\plugins\FixRipsp2.avs")
Import("Drive:\path\to\Avisynth\plugins\RemoveDirtMC.avs")
Import("Drive:\path\to\Avisynth\plugins\LimitedSharpenFaster.avs")

AviSource("Drive:\path\to\ivica-panasonic-crop.avi")
ConvertToYV12(interlaced=true)
SeparateFields()
e=SelectEven().FixRipsp2.RemoveDirtMC(50,false)
o=SelectOdd().FixRipsp2.RemoveDirtMC(50,false)
Interleave(e,o)
LimitedSharpenFaster()
Weave()
ConvertToRGB32(interlaced=true,matrix="Rec601")  ## <- for VirtualDub filters
return last
I also used a couple of Virtualdub color controls to tweak the image. Color is a personal preference thing, but if you want to use the settings I used, the two filters are ColorMill and gradation curves. You can download those filters plus two more in the zip file at http://www.digitalfaq.com/forum/atta...dubfilters4zip.

To load those two filters with the same settings I used, see the attached .vcf VirtualDub settings file, panny_VDub_filers.vcf. Save the .vcf anywhere you want (not in your plugins folder). Load it when running the Avisynth script by clicking "File..." -> "Load Processing settings", find the .vcf and click Open or OK. It will load the two filters in the order I used them and with the same settings. A .vcf is plain text if you want to read it with Notepad. The two filters must be in your VirtualDub plugin folder.

Let us know if any problems....

Attached Files
#4
05-28-2018, 03:27 AM
 spanak Free Member Join Date: Sep 2017 Location: Blugaria Posts: 23 Thanked 4 Times in 3 Posts
Ah, now I remember one of the main reasons I stopped using Windows - it is so complicated to install software.

sanlyn, I am using Windows XP in a virtual machine. I am unsure why you assumed it is Windows 7. Anyway, I would like to back it up before putting .dll files in system directories... just in case.

As for the defect, you only confirmed what I suspected. I'll give both scripts a try, but I'll keep an untouched capture master in case better restoration techniques become available in the future.

The colors... I would try to make the room even less yellow, if possible. Also, the contrast between black and white makes everything too sharp to my eyes, so I may dim the bright colors slightly. Honestly, I am not sure yet. I haven't gotten to that point.

Quote:
 Repacking means to fast-forward without playing to the end of the tape, then fast rewind without playing to the beginning again. This might have to be repeated a time or two. The idea is to smooth the tape windings on the feed reel so that there are fewer bumps and ridges in the windings. Let the tape rest overnight to allow its natural elasticity to flatten out a few things. Then try capturing again.
So I did before capturing what you are seeing here. I already read about repacking in another thread. Nevertheless, this is the result after rewinding twice. And to make things even worse, these are VHS-Cs. C'est la vie.

themaster1, your script contains unused functions - RemoveDirt(), EdgeCleaner(), StarMask() (this one is used only in EdgeCleaner()). I'll take them away, to simplify the script. Or, am I missing something?

In the end, thanks so much, both of you. I need a couple of days to go through everything. I'll get back to you if I run into problems.
#5
05-28-2018, 03:43 AM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,259 Times in 970 Posts
Quote:
 Originally Posted by spanak sanlyn, I am using Windows XP in a virtual machine. I am unsure why you assumed it is Windows 7. Anyway, I would like to back it up before putting .dll files in system directories... just in case.
If you have XP, you very likely have the two older runtime dll's already. They are automatically installed in XP with early .NET updates.

Meanwhile I checked my links to newer runtimes 2005-2015 from the Microsoft download sites, and Microsoft seems to be having display problems. Either it's their problem or all 3 of my web browsers have developed heartburn at MS support sites. I'll check them again later.

[EDIT]
I forgot.....
There is also a popular RemoveDirtMC2.avs, posted earlier: http://www.digitalfaq.com/forum/atta...movedirtmc2avs. It is very similar to the version referenced earlier. Some say MC2 is faster (I never noticed any difference, really) but slightly more effective with dropouts and spots. I can't say. I haven't got around to counting and comparing spots.

RemoveDirtMC2 requires two additional support plugins, if you don't already have them:
FluxSmooth.dll (http://avisynth.nl/index.php/FluxSmooth)
VagueDenoiser.dll (https://avisynth.org.ru/vague/vaguedenoiser0351.zip)

Most people download Avisynth plugins to new folders somewhere, unzip the contents, and copy just the plugin into their plugins folder.

Last edited by sanlyn; 05-28-2018 at 03:56 AM.
#6
05-28-2018, 03:17 PM
 keaton Premium Member Join Date: Jan 2017 Location: USA Posts: 147 Thanked 68 Times in 48 Posts
First, thank you so much sanlyn for providing a simple and straightforward setup guide for what looks to be a very detailed chain of filters!

Sorry if I am hijacking, but I am trying to run the script (using RemoveDirtMC) shown by sanlyn in post #3. I think I have carefully followed all the setup instructions from post #3. I get a script error when "e=SelectEven().FixRipsp2.RemoveDirtMC(50,fals e)" is called about no MT_Logic function (it is called from line 69 of FixRipsp2.avs). I assume that is from mask tools. I have placed dll from both MaskTools-v1.5.8 and masktools2-v2.2.14 in avisynth plugin folder.

I have a 32-bit XP SP2 machine with Visual C++ 2008 runtime installed (I assume I cannot go to 2015 for XP, and not sure if I can or need to try something newer), using avisynth 2.6.0 and VirtualDub 1.9.11 + Filters package from this site. I tried both the "with_dual_filter_signatures" and normal versions of masktools2.dll for x86_xp. I do not have QTGMC installed, so I created FFTW3.dll and libfftw3f-3.dll in C:\Windows\System32 folder from fftw3win32mingw.zip.

Attached are screen captures of avs error chain and contents of my Avisynth plugin folder.

I hope you can help with what I might be missing. This seems like an incredibly useful tool, and am curious to see what it can do. Again, thanks so much for such a concise breakdown of all the details required for this.

Attached Images
#7
05-28-2018, 07:52 PM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,259 Times in 970 Posts
According to your image of the error message, a call to mt_logic occurs on lines 69, 80, and 9. But in the original script for RemoveDirtMC, mt_logic appears only on lines 69 and 71. It's possible that you have a corrupt copy of the avs plugin...or, if you have viewed the avs script in Notepad while the "Format" menu item had "Word Wrap" turned on, and perhaps saved the file in that condition, the script would be compromised. I've attached a new copy of FixRipsP2.avs.

MT_Logic is a function inside MaskTools v2. It doesn't appear in MaskTools 1.5.8. It's possible that having both versions of MaskTools in your plugins folder it's causing a conflict -- but that's unusual, since many users have both versions of masktools stacked together. Still, in the chance that a conflict does exist, you can create another plugin folder in the Avisynth folder (call it "plugins_old"), move the older MaskTools.dll into that folder, and keep MaskTools2.dll in the official plugins folder.

The 2015 VisualC++ runtime files are required for several popular Avisynth plugins. XP with ServicePack 3 is required. XP Service Pack 3 is also required for many antivirus programs. I'm afraid I'm not in tune with some old wives' tales about Service Pack 3. I've been using it for 5 years on 3 copies of XP.

Attached Files
#8
05-29-2018, 08:59 PM
 keaton Premium Member Join Date: Jan 2017 Location: USA Posts: 147 Thanked 68 Times in 48 Posts
Thank you for your help sanlyn. I did have the FixripsP2.avs you attached. The line numbers are correct for the call chain, however line 80 is calling Median2, which then calls MT_Logic. So the error messages are not accurate for line 80. I acknowledge that I will run into other problems with Visual C++ not being at 2015. I have other copies of XP I can use.

However, my first point of failure is much more basic. I cannot run awarpsharp2() function either, and I have that DLL from following your instructions in Post #3. I get the same function not found error for that. This must be the first time I have tried something in avisynth script that relies on a DLL function call from an avs file. I must have something very fundamental not configured correctly to autoload DLLs from the avisynth plugin folder, when I open a .avs file in Virtualdub (or maybe it's an AviSynth configuration thing).

I think I have officially hijacked this thread, so I can create a new thread if needed. I would appreciate a link to the basics on this topic, as I need to start from square 1 evidently. I tried a forum search on "avisynth dll plugin load", but didn't find anything obvious. I only spent a couple minutes, it's getting late. I may just be lazy, and I apologize if there is an obvious spot on the forum that can explain this. I guess I just installed avisynth and got it working with virtualdub, but have only been using built in functionality to this point. Whatever I had read to get that far has been forgotten, and don't recall if I skipped something in the setup for DLLs.

#9
05-29-2018, 09:53 PM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,259 Times in 970 Posts
You seem to be having problems with Avisynth plugins that are in popular use and have been in circulation for for a long time. I suspect there are files in your plugins folder that shouldn't be there. If you are mixing 32-bit and 64-bit versions of filters, you'll definitely get error messages. When you download a compressed avisynth plugins package, you should never decompress the compressed package into your plugins folder -- always download plugins to a separate folder that you create for each plugin, then copy only the appropriate dll, avs, or avsi file into your plugins folder.

You mighht have unistall and re-install Avisynth, but before you uninstall, save a copy of the entire plugins folder so that you can go through later and pick out only the filter files that you need. The uninstaller does not delete the plugins folder or subfolders in the main Avisynth program folder. The uninstaller deletes only registry entries.
#10
05-31-2018, 10:15 PM
 keaton Premium Member Join Date: Jan 2017 Location: USA Posts: 147 Thanked 68 Times in 48 Posts
Just to close the loop on this, and for anyone that may have had one of these issues...

Once I installed the Visual C++ libraries 2008, 2010, 2012, 2013, and 2015 in XP SP3, I had one error remaining. The msuper function was not found. Resolved this by getting the latest mvtools2.dll from http://avisynth.nl/index.php/MVTools (which linked to http://www.avisynth.nl/users/fizick/...v2.5.11.22.zip) and copying those to plugins folder.

My big issue was understanding the fundamental principle of when AviSynth says things like no function found or failed to load dll, it can be because other dlls are required which it will not mention. As sanlyn eluded to in earlier post, these avisynth dlls can rely on Visual C++ libraries.

This is an incredible amount of processing going on in this chain of filters. I am in awe of the time and energy that must have gone into all of the pieces, as well as deriving the chain itself. Next I will have to see some output from this and prepare to be in awe once again, standing on the shoulders of possibly hundreds of people before me who made this final result possible.
 The following users thank keaton for this useful post: msgohan (01-20-2020), sanlyn (06-01-2018)
#11
06-01-2018, 02:13 AM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,259 Times in 970 Posts
A well-stated post and worth heeding. Avisynth can affect some marvelous results, but you do have to coddle it and stop trying to fight City Hall. It is what it is. Despite its headaches I'm glad it's out there.
#12
06-02-2018, 03:39 PM
 keaton Premium Member Join Date: Jan 2017 Location: USA Posts: 147 Thanked 68 Times in 48 Posts
I ran RemoveDirtMC on a clip with some dropouts and some color glitches on either the even or odd field lines in part of a frame. I was amazed to see them all disappear. Also my first experience with seeing so much of the general grain or fuzz or noise or whatever you call it that appears from a source like VHS being scrubbed away. It was a bit shocking at first to see things look so much smoother. Still not certain how I feel about it. It certainly saves the energy of cleaning up imperfections from capture like dropout or other row glitches by manipulating rows/frames manually in avisynth (which I have had decent success with in many cases, but can get rather tedious). However, the rest of the image is along for the ride and is dramatically altered as well.

This video also has a camcorder time code on it. Unfortunately, this chain filters does not agree with this when there's enough motion or some complex image passing across it, The time code is no longer static in the image. For lack of a better term, the time code is rather glitchy at times. Sometimes, it seems like the time code is jumping around a bit, or parts of it fade in and out. So, unfortunately, the glitchy time code becomes a bigger distraction than anything I was trying to correct

It would seem inadvisable to try combining frames that don't pass through this chain with those that have, because the look is so dramatically different.

From what I've read on this forum, there is no plausible method to remove the time code. So, are there any other approaches one can take for correcting dropouts, glitches, noise, etc. (sorry that's an awfully big umbrella) that would behave better when dealing with static portions of video like a time code or a broadcast logo? Or is it just a limitation that when you have a static image on the video that filter chains like these are likely to cause issues? If there are some alternatives, no need to repeat them here. A link to other threads showing the filter chain/scripting would suffice.
#13
06-02-2018, 10:13 PM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,259 Times in 970 Posts
You can try using various logo removers. They all work pretty much the same way, which means they all work with the same defects, artifacts, and remnants.

Filters like the median filter FixcRispP2 and high values of RemoveDirtMC (and RemoveSpotsMC) literally rearrange large groups of pixels, put don't always put them back perfectly. Sometimes there are ways around it by using patched sections of image portions overlaid onto the final results, sometimes experimentation with various deinterlace schemes can make the difference. It would take a piece of the original video to test different methods.
#14
06-04-2018, 02:57 AM
 spanak Free Member Join Date: Sep 2017 Location: Blugaria Posts: 23 Thanked 4 Times in 3 Posts
After installing all Visual C++ redistributables and .dll as described by sanlyn and keaton, I have finally managed to try out avisynth.

As keaton pointed out, avisynth will complain about functions not being defined even if their script/dll is there and it can be imported. The reason is one or more of its dependencies is missing. Go figure. I would have never been able to debug it on my own.

If setting up avisynth to run one script is so overcomplicated, isn't it worth writing a guide? Isn't it worth putting a plugin pack ready for download and run like there is one for VirtualDub? Even this thread is a great starting point. Forum admins can make it sticky, so it can be easily found by new users like me.

Now, as for the results. I think it is worth using the scripts here, but only to fix short scenes with a lot of dropouts. I would definitely not run an entire video through theses filters. Short defects of around 1-2 frames, or small ones that do not cause half the picture to tear, are actually better handled by Panasonic's TBC, which is what I will use instead.

Again, I would like to thank everyone again! All posts have been very helpful. Cheers, folks!
#15
06-04-2018, 04:41 AM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,259 Times in 970 Posts
I agree, a complete guide to Avisynth setup would be a godsend but it doesn't exist. I wonder if its possible. Fortunately the requirements for individual plugins are documented much better than they were only a couple of years ago, when much detail about even simple filters was nonexistent. The only problem with the supplied information is that so few users bother to look at it.

Luckily you've discovered early on that the same filters or same settings can't be used for every part of an entire video project. If only it were that easy!

 Similar Threads Thread Thread Starter Forum Replies Last Post Mr_James Restore, Filter, Improve Quality 6 06-20-2018 03:28 PM ehbowen Video Hardware Repair 3 04-13-2018 11:58 PM xrodney Video Hardware Repair 7 01-12-2017 12:33 PM Turok81 Capture, Record, Transfer 8 11-27-2016 08:25 PM kpmedia Computers 1 10-07-2011 05:32 PM