View Single Post
Old 15th April 2021, 03:22   #2  |  Link
patul
Registered User
 
Join Date: Sep 2005
Posts: 130
You should use x64 plugins on Avisynth+ x64 (although there's a way to use 32bit plugins using mp_pipeline) and vice versa.

RemoveGrain is now part of RgTools.dll
Download RgTools x64 from pinterf's repository . I suggest you update all of required plugins as well (mvtools2, masktools2, depan, depanestimate etc), you can find the updated plugins in the same repository.

For LSFmod, you need to download avsi script and import it to the script
(see real_finder's repository, you'll need to download and import Zs_RF_Shared.avsi as well from the same repository).

Remove (comment out) all of the occurrences of SetMemoryMax, SetMTMode in your script.

PHP Code:
#Import("D:\App\AVS\plugins64+\source script2 Dr Paulo Pirej.avs")
# Plugins: - RemoveGrain
# - MaskTools2
# - Depan + DepanEstimate
# - MVTools2

#SetMemoryMax(512)
#SetMTMode(3)

#LoadPlugin("D:\App\AVS\plugins64+\RemoveGrain.dll")
LoadPlugin("D:\App\AVS\plugins64+\MaskTools2.dll")
LoadPlugin("D:\App\AVS\plugins64+\Depan.dll")
LoadPlugin("D:\App\AVS\plugins64+\DepanEstimate.dll")
LoadPlugin("D:\App\AVS\plugins64+\MVTools2.dll")
LoadPlugin("D:\App\AVS\plugins64+\LSMASHSource.dll")
LoadPlugin("D:\App\AVS\plugins64+\RgTools.dll")
Import("D:\App\AVS\avsi\Zs_RF_Shared.avsi")
Import("D:\App\AVS\avsi\LSFMod.avsi")

#mpeg2source("M:\Marcelo 27.5.20\1\01\01-1.d2v")
#mpeg2source("M:\Marcelo 999255703 - Fazer\01 ok 19m.d2v")
#DirectShowSource("M:\Flavio Itapema 4.11.20 Fazer\02 FI 4capt PanLG.mp4", fps = 25, ConvertFPS = True )
LSmashAudioSource("D:\App\youtubedl\Video.mp4")
LSmashVideoSource("D:\App\youtubedl\Video.mp4")
AudioDub(v,a)
#DirectShowSource("M:\Luis Tonini 14.1.20 - Fazer\01 V14ES10 e.mp4")
#DirectShowSource("E:\Tereza Soares 13.8.20 - Fazer\01 TS 8capt V17JVCES10.mp4", fps = 25, ConvertFPS = True ) # para AVI encapsulado AVI Xvid da Avermidia ou MP4 da Aple
#DirectShowSource("M:\Neogrid 5-10-17\090 4capt V13SVSDV.avi", fps = 25, ConvertFPS = True ) # para AVI encapsulado AVI Xvid da Avermidia
#AVISource("E:\Cleiton\Super 8mm\03\03 ok.avi") 
#AVISource("E:\Luiz Itapema 23.9.20 - Fazer\18 LI SD8.avi", audio=true)
#AVISource("E:\Luiz Itapema 23.9.20 - Fazer\18 LI SD8.avi") # DV AVI
#AVISource("M:\Pedro 31-7-18\25 8capt V15ES10SDV.avi", audio=true)


#SetMTMode(2)
#ConvertToYV12()
#ConvertToyv411()
#Crop(0,20,-0,-30,true)
#bob(0,0.5)

AssumeTFF()
SeparateFields()

a=last

clense
(reduceflicker=false).merge(last,0.5).clense(reduceflicker=false)
mot=removegrain(11,0).removegrain(20,0).DepanEstimate(range=2)
take2=a.depaninterleave(mot,prev=2,next=2,subpixel=2)
clean1=take2.TMedian2().selectevery(5,2)

sup1 clean1.minblur(1).removegrain(11,0).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)
#bv23=sup1.manalyse(isb=true, truemotion=false,global=true,delta=3,blksize=16,overlap=8,search=5,searchparam=4,DCT=5)
bv22=sup1.manalyse(isb=truetruemotion=false,global=true,delta=2,blksize=16,overlap=8,search=5,searchparam=4,DCT=5)
bv21=sup1.manalyse(isb=truetruemotion=false,global=true,delta=1,blksize=16,overlap=8,search=5,searchparam=4,DCT=5)
fv21=sup1.manalyse(isb=false,truemotion=false,global=true,delta=1,blksize=16,overlap=8,search=5,searchparam=4,DCT=5)
fv22=sup1.manalyse(isb=false,truemotion=false,global=true,delta=2,blksize=16,overlap=8,search=5,searchparam=4,DCT=5)
#fv23=sup1.manalyse(isb=false,truemotion=false,global=true,delta=3,blksize=16,overlap=8,search=5,searchparam=4,DCT=5)

#a.mdegrain3(sup2,bv21,fv21,bv22,fv22,bv23,fv23,thSAD=499) # << this is the "2-fold" variant

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

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

last.mdegrain3(sup3,bv31,fv31,bv32,fv32,bv33,fv33,thSAD=499# valor Original thSAD=499
LSFMod(strength=60)
Interleave() 
Weave()

#stackvertical(a,last) # Alterado por mim.
return(last)


#--------------------------------------------------------------
# Helper functions

function MinBlur(clip clpint rint "uv")
{
uv = default(uv,3)
uv2 = (uv==2) ? uv
rg4 
= (uv==3) ? : -1
rg11 
= (uv==3) ? 11 : -1
rg20 
= (uv==3) ? 20 : -1
medf 
= (uv==3) ? : -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
Return(last)
}

function 
TMedian2(clip c) {
Median2c.selectevery(1,-2), c.selectevery(1,-1), cc.selectevery(1,1), c.selectevery(1,2) ) } 
I don't know what you want to achieve with this script, but the script I pasted above works (at least it doesn't throw any error).
patul is offline   Reply With Quote