Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 25th February 2015, 02:12   #1  |  Link
NLPguy
Registered User
 
Join Date: Feb 2015
Posts: 31
Script and Time?

Hi folks,

I'm using two AviSynth scripts, posted below, to improve/clean the video of many old VHS (NTSC) tapes that I have. It has many horizontal waves (lines) or fixed lines on the image.

I'm capturing VHS tapes with a Panasonic AG-1980 videotape. Also, I'm using a DVD Panasonic DMR-ES10 to pass through (with all the filters 'on') aiming to strike as many horizontal wave as possible.

My PC is an AMD 8350 4.0 Ghz 16GB is taking 6 hours to run the script. And my laptop - an Intel Core I7 2630QM 2.0 Ghz 8GB is taking 20 hours to run it.


So, please:

Do you know why is taking so much time to execute the script using the Core i7 laptop?

Is there some way to decrease the 'process time' modifying the script below (trying to keep the quality output)?



Thank you very much!

Script 1
Quote:
Script 1 - source script2 Jucilda.avs

SetMemoryMax(512)
SetMTMode(3)
mpeg2source("M:\Jucilda e Joel\01 12 V1\01.d2v")
import("m:\temp2\ChubbyRain2 functions.avs")
import("m:\temp2\RemoveDirtMC.avs")
SetMTMode(2)
AssumeTFF()
Crop(12,0,-4,-8,true)
ChubbyRain2()

SeparateFields()
f1=SelectEven().RemoveDirtMC(60,false).FFT3DFilter(sigma=4,plane=3,bt=2).LSFMod(strength=100)
f2=SelectOdd().RemoveDirtMC(60,false).FFT3DFilter(sigma=4,plane=3,bt=2).LSFMod(strength=100)
Interleave(f1,f2)
Weave()

#SmoothLevels(30,1,255,0,245)

base=last
base.crop(0,0,-630,0,true)
Smoothuv(radius=3)
left=last

Overlay(base,left)

AddBorders(8,4,8,4)
Script 2
Quote:
Script 2

Import("m:\temp2\source script2 Jucilda.avs")
# Plugins: - RemoveGrain
# - MaskTools2
# - Depan + DepanEstimate
# - MVTools2

SetMemoryMax(512)
SetMTMode(3)
LoadPlugin("m:\temp2\RemoveGrain.dll")
LoadPlugin("m:\temp2\MaskTools2-25.dll")
LoadPlugin("m:\temp2\Depan.dll")
LoadPlugin("m:\temp2\DepanEstimate.dll")
LoadPlugin("m:\temp2\MVTools2.dll")

# mpeg2source("M:\Rosangela\20 4 JVC\\20.d2v")

SetMTMode(2)
# crop(0,64,-0,-64,true)

bob(0,0.5)
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=true, truemotion=false,global=true,delta=2,blksize=16,overlap=8,search=5,searchparam=4,DCT=5)
bv21=sup1.manalyse(isb=true, truemotion=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=true, truemotion=false,global=true,delta=3,blksize=8,overlap=4,search=5,searchparam=4,DCT=5)
bv32=sup3.manalyse(isb=true, truemotion=false,global=true,delta=2,blksize=8,overlap=4,search=5,searchparam=4,DCT=5)
bv31=sup3.manalyse(isb=true, truemotion=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)

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


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

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
Return(last)
}

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

Last edited by NLPguy; 25th February 2015 at 06:26.
NLPguy is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.