12-16-2018, 03:17 AM
|
|
Free Member
|
|
Join Date: Jul 2018
Location: Dallas, TX
Posts: 124
Thanked 12 Times in 9 Posts
|
|
Back in September, Sanlyn presented an AviSynth script that used RemoveDirtMC and ReplaceFramesMC2. The only thing I found for RemoveDirtMC was a Doom9 thread that had text for the plugin. I copied the text and put it in a file marked as avsi in the AviSynth plugin folder. I get a "there is no function "script error. What should I do?
I have the set of Lordsmurf's AviSynth plugins that have RemoveDirt, RemoveDirtS, and RemoveDirtSSE. Should I substitute one of these for RemoveDirtMC(40,false)?
I am not able to find anything on ReplaceFramesMC2 on the AviSynth wiki site. Any ideas what to do for it? It was setup as ReplaceFramesMC2(15,1).
Thanks,
Steve
|
Someday, 12:01 PM
|
|
Ads / Sponsors
|
|
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
|
|
|
12-16-2018, 03:41 AM
|
|
Site Staff | Video
|
|
Join Date: Dec 2002
Posts: 13,995
Thanked 2,542 Times in 2,161 Posts
|
|
Quote:
Originally Posted by stevevid
I have the set of Lordsmurf's AviSynth plugins that have RemoveDirt, RemoveDirtS, and RemoveDirtSSE. Should I substitute one of these for RemoveDirtMC(40,false)?
|
I have no idea, but no harm in trying.
See attachment. Do you already have those? No idea if it'll help, but surely can't hurt!
I know a lot about Avisynth, but realize there's almost an infinite number of scripts that can be written. I forget some things, and some things I never knew. I feel like I'm constantly learning new scripting, both from others, and from my own trials. Always to attack a specific problem.
|
12-16-2018, 03:48 AM
|
|
Site Staff | Video
|
|
Join Date: Dec 2002
Posts: 13,995
Thanked 2,542 Times in 2,161 Posts
|
|
ReplaceFramesMC2
from https://forum.doom9.org/showpost.php...6&postcount=14
Code:
# ######################################################################################################
#
# http://forum.videohelp.com/threads/353818-luma-error-on-VHS-restoration?p=2224484&viewfull=1#post2224484
#
# Note: This function was originally called "RX".
#
########################################################################################################
function ReplaceFramesMC2(clip Source, int N, int X)
{
# N is number of the 1st frame in Source that needs replacing.
# X is total number of frames to replace
# e.g. "RX(101, 5)" would replace 101,102,103,104,105, by using
# 100 and 106 as reference points for mflowfps interpolation.
start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point
end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point
start+end
AssumeFPS(1) #temporarily FPS=1 to use mflowfps
super = MSuper(pel=2, hpad=0, vpad=0, rfilter=4)
backward_1 = MAnalyse(super, chroma=false, isb=true, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
forward_1 = MAnalyse(super, chroma=false, isb=false, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, searchparam=1, search=3)
forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, searchparam=1, search=3)
backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, searchparam=0, search=3)
forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=4, searchparam=0, search=3)
MBlockFps(super, backward_3, forward_3, num=X+1, den=1, mode=0)
AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining
Trim(1, framecount-1) #trim ends, leaving replacement frames
Source.trim(0,-N) ++ last ++ Source.trim(N+X+1,0)
}
and the linked VH thread has this from jagabo:
from https://forum.videohelp.com/threads/...=1#post2224484
"Here's my current version of ReplaceFramesMC()"
Code:
function ReplaceFramesMC(clip Source, int N, int X)
{
# N is number of the 1st frame in Source that needs replacing.
# X is total number of frames to replace
#e.g. RX(101, 5) would replace 101,102,103,104,105 , by using 100 and 106 as reference points for mflowfps interpolation
start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point
end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point
start+end
AssumeFPS(1) #temporarily FPS=1 to use mflowfps
super = MSuper(pel=2, hpad=0, vpad=0, rfilter=4)
backward_1 = MAnalyse(super, chroma=false, isb=true, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
forward_1 = MAnalyse(super, chroma=false, isb=false, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, searchparam=1, search=3)
forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, searchparam=1, search=3)
backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, searchparam=0, search=3)
forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=4, searchparam=0, search=3)
MBlockFps(super, backward_3, forward_3, num=X+1, den=1, mode=0)
AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining
Trim(1, framecount-1) #trim ends, leaving replacement frames
Source.trim(0,-N) ++ last ++ Source.trim(N+X+1,0)
}
and while we're at it, see if this thread helps: https://forum.videohelp.com/threads/...MC#post2409705
... though it did not for me.
johnmeyer may be able to help, let me nudge him, see if he'll post here.
|
12-16-2018, 05:02 AM
|
|
Premium Member
|
|
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,319 Times in 989 Posts
|
|
Quote:
Originally Posted by stevevid
Back in September, Sanlyn presented an AviSynth script that used RemoveDirtMC and ReplaceFramesMC2. The only thing I found for RemoveDirtMC was a Doom9 thread that had text for the plugin. I copied the text and put it in a file marked as avsi in the AviSynth plugin folder. I get a "there is no function "script error. What should I do?
I have the set of Lordsmurf's AviSynth plugins that have RemoveDirt, RemoveDirtS, and RemoveDirtSSE. Should I substitute one of these for RemoveDirtMC(40,false)?
I am not able to find anything on ReplaceFramesMC2 on the AviSynth wiki site. Any ideas what to do for it? It was setup as ReplaceFramesMC2(15,1).
Thanks,
Steve
|
The history of dozens of versions of RemocveDirt xx is as long and convoluted as a Russian novel. The versions I used are cleaned-up copies from videohelp, whose origins are posted above by lordsmurf. Exact copies of what I used were posted earlier in digitalfaq:
RemoveDirtMC.avs: http://www.digitalfaq.com/forum/atta...emovedirtmcavs
Old VisualC++ system support files for Win7 and later (for RemoveDirt and several other Avisynth plugins: http://www.digitalfaq.com/forum/vide...s-running.html
The two plugin versions below were posted at digitalfaq in post #60 at the bottom of the page in the thread Help choosing the proper VHS capturing workflow?:
ReplaceframesMC.avsi: http://www.digitalfaq.com/forum/atta...ceframesmcavsi
ReplaceframesMC2.avsi: http://www.digitalfaq.com/forum/atta...eframesmc2avsi
Almost anything that has "MC" in its name will require the motion vector plugin MVTools2. It comes with QTGMC and several other complicated plugins, so if you have QTGMC and it's working, you have one of the later MVTools versions. A new MVTools2 comes out every 15 minutes (or so it seems). I update it every couple of years or so. Note that the latest incarnation of MVTools in the Avisynth wiki comes with a new version of the DePan motion tools. The new Depan tools will screw up every other Avisynth filter that uses it, so I'd stay away from it.
|
12-16-2018, 02:18 PM
|
|
Free Member
|
|
Join Date: Jul 2018
Location: Dallas, TX
Posts: 124
Thanked 12 Times in 9 Posts
|
|
Thank you for the feedback. I've been away from studying restoration approaches for a while. I captured all my VHS tapes, but switched to how to capture film in trying to get some done before Christmas. I've been through a variety of crash courses in optics, motor control, digital camera technology, etc while preparing to capture 8mm and 16mm film. My industrial camera alone came with an over 200 page manual. The camera is basically a computer in a very small 1" box. Well, the film capture turned out to be a bigger problem than I thought so I'm back to improving the bad film captures done by someone else and I'm working on my VHS captures.
The scripts I am referring to are in post 11 of http://www.digitalfaq.com/forum/vide...ermittent.html. So far, I've updated the script to point to my file and added LoadPlugin lines to add TIVTC and AutoAdjust from LordSmurf's plugin list (LordSmurf thank you for the plugins).
My AviSynth plugins folder already had the RemoveDirtMC.avs file from my work in September (thank you Sanlyn). The RemoveDirtMC text I downloaded from Doom9 and labeled as an avsi didn't work. I renamed the RemoveDirtMC.avs file from Sanlyn and it works--up to the point of needing RestoreMotionBlocks. Rats!
RestoreMotionBlocks: Doom9 says it's part of RemoveDirt. AviSynth wiki chart of filters says it's part of RemoveGrain--but it's not. Sorry to be a pain in the arse, but any thoughts where to get RestoreMotionBlocks? An internet search didn't point to a concrete place to find it, just references that it's part of RemoveDirt. It's actually just a function called in the RemoveDirt script.
Thank you very much,
Steve
|
12-16-2018, 05:51 PM
|
|
Premium Member
|
|
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,319 Times in 989 Posts
|
|
Every RemoveDirt variant I've seen has some form of a scripted "RemoveDirt" function inside of it. What none of them have is the compiled RemoveDirt .dll's. They are in RemoveDirt_v09.zip: http://www.digitalfaq.com/forum/atta...ovedirt_v09zip.
|
12-18-2018, 12:19 AM
|
|
Free Member
|
|
Join Date: Jul 2018
Location: Dallas, TX
Posts: 124
Thanked 12 Times in 9 Posts
|
|
Thank you! VDub is now happy. So RestoreMotionBlocks is inside the RemoveDirt dll -- true? RemoveDirtMC relies on RemoveDirt?
Would changing the RemoveDirt avs extension to avsi do the same thing as the Import function? I changed another item from your script from avs to avsi and VDub accepted it.
Lordsmurf, thanks for the ReplaceFrames info.
Man, I am constantly amazed that you guys can respond so often and quickly to questions. I'm also amazed you have kept your sanity with the huge number of plugins and their multitude of versions. (am I assuming too much on the sanity comment )
Steve
|
12-18-2018, 04:57 AM
|
|
Premium Member
|
|
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,319 Times in 989 Posts
|
|
Quote:
Originally Posted by stevevid
Would changing the RemoveDirt avs extension to avsi do the same thing as the Import function? I changed another item from your script from avs to avsi and VDub accepted it.
|
Changing avs to avsi makes no change in the text coding. The only change is that avsi is automatically imported. But with this series of RemoveDirt plugins there is a "RemoveDirt' function inside the code, and each version of the internal "RemoveDirt" function would get imported: the problem is that other complex plugins have their own versions of internal "RemoveDirt" functions. The problem with the original RemoveDirt was that it requires a .dll called RemoveDirt that comes in only one unchanging version, but anybody and his brother was writing different text functions also called "RemoveDirt". When you have a dozen different versions with the same name, an auto-loading avsi can cause problems if two different plugins call up two different versions of the same text function at the same time.
A few years ago someone at doom9 posted a collection of 6 different plugins called RemoveDirt mod, RemoveDirt MC, RemoveDirt MC2, and so forth, all needing the same .dll but all using a different internal text function called "RemoveDirt". Needless to say, all 6 versions were .avs files, not .avsi.
There are also 4 or 5 different .avs versions of a plugin called RemoveSpots, with different names but with a text version of "RemoveDirt" inside each one. Some even have a different version of a text function called "RemoveSpots" inside !!!
Quote:
Originally Posted by stevevid
I'm also amazed you have kept your sanity with the huge number of plugins and their multitude of versions. (am I assuming too much on the sanity comment )
|
Yes, that's assuming a lot, LOL!
|
12-18-2018, 06:05 AM
|
|
Site Staff | Video
|
|
Join Date: Dec 2002
Posts: 13,995
Thanked 2,542 Times in 2,161 Posts
|
|
Quote:
Originally Posted by stevevid
I'm also amazed you have kept your sanity with {VIDEO} ... (am I assuming too much on the sanity comment )
|
Lately .... yeah. No comment.
There have been times where I wanted time scream into a pillow.
|
12-18-2018, 04:34 PM
|
|
Free Member
|
|
Join Date: Jul 2018
Location: Dallas, TX
Posts: 124
Thanked 12 Times in 9 Posts
|
|
There have been times when I did scream into a pillow. Even times without the pillow.
|
04-24-2023, 01:29 PM
|
|
Free Member
|
|
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 30 Times in 26 Posts
|
|
Sorry for the resurrection (it's still April), but I came across this thread and noticed that the ReplaceFramesMC() code listed does not maintain the audio of the area interpolated. I have been using a different version where I incorporated AudioDub into the function to save time. Hopes it helps.
Code:
# ########################################################################################################
#
# per jagabo:
# http://forum.videohelp.com/threads/353818-luma-error-on-VHS-restoration?p=2224484&viewfull=1#post2224484
#
# Note: This function was originally called "RX".
#
# ########################################################################################################
function ReplaceFramesMC2_AD(clip Source, int N, int X)
{
# N is number of the 1st frame in Source that needs replacing.
# X is total number of frames to replace
# e.g. "RX(101, 5)" would replace 101,102,103,104,105, by using
# 100 and 106 as reference points for mflowfps interpolation.
sound = Source
start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point
end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point
start+end
AssumeFPS(1) #temporarily FPS=1 to use mflowfps
super = MSuper(pel=2, hpad=0, vpad=0, rfilter=4)
backward_1 = MAnalyse(super, chroma=false, isb=true, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
forward_1 = MAnalyse(super, chroma=false, isb=false, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, searchparam=1, search=3)
forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, searchparam=1, search=3)
backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, searchparam=0, search=3)
forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=4, searchparam=0, search=3)
MBlockFps(super, backward_3, forward_3, num=X+1, den=1, mode=0)
AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining
Trim(1, framecount-1) #trim ends, leaving replacement frames
new_clip = Source.trim(0,-N) ++ last ++ Source.trim(N+X+1,0)
new_clip_with_sound = AudioDub(new_clip, sound)
return new_clip_with_sound
}
|
All times are GMT -5. The time now is 10:33 PM
|