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 9th February 2009, 12:13   #81  |  Link
kopmjj
Registered User
 
Join Date: Oct 2008
Posts: 42
Quote:
Originally Posted by videoFred View Post
Take it easy man. There *is* a complete script, I have posted it, have I not? Just fix the "\" errors like Gavino has told you.

The rest is just a matter of having the right plugin versions.

Fred.
can you please upload your plugins then thanks
kopmjj is offline   Reply With Quote
Old 9th February 2009, 12:28   #82  |  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
can you please upload your plugins then thanks
No, plugins can not be uploaded. It's against the rules.

You will have to download them from the original source

What errors do you get, Kopmjj?

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 9th February 2009, 12:33   #83  |  Link
kopmjj
Registered User
 
Join Date: Oct 2008
Posts: 42
Quote:
Originally Posted by videoFred View Post
No, plugins can not be uploaded. It's against the rules.

You will have to download them from the original source

What errors do you get, Kopmjj?

Fred.
depanstablise does not have a name method line 128 something like that
kopmjj is offline   Reply With Quote
Old 9th February 2009, 12:38   #84  |  Link
kopmjj
Registered User
 
Join Date: Oct 2008
Posts: 42
here my entire script...

[HTML]film="C:\Documents and Settings\king\Desktop\New Folder\mymovie.avi.avi"
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



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")

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)[/PHP][/HTML]
kopmjj is offline   Reply With Quote
Old 9th February 2009, 12:50   #85  |  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
depanstablise does not have a name method line 128 something like that
Simple, I assume you are using an older version from Depan(). Just remove this (twice) "method=1".

Or better, download the newest Depan() version. But I see Fizicks website is nor working for now??


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 9th February 2009, 13:31   #86  |  Link
raeltheimperialaerosolkid
Registered User
 
Join Date: Sep 2005
Posts: 58
Hi videofred!

Thanks for this incredible script! I have a lot of 8mm film left from my dad that I would like to manage in my PC. After losing a bit of time in trying to make your script working (well, I could make it work with the patch suggested before for MVtools2 and not your original), now I'm facing a different kind of problem that is probably OT here: the quality of my source. The 8mm footage that I have spans form a long period (1965-1987... wow...22 years...) but they are in a poor condition. I made a first try in converting them paying a guy that, IMO, made a very bad job. With that conversion in my hands I could give a little better look to the film thorugh your script but, hey... still is very poor. Now I would like to make a new "conversion" Analog-->digital but I'm very confused on all the procedures and machines involved in the process. Is there a guide or something like that where I could look to? The restoration that you showed in your site is incredible but your source material is in waaaaay better condition than mine.
raeltheimperialaerosolkid is offline   Reply With Quote
Old 9th February 2009, 13:46   #87  |  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 raeltheimperialaerosolkid View Post
After losing a bit of time in trying to make your script working (well, I could make it work with the patch suggested before for MVtools2 and not your original),
Hello Rael, (no, I am not going to repeat your full name )

To use my original script, you need the special modified MVTools with the 'multi' support. It can be found here on the forum.

Quote:
the quality of my source. The 8mm footage that I have spans form a long period (1965-1987... wow...22 years...) but they are in a poor condition.
It could be the original but it could also be a bad transfer. I can only judge this if you would send me a sample piece of film.

You can always send me a PM...

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 9th February 2009, 18:14   #88  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
videoFred,
may it is better to add some word about "8mm film" to the title of this thead?
to decrease mess with usual video.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 9th February 2009, 18:24   #89  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Fizick: title is fixed

PS: what's wrong with your webspace??

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 19th February 2009, 22:14   #90  |  Link
mikkop
Registered User
 
Join Date: Jan 2009
Posts: 11
How to Remove splitscreen and text

hello,
I finaly have the script working but can't figur out how to get just the final video without the split screen and text can someone please help me.
thnx for the great script fred,
Michael
mikkop is offline   Reply With Quote
Old 19th February 2009, 22:21   #91  |  Link
tedkunich
Potentate
 
Join Date: Mar 2003
Posts: 219
Quote:
Originally Posted by mikkop View Post
hello,
I finaly have the script working but can't figur out how to get just the final video without the split screen and text can someone please help me.
thnx for the great script fred,
Michael

Look at the end of the script:

Code:
result1 = "autolevels, autowhite"
result2 = "autowhite, manual levels correction"
result3 = "autolevels + manual color correction"
result4 = "manual colors and levels correction"
tedkunich is offline   Reply With Quote
Old 22nd February 2009, 10:49   #92  |  Link
MadRat
Registered User
 
MadRat's Avatar
 
Join Date: Jan 2008
Posts: 110
Wow, that's really impressive color adjustment! I was kind of surprised no one mentioned RemoveDirtMC() which removes dirt and dust specks that are only found on one frame of the video. I noticed some specks while watching your video. The link is http://forum.doom9.org/showthread.php?t=110078 There's also a scratch removal script that is supposed to remove dark vertical lines caused by scratches in the film but I've never tried it. I'm going to go watch your video again.
MadRat is offline   Reply With Quote
Old 22nd February 2009, 15:01   #93  |  Link
mikkop
Registered User
 
Join Date: Jan 2009
Posts: 11
[CODE]Look at the end of the script:

Code:
result1 = "autolevels, autowhite"
result2 = "autowhite, manual levels correction"
result3 = "autolevels + manual color correction"
result4 = "manual colors and levels correction"/CODE]

Thanks for the answer,
I stil have a question. I wan't the same result as the outcome of the oiginal scrip (clip on the right). When i chane the script line at end into "return (result1)" or 2,3,4 the results are not so good as the original. the clip is shaking and in the original it is realy steady. Can you please tell me what i am doing wrong or what i shoot do to get the same result.
Thx, Michael
mikkop is offline   Reply With Quote
Old 23rd February 2009, 07:34   #94  |  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 mikkop View Post
the clip is shaking and in the original it is realy steady. Can you please tell me what i am doing wrong or what i shoot do to get the same result.
Thx, Michael
Hello Michael,

You are not doing anything wrong. If your original clip is steady, then there is no need to stabilize it. Please set "maxstab" to zero. Probably the stabilizer tries to follow a moving object in your clip.

I have made an option "result6" to check 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 23rd February 2009, 13:04   #95  |  Link
mikkop
Registered User
 
Join Date: Jan 2009
Posts: 11
Hi fred,

With original i ment the clip on the right in your script. My Original footage (on the left in the splitscreen) is shaking but whith your filters (on the right in the splitscreen) it became realy steady. When i adjust the script (see code) the result is still shaking and not so good as the clip on the right in your script.
Sorry for bothering you.

Michael

Code:
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))


return (result1)
mikkop is offline   Reply With Quote
Old 23rd February 2009, 13:22   #96  |  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 mikkop View Post
Sorry for bothering you.
Michael, you are not bothering me at all but please stop posting half scripts. Where is the other half?

Why have you changed my script anyhow? The only things you must change are the parameters on top of the script.

What you say is impossible anyhow. If the right window on the spitscreen is OK then the output must be ok to. It is the very same clip...

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 23rd February 2009, 14:16   #97  |  Link
mikkop
Registered User
 
Join Date: Jan 2009
Posts: 11
Here's the full script
Code:
film="C:\Documents and Settings\Michael\Mijn documenten\Downloads\filmdenoise\filmtest nieuw\alldepp2_15_16_fps.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")



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))


return (result1)
Fred,
The only thing i changed is the 1 line (film) , setmode (removed) and the last line return instead of eval.
When i use return1 does it use al the filters then?

Thnx, Michael
mikkop is offline   Reply With Quote
Old 23rd February 2009, 16:06   #98  |  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 mikkop View Post
.
When i use return1 does it use al the filters then?
Michael,

All returned clips should be stabilized. There is no difference in stabilizing between return1 , return2 etc...

The difference is in the levels and color corrections.

'resultS1' will return a double window with clip 'result1' on the right and the source on the left.
'result1' will return clip 'result1' only.
There is no difference, in both cases you will see clip 'result1'

I realy do not understand your problem, what difference do you see exactly?

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; 23rd February 2009 at 16:13.
videoFred is offline   Reply With Quote
Old 23rd February 2009, 16:40   #99  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by mikkop View Post
The only thing i changed is the 1 line (film) , setmode (removed) and the last line return instead of eval.
The way Fred has set up the script, the idea is that instead of changing the last line from eval, you instead change the value of 'result' to be the name of the result you want, eg
Code:
result = "result1"
(where it says "specify the wanted output here")

It comes to the same thing of course, but that way you only change the parameter section at the start, not the main body of the script.

Last edited by Gavino; 23rd February 2009 at 16:48.
Gavino is offline   Reply With Quote
Old 23rd February 2009, 17:02   #100  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Yes, this 'eval' was a hint from you, if I remember well Gavino

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
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 18:55.


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