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.

 

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

Reply
 
Thread Tools Search this Thread Display Modes
Old 22nd January 2009, 07:58   #41  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
Originally Posted by tedkunich View Post
I could never get the MVDegrainMulti call to work properly on my system - colors were lost and really noisy.
Strange... it works fine here on several computers. It even works on old single core computers, and it works both on XP and Vista.

There's a "SetMTMode=5" call in my script that can be removed when using MVMulti.. Perhaps MVMulti needs the special "Avisynth-MT" dll ?

I have done so many tests.. I do not remember some details any more.

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest

Last edited by videoFred; 22nd January 2009 at 09:44.
videoFred is offline   Reply With Quote
Old 22nd January 2009, 10:14   #42  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Quote:
Originally Posted by videoFred View Post
Ted has answered these questions correct. The script I have posted *is* using MVDegrainMulti() so you can do the averaging. Of cource you will need the correct MVTools.dll version for this.
Thankyou videoFred. I was hoping for the non-multi version, like Ted, and wondered how you went about averaging so many frames like you said.
halsboss is offline   Reply With Quote
Old 22nd January 2009, 10:23   #43  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
Originally Posted by halsboss View Post
Thankyou videoFred. I was hoping for the non-multi version, like Ted, and wondered how you went about averaging so many frames like you said.
To be very clear on this: averaging so many frames is only possible with MVDegrainMulti()
This also removes a lot of (small) dirt spots on the film

PS: the multi version works fine on old computers to. But insane slow of cource (1fps).


Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest

Last edited by videoFred; 22nd January 2009 at 10:25.
videoFred is offline   Reply With Quote
Old 22nd January 2009, 10:49   #44  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Oh. Thanks anyway. I wanted to stick with Fizick's stuff rather than the "multi" side-branch. I wonder what that means for Ted :-
Quote:
Originally Posted by tedkunich View Post
I'm looking to replace the MVxxxMulti calls with Fizick's MVToolsV2 equivalents
I suppose he/I will use with the code he posted as changes to your amazing script, unless you have other suggestions ? I wonder if Fizick has a "generalised" MVdegrain by now.

I must see if I can find an appropriate thread to ask the question "Just wondering... with setmtmode(mode=2,threads=4) which splits up consecutive frames and farms them off to separate threads - does that then muck up any mvanalyses and degrains which are suppose to compare frames in sequence ? MT() could be the workable alternative I guess ?"
halsboss is offline   Reply With Quote
Old 22nd January 2009, 11:12   #45  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
Originally Posted by halsboss View Post
I wanted to stick with Fizick's stuff rather than the "multi" side-branch.
I understand. But of cource the multi stuff *is* modified Fizick stuff.
I bet the MVDegrain() engine is the same...

Quote:
Just wondering... with setmtmode(mode=2,threads=4) which splits up consecutive frames and farms them off to separate threads - does that then muck up any mvanalyses and degrains which are suppose to compare frames in sequence ?
I'm an end user myself , I'm not an Avisynth guru!
I hope someone else can answer this.

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 22nd January 2009, 12:10   #46  |  Link
salehin
Learning
 
Join Date: Nov 2006
Location: Earth
Posts: 88
brilliant

@videoFred: This is simply amazing.. Thank you very much for sharing your script with us.

I'm going to try this magic of yours with my precious Louis Malle docus that he made in 70's

Regards

Salehin

Last edited by salehin; 22nd January 2009 at 12:17.
salehin is offline   Reply With Quote
Old 22nd January 2009, 12:40   #47  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
Originally Posted by salehin View Post
Thank you very much for sharing your script with us.
You are most welcome, Salehin.
Perhaps you can show us some of your results later?

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 22nd January 2009, 13:50   #48  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Yes please, I too would appreciate showing us the results of applying videoFred's script.
halsboss is offline   Reply With Quote
Old 22nd January 2009, 16:09   #49  |  Link
tedkunich
Potentate
 
Join Date: Mar 2003
Posts: 219
Quote:
Originally Posted by videoFred View Post
Strange... it works fine here on several computers. It even works on old single core computers, and it works both on XP and Vista.

There's a "SetMTMode=5" call in my script that can be removed when using MVMulti.. Perhaps MVMulti needs the special "Avisynth-MT" dll ?

I have done so many tests.. I do not remember some details any more.

Fred.
Fred,

I played with it last night and found that reducing the blocksize to 8 (from 16) took care of losing the colors - color was lost in much of the image, just remaining in some locations around the perimeter.

I have not tried MVDegrainMulti with the non-MT version of avisynth.dll yet - I'll give that a try next. But based on some initial testing, the MDegrain3 in MVTools 2.x does a really nice job and is faster than MVDegrainMulti using 3 frames - it may be a wash.....

One thing I have found is that I NEED a new computer!!!! @ 1-2fps rendering rate and several hours of footage to process, this will take forever!!! Have been looking at the AMD Quad cores... specifically the AMD Phenom II 3Gig 940, anyone have any experience with these?





Ted
tedkunich is offline   Reply With Quote
Old 22nd January 2009, 16:36   #50  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
Originally Posted by tedkunich View Post
Fred,

I played with it last night and found that reducing the blocksize to 8 (from 16) took care of losing the colors
Ah yes.. I see.. This depends on the source of cource. A blocksize of 16 is better with my 1024 x 768 originals.

The script runs 3-4 fps on my Dell Inspiron.. Nothing special, just a standard and cheap Dell machine.

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 22nd January 2009, 18:08   #51  |  Link
tedkunich
Potentate
 
Join Date: Mar 2003
Posts: 219
Quote:
Originally Posted by videoFred View Post
Ah yes.. I see.. This depends on the source of cource. A blocksize of 16 is better with my 1024 x 768 originals.

The script runs 3-4 fps on my Dell Inspiron.. Nothing special, just a standard and cheap Dell machine.

Fred.
Oh... that was something I had not considered... I believe that my source is 1040 x 1040 (1440x1080 cropped). I'll play with my cropping and see if that fixes the problem.

Thank,

Ted
tedkunich is offline   Reply With Quote
Old 22nd January 2009, 21:02   #52  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,988
AMD Phenom II processors aren't too bad, especially if you already have an AM2+ motherboard that can take a drop-in replacement.

But, from the sounds of it, you have an older system. In this case, you're probably better off buying an Intel setup, as their chips tend to be faster, and have similar entry costs

~MiSfit
__________________
These are all my personal statements, not those of my employer :)
Blue_MiSfit is offline   Reply With Quote
Old 4th February 2009, 01:48   #53  |  Link
EuropeanMan
Registered User
 
Join Date: Nov 2006
Posts: 660
@ VideoFred & others...I'm just now testing your script on page 1 (but using a replacement script for 2 lines vis a vis MVTools2 optimisation found on page 2 of this thread). I am trying to understand what is going on...but obviously there are things that I just don't understand. Would it be okay guys if I went line by line and asked what is going on and hopefully get answers that are simple enough to understand? Thanks again in advance as I'd really like to understand the thought process behind this.

I was scrolling through the video in VDM and wondered why I got blocking when there wasn't any in the video to begin with?



source (Lagaan, R5, DVD9 PAL Disc 1/3)
settings used were exactly from script (except for output rez)

Last edited by EuropeanMan; 4th February 2009 at 01:54.
EuropeanMan is offline   Reply With Quote
Old 7th February 2009, 05:46   #54  |  Link
kopmjj
Registered User
 
Join Date: Oct 2008
Posts: 42
Quote:
Originally Posted by videoFred View Post
Here is the script:

Code:
# film restoring script by videoFred.
# denoising, resizing, stabilising, sharpening, auto-levels and auto-white balance.


film="F:\002_dodcaps_tebewaren\privé 64\privé_64T_0014.avi" # source clip, you must specify the full path here

short="L"  # L=long clip  S=short clip try it!

result="resultS3" # specify the wanted output here 

trim_begin=6  trim_end=6   play_speed=18.75   #trim frames and play speed (PAL: 16.6666 or 18.75)

saturation=1.0   #saturation

X=4 gamma=0.7  # X is a special parameter for reducing the autolevels effect

black_level=0  white_level=255 output_black=0  output_white=255 # manual levels, when returning result4

AGC_max_sat=2  AGC_max_gain=1.0  #parameters of HDRAGC filter, improves colors and shadows
 
blue=-4  red=2  #manual color adjustment, when returning result2. Values can be positive or negative

denoising_strenght=800  #denoising level of first denoiser: MVDegrainMulti() 
denoising_frames= 4  #number of frames for averaging (forwards and backwards) 3 is a good start value
block_size= 16  #block size of MVDegrainMulti()
block_over= 4  #block overlapping of MVDegrainMulti()

temp_radius=20  temp_luma=6  temp_chroma=6 #second denoiser: TemporalSoften

grain_luma=10  grain_chroma=10
# this will add some digital grain to the final result, set it to zero if you do not want it.

LSF_sharp_ness=250 LSF_radi_us=3  LSF_sub=1.5 #first sharpening parameters (LimitedSharpenFaster) sub=subsampling

USM_sharp_ness=40    USM_radi_us=2  USM_thres_hold=0  #second sharpening parameters (UnsharpMask)

USM_sharp_ness2=20    USM_radi_us2=1  USM_thres_hold2=0  #third sharpening parameters (UnsharpMask)

maxstab=60  #maximum values for the stabiliser (in pixels) 20 is a good start value

est_left=20   est_top=20  est_right=20  est_bottom=20  est_cont=0.8  #crop values for special Estimate clip
CLeft=30  CTop=30  CRight=30  CBottom=30  #crop values after Depan and before final resizing (40,30,40,30)

W=720  H=576 #final size from the returned clip

bord_left=0  bord_top=0  bord_right=0  bord_bot=0
#you can add black borders after resizing, final size is then size + borders!!


# End variables, begin script
#====================================================================================================


SetMemoryMax(1024)  #set this to 1/3 of the available memory


Loadplugin("Depan.dll")
LoadPlugin("DepanEstimate.dll")
Loadplugin("removegrain.dll")
LoadPlugin("AGC.dll")
LoadPlugin("MVTools.dll")
Loadplugin("mt_masktools.dll")
LoadPlugin("MaskTools.dll")
Loadplugin("warpsharp.dll")
LoadPlugIn("LimitedSupport_09Jan06B.dll")
LoadPlugin("MT.dll")
LoadPlugin("autolevels.dll")
LoadPlugin("AddGrainC.dll")
Import("LimitedSharpenFaster.avs")


SetMTMode(5)


source1= Avisource(film).assumefps(play_speed).trim(trim_begin,0).converttoYV12()
end= source1.framecount()
end2= end-trim_end
frames=end+trim_begin

skip= end2/5
skip0=skip+3
skipend= 3

skipend1= skip0+3

skip2= skipend1+skip
skipend2= skip2+3

skip3= skipend2+skip
skipend3= skip3+3

skip4= skipend3+skip
skipend4= skip4+3

skip5= end2-3

L= trim(source1,0,end2)
LS= trim(source1,0,end2).scriptclip("""subtitle("frame  "+string(trim_begin+current_frame)\
+"  from  "+string(frames)+"   trim_begin-"+string(trim_begin)+"   trim_end-"\
+string(trim_end),x=100,y=60,size=32)""")

sourceT1= trim(source1,0,skipend).scriptclip("""subtitle("frame  "+string(trim_begin+current_frame)\
+"  from  "+string(frames)+"   trim_begin-"+string(trim_begin)+"   trim_end-"+string(trim_end)\
+"  steps: "+string(skip),x=100,y=60,size=32)""")

sourceT2= trim(source1,skip0,skipend1).scriptclip("""subtitle("frame  "+string(trim_begin+skip0+current_frame)\
+"  from  "+string(frames)+"   trim_begin-"+string(trim_begin)+"   trim_end-"+string(trim_end)+"  steps: "\
+string(skip),x=100,y=60,size=32)""")

sourceT3= trim(source1,skip2,skipend2).scriptclip("""subtitle("frame  "+string(trim_begin+skip2+current_frame)\
+"  from  "+string(frames)+"   trim_begin-"+string(trim_begin)+"   trim_end-"+string(trim_end)+"  steps:\
 "+string(skip),x=100,y=60,size=32)""")

sourceT4= trim(source1,skip3,skipend3).scriptclip("""subtitle("frame  "+string(trim_begin+skip3+current_frame)\
+"  from  "+string(frames)+"   trim_begin-"+string(trim_begin)+"   trim_end-"+string(trim_end)+\
"  steps: "+string(skip),x=100,y=60,size=32)""")

sourceT5= trim(source1,skip4,skipend4).scriptclip("""subtitle("frame  "+string(trim_begin+skip4+current_frame)\
+"  from  "+string(frames)+"   trim_begin-"+string(trim_begin)+"   trim_end-"+string(trim_end)+\
"  steps: "+string(skip),x=100,y=60,size=32)""")

sourceT6= trim(source1,skip5,end2).scriptclip("""subtitle("frame  "+string(trim_begin+skip5+current_frame)\
+"  from  "+string(frames)+"   trim_begin-"+string(trim_begin)+"   trim_end-"+string(trim_end)+\
"  steps: "+string(skip),x=100,y=60,size=32)""")

SS= sourceT1+sourceT2+sourceT3+sourceT4+sourceT5+sourceT6


sourceT10= trim(source1,0,skipend)
sourceT20= trim(source1,skip0,skipend1)
sourceT30= trim(source1,skip2,skipend2)
sourceT40= trim(source1,skip3,skipend3)
sourceT50= trim(source1,skip4,skipend4)
sourceT60= trim(source1,skip5,end2)

S= sourceT10+sourceT20+sourceT30+sourceT40+sourceT50+sourceT60


stab_reference= eval(short).crop(est_left,est_top,-est_right,-est_bottom)\
.tweak(cont=est_cont).binarize(threshold=80).greyscale().invert()

mdata=DePanEstimate(stab_reference,trust=1.0,dxmax=maxstab,dymax=maxstab)
stab=DePanStabilize(eval(short),data=mdata,cutoff=0.5,dxmax=maxstab,dymax=maxstab,method=1,mirror=15)
stab2= stab.crop(CLeft,CTop,-CRight,-CBottom).tweak(sat=saturation)
stab3=DePanStabilize(eval(short),data=mdata,cutoff=0.5,dxmax=maxstab,dymax=maxstab,method=1,info=true)

WS= width(stab)
HS= height(stab)
stab4= stab3.addborders(10,10,10,10,$B1B1B1).Lanczos4Resize(WS,HS)


vectors= stab2.MVAnalyseMulti(refframes=denoising_frames, pel=2, blksize=block_size, overlap=block_over, idx=1)
denoised= stab2.MVDegrainMulti(vectors, thSAD=denoising_strenght, SadMode=1, idx=1).tweak(sat=saturation)




leveled= denoised.HDRAGC(coef_gain=2.0,max_gain=AGC_max_gain,min_gain=0.5,max_sat=AGC_max_sat,shadows=true)

sharp1=limitedSharpenFaster(leveled,smode=1,strength=LSF_sharp_ness,overshoot=50,\
radius=LSF_radi_us, ss_X=LSF_sub, SS_Y=LSF_sub, dest_x=W,dest_y=H)

sharp2= unsharpmask(sharp1,USM_sharp_ness,USM_radi_us,USM_thres_hold)
sharpX= unsharpmask(sharp2,USM_sharp_ness2,USM_radi_us2,USM_thres_hold2)

sharp3= sharpX.TemporalSoften(temp_radius,temp_luma,temp_chroma,15,2).addgrainC(grain_luma,grain_chroma,0.2,0.2,5)




#backward_vectors = sharp3.MVAnalyse(isb = true,truemotion=true,idx=2)
#forward_vectors = sharp3.MVAnalyse(isb = false,truemotion=true,idx=2)
#frameclip=MVFlowFps(sharp3,backward_vectors, forward_vectors, num=25, den=1, ml=100, idx=2)



result1= sharp3.addborders(X,0,0,0,$FFFFFF).levels(0,gamma,255,0,255).autolevels().coloryuv(autowhite=true)\
.crop(X,0,-0,-0).addborders(bord_left, bord_top, bord_right, bord_bot)

result2= sharp3.levels(black_level,gamma,white_level,0,255).coloryuv(autowhite=true)\
.addborders(bord_left, bord_top, bord_right, bord_bot)

result3= sharp3.coloryuv(off_U=blue,off_V=red).levels(0,gamma,255,0,255).addborders(X,0,0,0,$FFFFFF)\
.autolevels().crop(X,0,-0,-0).addborders(bord_left, bord_top, bord_right, bord_bot)

result4= sharp3.coloryuv(off_U=blue,off_V=red).levels(black_level,gamma,white_level,0,255)\
.addborders(bord_left, bord_top, bord_right, bord_bot)

result5= overlay(eval(short),stab_reference,x=est_left,y=est_top).addborders(2,2,2,2,$FFFFFF).Lanczos4Resize(WS,HS)


W2= W+bord_left+bord_right
H2= H+bord_top+bord_bot

short2=short+"S"

source2=Lanczos4Resize(eval(short2),W2,H2)
source3=Lanczos4Resize(eval(short2),W,H)

resultS1= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result1,"autolevels, autowhite",size=28,align=2))

resultS2= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result2,"autowhite, manual levels correction",size=28,align=2))

resultS3= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result3,"autolevels + manual color correction",size=28,align=2))

resultS4= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result4,"manual colors and levels correction",size=28,align=2))

resultS2H= stackhorizontal(subtitle(source2,"original",size=32,align=2)
,subtitle(result2,"autowhite, manual levels\
 correction",size=28,align=2).histogram(mode="levels"))

resultS3H= stackhorizontal(subtitle(source2,"original",size=32,align=2),subtitle(result3,"autolevels + manual color\ 
correction",size=28,align=2).histogram(mode="levels"))

resultS4H= stackhorizontal(subtitle(source2,"original",size=32,align=2),subtitle(result4,"manual colors and levels\ 
correction",size=28,align=2).histogram(mode="levels"))

result6= stackhorizontal(subtitle(result5,"baseclip for stabiliser -only the B/W clip is used",size=32,align=2)\
,subtitle(stab4,"test stabiliser: dx=horizontal, dy=vertical",size=32,align=5))


Eval(result)
All suggestions to improve it are welcome.

Fred.


hi WOW!!! FANTASTIC WORK!!! REALLY AMAZING. now i can work on some of my footage to restore some videos.

but im still new to avisynth so im confused on your script,it doesnt show what plugins to load etc, please can you show me an exact script exactly how it is like for example load video eg: avi, and the load plugins and adjust filters. or upload your editing script.

so a sample full script please just to give me an idea thanks.
then i can then adjust settings how i like but i just need the base.

if anyone is king enough please show the script thanks again.
kopmjj is offline   Reply With Quote
Old 7th February 2009, 10:49   #55  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
Originally Posted by EuropeanMan View Post
I was scrolling through the video in VDM and wondered why I got blocking when there wasn't any in the video to begin with?
EuropeanMan,

This script was special made for restoring old and very grainy 8mm film capturings. Settings are way to heavy for your source. Please reduce degraining and sharpening to begin with.

What do you want to improve anyhow?

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 7th February 2009, 10:53   #56  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
Originally Posted by kopmjj View Post
now i can work on some of my footage to restore some videos.
It will not work the same on old videos....
It is made for film.

Quote:
it doesnt show what plugins to load
Please read the script careful.. You will see what plugins are needed.


Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 8th February 2009, 01:50   #57  |  Link
mikkop
Registered User
 
Join Date: Jan 2009
Posts: 11
Getting serveral errors

Hi When i trie to load the script i get serveral errors like:

depanstabilize There's no function named "methode"

There's no function named "vector"

There's no function named "mvdegrainmulti"

And a few more.Al the dll files are in the map.
Can someone help me please
mikkop is offline   Reply With Quote
Old 8th February 2009, 11:32   #58  |  Link
kopmjj
Registered User
 
Join Date: Oct 2008
Posts: 42
ok i had a go at this but now it says error in line 154 heres my scipt can you tell me what i have done wrong?
or show me a fixed script thanks.

SetMemoryMax(1024)
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DePan.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DePanEstimate.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrain.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\HDRAGC.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mvtools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_masktools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\LimitedSupport_09Jan06B.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MT.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\autolevels.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\AddGrainC.dll")
Import("C:\Program Files\AviSynth 2.5\Plugins\LimitedSharpenFaster.avs")
SetMTMode(5)
AVISource("C:\Documents and Settings\king\Desktop\New Folder\mymovie.avi.avi")
converttoYV12
end= source1.framecount()
end2= end-trim_end
frames=end+trim_begin

skip= end2/5
skip0=skip+3
skipend= 3

skipend1= skip0+3

skip2= skipend1+skip
skipend2= skip2+3

skip3= skipend2+skip
skipend3= skip3+3

skip4= skipend3+skip
skipend4= skip4+3

skip5= end2-3

L= trim(source1,0,end2)
LS= trim(source1,0,end2).scriptclip("""subtitle("frame "+string(trim_begin+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"\
+string(trim_end),x=100,y=60,size=32)""")

sourceT1= trim(source1,0,skipend).scriptclip("""subtitle("frame "+string(trim_begin+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)\
+" steps: "+string(skip),x=100,y=60,size=32)""")

sourceT2= trim(source1,skip0,skipend1).scriptclip("""subtitle("frame "+string(trim_begin+skip0+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)+" steps: "\
+string(skip),x=100,y=60,size=32)""")

sourceT3= trim(source1,skip2,skipend2).scriptclip("""subtitle("frame "+string(trim_begin+skip2+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)+" steps:\
"+string(skip),x=100,y=60,size=32)""")

sourceT4= trim(source1,skip3,skipend3).scriptclip("""subtitle("frame "+string(trim_begin+skip3+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)+\
" steps: "+string(skip),x=100,y=60,size=32)""")

sourceT5= trim(source1,skip4,skipend4).scriptclip("""subtitle("frame "+string(trim_begin+skip4+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)+\
" steps: "+string(skip),x=100,y=60,size=32)""")

sourceT6= trim(source1,skip5,end2).scriptclip("""subtitle("frame "+string(trim_begin+skip5+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)+\
" steps: "+string(skip),x=100,y=60,size=32)""")

SS= sourceT1+sourceT2+sourceT3+sourceT4+sourceT5+sourceT6


sourceT10= trim(source1,0,skipend)
sourceT20= trim(source1,skip0,skipend1)
sourceT30= trim(source1,skip2,skipend2)
sourceT40= trim(source1,skip3,skipend3)
sourceT50= trim(source1,skip4,skipend4)
sourceT60= trim(source1,skip5,end2)

S= sourceT10+sourceT20+sourceT30+sourceT40+sourceT50+sourceT60


stab_reference= eval(short).crop(est_left,est_top,-est_right,-est_bottom)\
.tweak(cont=est_cont).binarize(threshold=80).greyscale().invert()

mdata=DePanEstimate(stab_reference,trust=1.0,dxmax=maxstab,dymax=maxstab)
stab=DePanStabilize(eval(short),data=mdata,cutoff=0.5,dxmax=maxstab,dymax=maxstab,method=1,mirror=15)
stab2= stab.crop(CLeft,CTop,-CRight,-CBottom).tweak(sat=saturation)
stab3=DePanStabilize(eval(short),data=mdata,cutoff=0.5,dxmax=maxstab,dymax=maxstab,method=1,info=true)

WS= width(stab)
HS= height(stab)
stab4= stab3.addborders(10,10,10,10,$B1B1B1).Lanczos4Resize(WS,HS)


vectors= stab2.MVAnalyseMulti(refframes=denoising_frames, pel=2, blksize=block_size, overlap=block_over, idx=1)
denoised= stab2.MVDegrainMulti(vectors, thSAD=denoising_strenght, SadMode=1, idx=1).tweak(sat=saturation)




leveled= denoised.HDRAGC(coef_gain=2.0,max_gain=AGC_max_gain,min_gain=0.5,max_sat=AGC_max_sat,shadows=true)

sharp1=limitedSharpenFaster(leveled,smode=1,strength=LSF_sharp_ness,overshoot=50,\
radius=LSF_radi_us, ss_X=LSF_sub, SS_Y=LSF_sub, dest_x=W,dest_y=H)

sharp2= unsharpmask(sharp1,USM_sharp_ness,USM_radi_us,USM_thres_hold)
sharpX= unsharpmask(sharp2,USM_sharp_ness2,USM_radi_us2,USM_thres_hold2)

sharp3= sharpX.TemporalSoften(temp_radius,temp_luma,temp_chroma,15,2).addgrainC(grain_luma,grain_chroma,0.2,0.2,5)




#backward_vectors = sharp3.MVAnalyse(isb = true,truemotion=true,idx=2)
#forward_vectors = sharp3.MVAnalyse(isb = false,truemotion=true,idx=2)
#frameclip=MVFlowFps(sharp3,backward_vectors, forward_vectors, num=25, den=1, ml=100, idx=2)



result1= sharp3.addborders(X,0,0,0,$FFFFFF).levels(0,gamma,255,0,255).autolevels().coloryuv(autowhite=true)\
.crop(X,0,-0,-0).addborders(bord_left, bord_top, bord_right, bord_bot)

result2= sharp3.levels(black_level,gamma,white_level,0,255).coloryuv(autowhite=true)\
.addborders(bord_left, bord_top, bord_right, bord_bot)

result3= sharp3.coloryuv(off_U=blue,off_V=red).levels(0,gamma,255,0,255).addborders(X,0,0,0,$FFFFFF)\
.autolevels().crop(X,0,-0,-0).addborders(bord_left, bord_top, bord_right, bord_bot)

result4= sharp3.coloryuv(off_U=blue,off_V=red).levels(black_level,gamma,white_level,0,255)\
.addborders(bord_left, bord_top, bord_right, bord_bot)

result5= overlay(eval(short),stab_reference,x=est_left,y=est_top).addborders(2,2,2,2,$FFFFFF).Lanczos4Resize(WS,HS)


W2= W+bord_left+bord_right
H2= H+bord_top+bord_bot

short2=short+"S"

source2=Lanczos4Resize(eval(short2),W2,H2)
source3=Lanczos4Resize(eval(short2),W,H)

resultS1= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result1,"autolevels, autowhite",size=28,align=2))

resultS2= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result2,"autowhite, manual levels correction",size=28,align=2))

resultS3= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result3,"autolevels + manual color correction",size=28,align=2))

resultS4= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result4,"manual colors and levels correction",size=28,align=2))

resultS2H= stackhorizontal(subtitle(source2,"original",size=32,align=2)
,subtitle(result2,"autowhite, manual levels\
correction",size=28,align=2).histogram(mode="levels"))

resultS3H= stackhorizontal(subtitle(source2,"original",size=32,align=2),subtitle(result3,"autolevels + manual color\
correction",size=28,align=2).histogram(mode="levels"))

resultS4H= stackhorizontal(subtitle(source2,"original",size=32,align=2),subtitle(result4,"manual colors and levels\
correction",size=28,align=2).histogram(mode="levels"))

result6= stackhorizontal(subtitle(result5,"baseclip for stabiliser -only the B/W clip is used",size=32,align=2)\
,subtitle(stab4,"test stabiliser: dx=horizontal, dy=vertical",size=32,align=5))
kopmjj is offline   Reply With Quote
Old 8th February 2009, 12:43   #59  |  Link
jmartinr
Registered User
 
jmartinr's Avatar
 
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
You forgot a \ in line 154.
jmartinr is offline   Reply With Quote
Old 8th February 2009, 13:32   #60  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by jmartinr View Post
You forgot a \ in line 154.
It's missing in the original script posted by videoFred, probably because he reformatted it for posting. It also contains wrongly split string literals. So the lines
Code:
resultS2H= stackhorizontal(subtitle(source2,"original",size=32,align=2)
,subtitle(result2,"autowhite, manual levels\
correction",size=28,align=2).histogram(mode="levels"))

resultS3H= stackhorizontal(subtitle(source2,"original",size=32,align=2),subtitle(result3,"autolevels + manual color\
correction",size=28,align=2).histogram(mode="levels"))

resultS4H= stackhorizontal(subtitle(source2,"original",size=32,align=2),subtitle(result4,"manual colors and levels\
correction",size=28,align=2).histogram(mode="levels"))
should be
Code:
resultS2H= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result2,"autowhite, manual levels correction",\
size=28,align=2).histogram(mode="levels"))

resultS3H= stackhorizontal(subtitle(source2,"original",size=32,align=2),\
subtitle(result3,"autolevels + manual color correction",\
size=28,align=2).histogram(mode="levels"))

resultS4H= stackhorizontal(subtitle(source2,"original",size=32,align=2),\
subtitle(result4,"manual colors and levels correction",\
size=28,align=2).histogram(mode="levels"))
Gavino is offline   Reply With Quote
Reply

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 00:01.


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