VideoHelp Forum




+ Reply to Thread
Results 1 to 24 of 24
  1. Ok guys so I am new to AviSynth.I downloaded a script for video enhancing and I have a problem with it.The path of the video is not specified and I don't know where/how to add it.

    I would be appreciate your responses.Thank you very much!

    The code:


    #REMOVE DIRT FUNCTION
    #................................................. .................................................. .................................................. .................
    function RemoveDirt(clip input, int limit, bool _grey)
    {
    clensed=input.Clense(grey=_grey, cache=4)
    alt=input.RemoveGrain(2)
    return RestoreMotionBlocks(clensed,input,alternative=alt, pthreshold=6,cthreshold=8, gmthreshold=40,dist=3, dmode=2,debug=false,noise=limit,noisy=4, grey=_grey)

    # Alternative settings
    # return RestoreMotionBlocks(clensed,input,alternative=alt, pthreshold=4,cthreshold=6, gmthreshold=40,dist=1,dmode=2,debug=false,noise=li mit,noisy=12,grey=_grey,show=true)
    # return RestoreMotionBlocks(clensed,input,alternative=alt, pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,tolerance= 12,dmode=2,debug=false,noise=limit,noisy=12,grey=_ grey,show=false)
    }

    function RemoveDirtMC(clip,int limit, bool "_grey")
    {
    _grey=default(_grey, false)
    limit = default(limit,6)
    i=MSuper(clip,pel=2)
    bvec = MAnalyse(i,isb=false, blksize=8, delta=1, truemotion=true)
    fvec = MAnalyse(i,isb=true, blksize=8, delta=1, truemotion=true)
    backw = MFlow(clip,i,bvec)
    forw = MFlow(clip,i,fvec)
    clp=interleave(backw,clip,forw)
    clp=clp.RemoveDirt(limit,_grey)
    clp=clp.SelectEvery(3,1)
    return clip
    }
    Quote Quote  
  2. What format is your video? You need a source filter to load the video

    e.g.

    AVISource("PATH\video.avi")
    #some filter


    you don't need to specify the "PATH" if the .avs script is in the same directory as the video

    you might want to have a look at the basic tutorials for getting started
    http://avisynth.org/mediawiki/Main_Page
    http://avisynth.org/mediawiki/First_script
    http://avisynth.org/mediawiki/Getting_started
    Quote Quote  
  3. thank you.the video is ".avi",virtual dub (not mod) accepts only avi.
    Quote Quote  
  4. vdub accepts avs scripts

    1) install avisynth

    2) write the script in notepad , save it, change the extension for .txt to .avs

    3) load that .avs into vdub
    Quote Quote  
  5. when i try to load the script it says "the script's return value is not a videoclip"....
    Quote Quote  
  6. post your exact script . The "PATH" should be replaced by the actual directory path C:\folder\etc , wherever your file is located. If it's in same directory as video, then you can omit it. Change the filenames to match

    AVISource("video.avi")
    Quote Quote  
  7. AVISource("D:\video.avi")
    #REMOVE DIRT FUNCTION
    #................................................. .................................................. .................................................. .................
    function RemoveDirt(clip input, int limit, bool _grey)
    {
    clensed=input.Clense(grey=_grey, cache=4)
    alt=input.RemoveGrain(2)
    return RestoreMotionBlocks(clensed,input,alternative=alt, pthreshold=6,cthreshold=8, gmthreshold=40,dist=3, dmode=2,debug=false,noise=limit,noisy=4, grey=_grey)

    # Alternative settings
    # return RestoreMotionBlocks(clensed,input,alternative=alt, pthreshold=4,cthreshold=6, gmthreshold=40,dist=1,dmode=2,debug=false,noise=li mit,noisy=12,grey=_grey,show=true)
    # return RestoreMotionBlocks(clensed,input,alternative=alt, pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,tolerance= 12,dmode=2,debug=false,noise=limit,noisy=12,grey=_ grey,show=false)
    }

    function RemoveDirtMC(clip,int limit, bool "_grey")
    {
    _grey=default(_grey, false)
    limit = default(limit,6)
    i=MSuper(clip,pel=2)
    bvec = MAnalyse(i,isb=false, blksize=8, delta=1, truemotion=true)
    fvec = MAnalyse(i,isb=true, blksize=8, delta=1, truemotion=true)
    backw = MFlow(clip,i,bvec)
    forw = MFlow(clip,i,fvec)
    clp=interleave(backw,clip,forw)
    clp=clp.RemoveDirt(limit,_grey)
    clp=clp.SelectEvery(3,1)
    return clip
    }
    Quote Quote  
  8. Your video is called "video.avi?" and it's in the D directory ?

    You also need to use the filter, you have only listed the function but haven't called it

    e.g.
    AVISource("somevideo.avi")
    RemoveDirtMC(10,false)
    Quote Quote  
  9. yep.

    I see.but i want to use the whole script.how can I specifiy a filter
    Quote Quote  
  10. Do you still get the same error message ?

    Can you open the video in gspot or mediainfo? what does it say about the video?
    Quote Quote  
  11. I can open the video in virtual dub.i can open it in sony vegas,mediainfo,everything.
    When I open it with the specified path it says:
    "AVI Source: couldn't locate a decompressor four fourcc dvsc"
    Quote Quote  
  12. you need a vfw dv decoder

    eg. cedocida
    Quote Quote  
  13. WOW!It really works now!Thanks a lot!
    Quote Quote  
  14. Hey.I got another problem with the scripts.the original one was meant to make a comparision between videos and I wanted to know if it's possible to delete it.

    Script:

    # film restoration script by videoFred.
    # modified 30 august 2010
    # version with frame blending
    # added removedirtMC() as suggested by John Meyer
    # cleaning, degraining, resizing, stabilizing, sharpening, auto-levels and auto-white balance.
    #================================================= ============================================



    film="D:\03_RemoveDirtMC.avi" # source clip, please specify the full path here


    #PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    result="resultS3" # specify the wanted output here

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

    final_framerate = 25 # final frame rate


    #COLOR AND LEVELS PARAMATERS
    #----------------------------------------------------------------------------------------------------------------------------
    saturation=1.4 #for all outputs

    gamma= 1.0 # for all outputs

    blue= -0 red= 0 #manual color adjustment, when returning result3 or result4. Values can be positive or negative


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


    #SIZE, CROP AND BORDERS PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    CLeft=20 CTop=20 CRight=20 CBottom=20 #crop values after Depan and before final resizing

    W=720 H=576 #final size after cropping

    bord_left=0 bord_top=0 bord_right=0 bord_bot=0 #720p= borders 150


    #STABILISING PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    maxstabH=20
    maxstabV=20 #maximum values for the stabiliser (in pixels) 20 is a good start value

    est_left=40 est_top=40 est_right=40 est_bottom=40 est_cont=1.4 #crop and contast values for special Estimate clip


    #CLEANING PARAMETERS
    #--------------------------------------------------------------------------------------------------------------

    dirt_blur= 0.1 # some blur before cleaning to avoid pixel artifacts
    dirt_strength=40 # set this lower for clean films.


    #DENOISING PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------


    denoising_strength= 800 #denoising level of second 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_size_v= 16
    block_over= 8 #block overlapping of MVDegrainMulti()




    # FOUR STEP SHARPENING PARAMETERS
    #--------------------------------------------------------------------------------------------------------------------------------

    USM_sharp_ness1= 120 USM_radi_us1= 3 #first sharpening (UnsharpMask) after cleaning with removedirtMC()

    USM_sharp_ness2= 80 USM_radi_us2=2 #second harpening (UnsharpMask) after cleaning with removedirtMC()

    USM_sharp_ness3= 70 USM_radi_us3=1 #third sharpening (UnsharpMask) after degraining with MVDegrainMulti()


    last_sharp= 0.4 #final sharpening step after interpolation

    last_blur= 0.2 #this smooths out the heavy sharpening effects


    #AUTO LEVELS PARAMETER
    #--------------------------------------------------------------------------------------------------------------------------------
    X=2 # X is a special parameter for reducing the autolevels effect on the whites
    X2=2 # X2 is a special parameter for reducing the autolevels effect on the blacks




    # END VARIABLES, BEGIN SCRIPT
    #================================================= ================================================== ==============================


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

    SetMTMode(5) #disable all MT calls if you are using a single core computer



    LoadPlugin("Deflicker.dll")
    Loadplugin("Depan.dll")
    LoadPlugin("DepanEstimate.dll")
    Loadplugin("removegrain.dll")
    LoadPlugin("removedirt.dll")
    LoadPlugin("MVTools.dll")
    LoadPlugin("MVTools2.dll")
    Loadplugin("mt_masktools.dll")
    Loadplugin("warpsharp.dll")
    LoadPlugin("MT.dll")
    LoadPlugin("autolevels.dll")
    Import("03_RemoveDirtMC.avs")




    source1= AviSource(film).assumefps(play_speed).trim(trim_be gin,0).converttoYV12()


    SetMTMode(1,0)


    #STABILIZING/CROPPING
    #................................................. .................................................. .......................................
    stab_reference= source1.crop(est_left,est_top,-est_right,-est_bottom).tweak(cont=est_cont).MT_binarize(thres hold=80).greyscale().invert()

    mdata=DePanEstimate(stab_reference,trust=1.0,dxmax =maxstabH,dymax=maxstabV)
    stab=DePanStabilize(source1,data=mdata,cutoff=0.5, dxmax=maxstabH,dymax=maxstabV,method=0,mirror=15). deflicker()
    stab2= stab.crop(CLeft,CTop,-CRight,-CBottom)
    stab3=DePanStabilize(source1,data=mdata,cutoff=0.5 ,dxmax=maxstabH,dymax=maxstabV,method=0,info=true)

    WS= width(stab)
    HS= height(stab)
    stab4= stab3.addborders(10,10,10,10,$B1B1B1).Lanczos4Resi ze(WS,HS)
    stab5= Lanczos4Resize(stab2,W,H).sharpen(0.5)


    #CLEANING/PRESHARPENING/RESIZING
    #................................................. .................................................. ........................................


    noise_baseclip= stab2.levels(0,gamma,255,0,255).tweak(sat=saturati on).blur(dirt_blur)




    cleaned= RemoveDirtMC(noise_baseclip,dirt_strength).unsharp mask(USM_sharp_ness1,USM_radi_us1,0)\
    .unsharpmask(USM_sharp_ness2,USM_radi_us2,0).Lancz os4Resize(W,H)



    #DEGRAINING/SHARPENING
    #................................................. .................................................. ..............................................



    vectors= cleaned.MVAnalyseMulti(refframes=denoising_frames, pel=2, blksize=block_size, blksizev= block_size_v, overlap=block_over, idx=1)
    denoised= cleaned.MVDegrainMulti(vectors, thSAD=denoising_strength, SadMode=1, idx=2).unsharpmask(USM_sharp_ness3,USM_radi_us3,0) \
    .sharpen(last_sharp).sharpen(last_sharp)





    #RESULT1: AUTOLEVELS,AUTOWHITE
    #................................................. .................................................. ..............................................
    result1= denoised.coloryuv(autowhite=true).addborders(X,0,0 ,0,$FFFFFF).addborders(0,0,X2,0,$000000).autolevel s().crop(X,0,-X2,-0)\
    .converttoYUY2().ConvertFPS(final_framerate).blur( last_blur).converttoYV12().addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT2: MANUAL LEVELS, AUTOWHITE
    #................................................. .................................................. ..............................................
    result2= denoised.levels(black_level,1.0,white_level,0,255) .coloryuv(autowhite=true)\
    .converttoYUY2().ConvertFPS(final_framerate).blur( last_blur).converttoYV12().addborders(bord_left, bord_top, bord_right, bord_bot)


    #RESULT3: AUTOLEVELS, MANUAL COLOR CORRECTIONS
    #................................................. .................................................. ..............................................
    result3= denoised.coloryuv(off_U=blue,off_V=red).addborders (X,0,0,0,$FFFFFF).addborders(0,0,X2,0,$000000).aut olevels().crop(X,0,-X2,-0)\
    .converttoYUY2().ConvertFPS(final_framerate).blur( last_blur).converttoYV12().addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT4: MANUAL LEVELS, MANUAL COLOR CORRECTIONS
    #................................................. .................................................. ...............................................
    result4= denoised.coloryuv(off_U=blue,off_V=red).levels(bla ck_level,1.0,white_level,0,255)\
    .converttoYUY2().ConvertFPS(final_framerate).blur( last_blur).converttoYV12().addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT5: SPECIAL SERVICE CLIP FOR RESULT S5
    #................................................. .................................................. ...............................................
    result5= overlay(source1,stab_reference,x=est_left,y=est_to p).addborders(2,2,2,2,$FFFFFF).Lanczos4Resize(WS,H S)




    #PARAMETERS FOR THE COMPARISONS
    #................................................. .................................................. ...............................................
    W2= W+bord_left+bord_right
    H2= H+bord_top+bord_bot





    source4=Lanczos4Resize(source1,W2,H2).changeFPS(fi nal_framerate)



    #COMPARISONS: ORIGINAL VS RESULTS
    #................................................. .................................................. .................................................. .................
    resultS1= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result1,"result1: autolevels, autowhite",size=28,align=2))
    resultS2= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result2,"resuls2: autowhite, manual levels correction",size=28,align=2))
    resultS3= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result3,"result3: autolevels, manual color correction",size=28,align=2))
    resultS4= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result4,"result4: manual colors and levels correction",size=28,align=2))


    #SPECIAL COMPARISON CLIP FOR TESTING THE STABILIZER
    #................................................. .................................................. .................................................. ....................
    resultS5= 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))

    SetMTMode(5)

    Eval(result)
    Quote Quote  
  15. Hey.I got another problem with the scripts.the original one was meant to make a comparision between videos and I wanted to know if it's possible to delete it.

    Script:

    # film restoration script by videoFred.
    # modified 30 august 2010
    # version with frame blending
    # added removedirtMC() as suggested by John Meyer
    # cleaning, degraining, resizing, stabilizing, sharpening, auto-levels and auto-white balance.
    #================================================= ============================================



    film="D:\03_RemoveDirtMC.avi" # source clip, please specify the full path here


    #PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    result="resultS3" # specify the wanted output here

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

    final_framerate = 25 # final frame rate


    #COLOR AND LEVELS PARAMATERS
    #----------------------------------------------------------------------------------------------------------------------------
    saturation=1.4 #for all outputs

    gamma= 1.0 # for all outputs

    blue= -0 red= 0 #manual color adjustment, when returning result3 or result4. Values can be positive or negative


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


    #SIZE, CROP AND BORDERS PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    CLeft=20 CTop=20 CRight=20 CBottom=20 #crop values after Depan and before final resizing

    W=720 H=576 #final size after cropping

    bord_left=0 bord_top=0 bord_right=0 bord_bot=0 #720p= borders 150


    #STABILISING PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    maxstabH=20
    maxstabV=20 #maximum values for the stabiliser (in pixels) 20 is a good start value

    est_left=40 est_top=40 est_right=40 est_bottom=40 est_cont=1.4 #crop and contast values for special Estimate clip


    #CLEANING PARAMETERS
    #--------------------------------------------------------------------------------------------------------------

    dirt_blur= 0.1 # some blur before cleaning to avoid pixel artifacts
    dirt_strength=40 # set this lower for clean films.


    #DENOISING PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------


    denoising_strength= 800 #denoising level of second 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_size_v= 16
    block_over= 8 #block overlapping of MVDegrainMulti()




    # FOUR STEP SHARPENING PARAMETERS
    #--------------------------------------------------------------------------------------------------------------------------------

    USM_sharp_ness1= 120 USM_radi_us1= 3 #first sharpening (UnsharpMask) after cleaning with removedirtMC()

    USM_sharp_ness2= 80 USM_radi_us2=2 #second harpening (UnsharpMask) after cleaning with removedirtMC()

    USM_sharp_ness3= 70 USM_radi_us3=1 #third sharpening (UnsharpMask) after degraining with MVDegrainMulti()


    last_sharp= 0.4 #final sharpening step after interpolation

    last_blur= 0.2 #this smooths out the heavy sharpening effects


    #AUTO LEVELS PARAMETER
    #--------------------------------------------------------------------------------------------------------------------------------
    X=2 # X is a special parameter for reducing the autolevels effect on the whites
    X2=2 # X2 is a special parameter for reducing the autolevels effect on the blacks




    # END VARIABLES, BEGIN SCRIPT
    #================================================= ================================================== ==============================


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

    SetMTMode(5) #disable all MT calls if you are using a single core computer



    LoadPlugin("Deflicker.dll")
    Loadplugin("Depan.dll")
    LoadPlugin("DepanEstimate.dll")
    Loadplugin("removegrain.dll")
    LoadPlugin("removedirt.dll")
    LoadPlugin("MVTools.dll")
    LoadPlugin("MVTools2.dll")
    Loadplugin("mt_masktools.dll")
    Loadplugin("warpsharp.dll")
    LoadPlugin("MT.dll")
    LoadPlugin("autolevels.dll")
    Import("03_RemoveDirtMC.avs")




    source1= AviSource(film).assumefps(play_speed).trim(trim_be gin,0).converttoYV12()


    SetMTMode(1,0)


    #STABILIZING/CROPPING
    #................................................. .................................................. .......................................
    stab_reference= source1.crop(est_left,est_top,-est_right,-est_bottom).tweak(cont=est_cont).MT_binarize(thres hold=80).greyscale().invert()

    mdata=DePanEstimate(stab_reference,trust=1.0,dxmax =maxstabH,dymax=maxstabV)
    stab=DePanStabilize(source1,data=mdata,cutoff=0.5, dxmax=maxstabH,dymax=maxstabV,method=0,mirror=15). deflicker()
    stab2= stab.crop(CLeft,CTop,-CRight,-CBottom)
    stab3=DePanStabilize(source1,data=mdata,cutoff=0.5 ,dxmax=maxstabH,dymax=maxstabV,method=0,info=true)

    WS= width(stab)
    HS= height(stab)
    stab4= stab3.addborders(10,10,10,10,$B1B1B1).Lanczos4Resi ze(WS,HS)
    stab5= Lanczos4Resize(stab2,W,H).sharpen(0.5)


    #CLEANING/PRESHARPENING/RESIZING
    #................................................. .................................................. ........................................


    noise_baseclip= stab2.levels(0,gamma,255,0,255).tweak(sat=saturati on).blur(dirt_blur)




    cleaned= RemoveDirtMC(noise_baseclip,dirt_strength).unsharp mask(USM_sharp_ness1,USM_radi_us1,0)\
    .unsharpmask(USM_sharp_ness2,USM_radi_us2,0).Lancz os4Resize(W,H)



    #DEGRAINING/SHARPENING
    #................................................. .................................................. ..............................................



    vectors= cleaned.MVAnalyseMulti(refframes=denoising_frames, pel=2, blksize=block_size, blksizev= block_size_v, overlap=block_over, idx=1)
    denoised= cleaned.MVDegrainMulti(vectors, thSAD=denoising_strength, SadMode=1, idx=2).unsharpmask(USM_sharp_ness3,USM_radi_us3,0) \
    .sharpen(last_sharp).sharpen(last_sharp)





    #RESULT1: AUTOLEVELS,AUTOWHITE
    #................................................. .................................................. ..............................................
    result1= denoised.coloryuv(autowhite=true).addborders(X,0,0 ,0,$FFFFFF).addborders(0,0,X2,0,$000000).autolevel s().crop(X,0,-X2,-0)\
    .converttoYUY2().ConvertFPS(final_framerate).blur( last_blur).converttoYV12().addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT2: MANUAL LEVELS, AUTOWHITE
    #................................................. .................................................. ..............................................
    result2= denoised.levels(black_level,1.0,white_level,0,255) .coloryuv(autowhite=true)\
    .converttoYUY2().ConvertFPS(final_framerate).blur( last_blur).converttoYV12().addborders(bord_left, bord_top, bord_right, bord_bot)


    #RESULT3: AUTOLEVELS, MANUAL COLOR CORRECTIONS
    #................................................. .................................................. ..............................................
    result3= denoised.coloryuv(off_U=blue,off_V=red).addborders (X,0,0,0,$FFFFFF).addborders(0,0,X2,0,$000000).aut olevels().crop(X,0,-X2,-0)\
    .converttoYUY2().ConvertFPS(final_framerate).blur( last_blur).converttoYV12().addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT4: MANUAL LEVELS, MANUAL COLOR CORRECTIONS
    #................................................. .................................................. ...............................................
    result4= denoised.coloryuv(off_U=blue,off_V=red).levels(bla ck_level,1.0,white_level,0,255)\
    .converttoYUY2().ConvertFPS(final_framerate).blur( last_blur).converttoYV12().addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT5: SPECIAL SERVICE CLIP FOR RESULT S5
    #................................................. .................................................. ...............................................
    result5= overlay(source1,stab_reference,x=est_left,y=est_to p).addborders(2,2,2,2,$FFFFFF).Lanczos4Resize(WS,H S)




    #PARAMETERS FOR THE COMPARISONS
    #................................................. .................................................. ...............................................
    W2= W+bord_left+bord_right
    H2= H+bord_top+bord_bot





    source4=Lanczos4Resize(source1,W2,H2).changeFPS(fi nal_framerate)



    #COMPARISONS: ORIGINAL VS RESULTS
    #................................................. .................................................. .................................................. .................
    resultS1= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result1,"result1: autolevels, autowhite",size=28,align=2))
    resultS2= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result2,"resuls2: autowhite, manual levels correction",size=28,align=2))
    resultS3= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result3,"result3: autolevels, manual color correction",size=28,align=2))
    resultS4= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result4,"result4: manual colors and levels correction",size=28,align=2))


    #SPECIAL COMPARISON CLIP FOR TESTING THE STABILIZER
    #................................................. .................................................. .................................................. ....................
    resultS5= 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))

    SetMTMode(5)

    Eval(result)
    Last edited by Dr.Who; 9th Oct 2010 at 14:04.
    Quote Quote  
  16. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by Dr.Who View Post
    Hey.I got another problem with the scripts.the original one was meant to make a comparision between videos and I wanted to know if it's possible to delete it.
    Change the line
    Code:
    result="resultS3" # specify the wanted output here
    to
    Code:
    result="result3" # specify the wanted output here
    That line specifies which of the various results you want the script to produce.

    See the script for what the different results are, eg
    Code:
    #RESULT3: AUTOLEVELS, MANUAL COLOR CORRECTIONS
    By adding 'S' in the name, eg resultS3, you get a comparison with the original.
    Quote Quote  
  17. thank you!

    edit: it says avisynth autodetect: couldn't open file error code 2...
    Last edited by Dr.Who; 9th Oct 2010 at 05:54.
    Quote Quote  
  18. Sorry for double post,but,nobody?
    Quote Quote  
  19. film="D:\03_RemoveDirtMC.avi" # source clip, please specify the full path here
    replace that line with your filename with full path

    You have to modify a lot of the script for your specific source - videofred's script is for 8mm film transfer and the frame rate will be incorrect
    Quote Quote  
  20. The script you posted has many space characters in the middle of names and numbers. Are those actually in the script or is it just the post that's messed up? For example, near the end is the line:

    resultS1= stackhorizontal(subtitle(source4,"original",size=2 8,align=2)...
    There's a space between the 2 and 8 of what should read "size=28". And in:

    result4= denoised.coloryuv(off_U=blue,off_V=red).levels(bla ck_level,1.0,white_level,0,255)\
    There a space between the a and c of what should read "black_level".

    All the loadplugin() lines need the full path to the files.
    Quote Quote  
  21. @poisondeathray - that's the filename with the full path
    @jagabo it's because of the page.
    Quote Quote  
  22. Originally Posted by Dr.Who View Post
    avisynth autodetect: couldn't open file error code 2...
    That means the file wasn't found. Are you sure the filename is correct?

    film="D:\03_RemoveDirtMC.avi" # source clip, please specify the full path here
    Is the name of the file really "D:\03_RemoveDirtMC.avi" ?
    Quote Quote  
  23. Yeah that's the name.This is the personalised version of the script.
    This is the original version:


    # film restoration script by videoFred.
    # version with frame interpolation
    # modified 30 august 2010
    # added removedirtMC() as suggested by John Meyer
    # cleaning, degraining, resizing, stabilizing, sharpening, auto-levels and auto-white balance.
    #================================================= ============================================



    film="K:\02-dodcaps\PDS\1967\pds_1967.04.avi" # source clip, please specify the full path here


    #PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    result="resultS3" # specify the wanted output here

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

    numerator= 25 #numerator for the interpolator (final frame rate)
    denumerator= 1 #denumerator example: 60000/1001= 59.94fps


    #COLOR AND LEVELS PARAMATERS
    #----------------------------------------------------------------------------------------------------------------------------
    saturation=1.2 #for all outputs

    gamma= 1.0 # for all outputs

    blue= -0 red= -0 #manual color adjustment, when returning result3 or result4. Values can be positive or negative


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


    #SIZE, CROP AND BORDERS PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    CLeft=20 CTop=20 CRight=20 CBottom=20 #crop values after Depan and before final resizing

    W=720 H=576 #final size after cropping

    bord_left=0 bord_top=0 bord_right=0 bord_bot=0 #720p= borders 150


    #STABILISING PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    maxstabH=20
    maxstabV=20 #maximum values for the stabiliser (in pixels) 20 is a good start value

    est_left=40 est_top=40 est_right=40 est_bottom=40 est_cont=1.4 #crop and contast values for special Estimate clip


    #CLEANING PARAMETERS
    #--------------------------------------------------------------------------------------------------------------

    dirt_blur= 0.1 # some blur before cleaning to avoid pixel artifacts
    dirt_strength=40 # set this lower for clean films.


    #DENOISING PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------


    denoising_strength= 900 #denoising level of second denoiser: MVDegrainMulti()
    denoising_frames= 3 #number of frames for averaging (forwards and backwards) 3 is a good start value
    block_size= 16 #block size of MVDegrainMulti()
    block_size_v= 16
    block_over= 8 #block overlapping of MVDegrainMulti()




    # FOUR STEP SHARPENING PARAMETERS
    #--------------------------------------------------------------------------------------------------------------------------------

    USM_sharp_ness1= 120 USM_radi_us1= 3 #first sharpening (UnsharpMask) after cleaning with removedirtMC()

    USM_sharp_ness2= 80 USM_radi_us2=2 #second harpening (UnsharpMask) after cleaning with removedirtMC()

    USM_sharp_ness3= 70 USM_radi_us3=1 #third sharpening (UnsharpMask) after degraining with MVDegrainMulti()


    last_sharp= 0.4 #final sharpening step after interpolation

    last_blur= 0.2 #this smooths out the heavy sharpening effects



    #AUTO LEVELS PARAMETER
    #--------------------------------------------------------------------------------------------------------------------------------
    X=2 # X is a special parameter for reducing the autolevels effect on the whites
    X2=2 # X2 is a special parameter for reducing the autolevels effect on the blacks




    # END VARIABLES, BEGIN SCRIPT
    #================================================= ================================================== ==============================


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

    SetMTMode(5) #disable all MT calls if you are using a single core computer

    LoadPlugin("Deflicker.dll")
    Loadplugin("Depan.dll")
    LoadPlugin("DepanEstimate.dll")
    Loadplugin("removegrain.dll")
    LoadPlugin("removedirt.dll")
    LoadPlugin("MVTools.dll")
    LoadPlugin("MVTools2.dll")
    Loadplugin("mt_masktools.dll")
    Loadplugin("warpsharp.dll")
    LoadPlugin("MT.dll")
    LoadPlugin("autolevels.dll")
    Import("03_RemoveDirtMC.avs")






    source1= AviSource(film).assumefps(play_speed).trim(trim_be gin,0).converttoYV12()


    SetMTMode(1,0)


    #STABILIZING/CROPPING
    #................................................. .................................................. ........................................
    stab_reference= source1.crop(est_left,est_top,-est_right,-est_bottom).tweak(cont=est_cont).MT_binarize(thres hold=80).greyscale().invert()

    mdata=DePanEstimate(stab_reference,trust=1.0,dxmax =maxstabH,dymax=maxstabV)
    stab=DePanStabilize(source1,data=mdata,cutoff=0.5, dxmax=maxstabH,dymax=maxstabV,method=0,mirror=15). deflicker()
    stab2= stab.crop(CLeft,CTop,-CRight,-CBottom)
    stab3=DePanStabilize(source1,data=mdata,cutoff=0.5 ,dxmax=maxstabH,dymax=maxstabV,method=0,info=true)

    WS= width(stab)
    HS= height(stab)
    stab4= stab3.addborders(10,10,10,10,$B1B1B1).Lanczos4Resi ze(WS,HS)
    stab5= Lanczos4Resize(stab2,W,H).sharpen(0.5)


    #CLEANING/PRESHARPENING/RESIZING
    #................................................. .................................................. .......................................


    noise_baseclip= stab2.levels(0,gamma,255,0,255).tweak(sat=saturati on).blur(dirt_blur)




    cleaned= RemoveDirtMC(noise_baseclip,dirt_strength).unsharp mask(USM_sharp_ness1,USM_radi_us1,0)\
    .unsharpmask(USM_sharp_ness2,USM_radi_us2,0).Lancz os4Resize(W,H)



    #DEGRAINING/SHARPENING
    #................................................. .................................................. .................................................. ..............


    vectors= cleaned.MVAnalyseMulti(refframes=denoising_frames, pel=2, blksize=block_size, blksizev= block_size_v, overlap=block_over, idx=1)
    denoised= cleaned.MVDegrainMulti(vectors, thSAD=denoising_strength, SadMode=1, idx=2).unsharpmask(USM_sharp_ness3,USM_radi_us3,0)






    #CHANGING FRAME RATE WITH INTERPOLATION/FINALSHARPENING
    #................................................. .................................................. .................................................. .......

    super= denoised.MSuper()
    backward_vec= MAnalyse(super, blksize=block_size, blksizev= block_size_v, overlap=block_over, isb=true)
    forward_vec= MAnalyse(super,blksize=block_size, blksizev= block_size_v, overlap=block_over, isb= false)

    interpolated= denoised.MFlowFps(super, backward_vec, forward_vec, num=numerator, den= denumerator, ml=100)\
    .sharpen(last_sharp).sharpen(last_sharp).blur(last _blur)


    #RESULT1: AUTOLEVELS,AUTOWHITE
    #................................................. .................................................. .................................................. .................
    result1= interpolated.coloryuv(autowhite=true).addborders(X ,0,0,0,$FFFFFF).addborders(0,0,X2,0,$000000)\
    .autolevels().crop(X,0,-X2,-0).addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT2: MANUAL LEVELS, AUTOWHITE
    #................................................. .................................................. .................................................. .................
    result2= interpolated.levels(black_level,1.0,white_level,0, 255).coloryuv(autowhite=true)\
    .addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT3: AUTOLEVELS, MANUAL COLOR CORRECTIONS
    #................................................. .................................................. .................................................. ................
    result3= interpolated.coloryuv(off_U=blue,off_V=red).addbor ders(X,0,0,0,$FFFFFF)\
    .addborders(0,0,X2,0,$000000).autolevels().crop(X, 0,-X2,-0).addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT4: MANUAL LEVELS, MANUAL COLOR CORRECTIONS
    #................................................. .................................................. .................................................. ................
    result4= interpolated.coloryuv(off_U=blue,off_V=red).levels (black_level,1.0,white_level,0,255)\
    .addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT5: SPECIAL SERVICE CLIP FOR RESULT S5
    #................................................. .................................................. .................................................. ................
    result5= overlay(source1,stab_reference,x=est_left,y=est_to p).addborders(2,2,2,2,$FFFFFF).Lanczos4Resize(WS,H S)




    #PARAMETERS FOR THE COMPARISONS
    #................................................. .................................................. .................................................. ................
    W2= W+bord_left+bord_right
    H2= H+bord_top+bord_bot




    final_framerate= numerator/denumerator
    source4=Lanczos4Resize(source1,W2,H2).changeFPS(fi nal_framerate)



    #COMPARISONS: ORIGINAL VS RESULTS
    #................................................. .................................................. .................................................. .................
    resultS1= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result1,"result1: autolevels, autowhite",size=28,align=2))
    resultS2= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result2,"result2: autowhite, manual levels correction",size=28,align=2))
    resultS3= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result3,"result3: autolevels, manual color correction",size=28,align=2))
    resultS4= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result4,"result4: manual colors and levels correction",size=28,align=2))


    #SPECIAL COMPARISON CLIP FOR TESTING THE STABILIZER
    #................................................. .................................................. .................................................. ....................
    resultS5= 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))

    SetMTMode(5)

    Eval(result)
    Quote Quote  
  24. Yeah that's the name.This is the personalised version of the script.
    This is the original version:


    # film restoration script by videoFred.
    # version with frame interpolation
    # modified 30 august 2010
    # added removedirtMC() as suggested by John Meyer
    # cleaning, degraining, resizing, stabilizing, sharpening, auto-levels and auto-white balance.
    #================================================= ============================================



    film="K:\02-dodcaps\PDS\1967\pds_1967.04.avi" # source clip, please specify the full path here


    #PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    result="resultS3" # specify the wanted output here

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

    numerator= 25 #numerator for the interpolator (final frame rate)
    denumerator= 1 #denumerator example: 60000/1001= 59.94fps


    #COLOR AND LEVELS PARAMATERS
    #----------------------------------------------------------------------------------------------------------------------------
    saturation=1.2 #for all outputs

    gamma= 1.0 # for all outputs

    blue= -0 red= -0 #manual color adjustment, when returning result3 or result4. Values can be positive or negative


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


    #SIZE, CROP AND BORDERS PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    CLeft=20 CTop=20 CRight=20 CBottom=20 #crop values after Depan and before final resizing

    W=720 H=576 #final size after cropping

    bord_left=0 bord_top=0 bord_right=0 bord_bot=0 #720p= borders 150


    #STABILISING PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------
    maxstabH=20
    maxstabV=20 #maximum values for the stabiliser (in pixels) 20 is a good start value

    est_left=40 est_top=40 est_right=40 est_bottom=40 est_cont=1.4 #crop and contast values for special Estimate clip


    #CLEANING PARAMETERS
    #--------------------------------------------------------------------------------------------------------------

    dirt_blur= 0.1 # some blur before cleaning to avoid pixel artifacts
    dirt_strength=40 # set this lower for clean films.


    #DENOISING PARAMETERS
    #----------------------------------------------------------------------------------------------------------------------------


    denoising_strength= 900 #denoising level of second denoiser: MVDegrainMulti()
    denoising_frames= 3 #number of frames for averaging (forwards and backwards) 3 is a good start value
    block_size= 16 #block size of MVDegrainMulti()
    block_size_v= 16
    block_over= 8 #block overlapping of MVDegrainMulti()




    # FOUR STEP SHARPENING PARAMETERS
    #--------------------------------------------------------------------------------------------------------------------------------

    USM_sharp_ness1= 120 USM_radi_us1= 3 #first sharpening (UnsharpMask) after cleaning with removedirtMC()

    USM_sharp_ness2= 80 USM_radi_us2=2 #second harpening (UnsharpMask) after cleaning with removedirtMC()

    USM_sharp_ness3= 70 USM_radi_us3=1 #third sharpening (UnsharpMask) after degraining with MVDegrainMulti()


    last_sharp= 0.4 #final sharpening step after interpolation

    last_blur= 0.2 #this smooths out the heavy sharpening effects



    #AUTO LEVELS PARAMETER
    #--------------------------------------------------------------------------------------------------------------------------------
    X=2 # X is a special parameter for reducing the autolevels effect on the whites
    X2=2 # X2 is a special parameter for reducing the autolevels effect on the blacks




    # END VARIABLES, BEGIN SCRIPT
    #================================================= ================================================== ==============================


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

    SetMTMode(5) #disable all MT calls if you are using a single core computer

    LoadPlugin("Deflicker.dll")
    Loadplugin("Depan.dll")
    LoadPlugin("DepanEstimate.dll")
    Loadplugin("removegrain.dll")
    LoadPlugin("removedirt.dll")
    LoadPlugin("MVTools.dll")
    LoadPlugin("MVTools2.dll")
    Loadplugin("mt_masktools.dll")
    Loadplugin("warpsharp.dll")
    LoadPlugin("MT.dll")
    LoadPlugin("autolevels.dll")
    Import("03_RemoveDirtMC.avs")






    source1= AviSource(film).assumefps(play_speed).trim(trim_be gin,0).converttoYV12()


    SetMTMode(1,0)


    #STABILIZING/CROPPING
    #................................................. .................................................. ........................................
    stab_reference= source1.crop(est_left,est_top,-est_right,-est_bottom).tweak(cont=est_cont).MT_binarize(thres hold=80).greyscale().invert()

    mdata=DePanEstimate(stab_reference,trust=1.0,dxmax =maxstabH,dymax=maxstabV)
    stab=DePanStabilize(source1,data=mdata,cutoff=0.5, dxmax=maxstabH,dymax=maxstabV,method=0,mirror=15). deflicker()
    stab2= stab.crop(CLeft,CTop,-CRight,-CBottom)
    stab3=DePanStabilize(source1,data=mdata,cutoff=0.5 ,dxmax=maxstabH,dymax=maxstabV,method=0,info=true)

    WS= width(stab)
    HS= height(stab)
    stab4= stab3.addborders(10,10,10,10,$B1B1B1).Lanczos4Resi ze(WS,HS)
    stab5= Lanczos4Resize(stab2,W,H).sharpen(0.5)


    #CLEANING/PRESHARPENING/RESIZING
    #................................................. .................................................. .......................................


    noise_baseclip= stab2.levels(0,gamma,255,0,255).tweak(sat=saturati on).blur(dirt_blur)




    cleaned= RemoveDirtMC(noise_baseclip,dirt_strength).unsharp mask(USM_sharp_ness1,USM_radi_us1,0)\
    .unsharpmask(USM_sharp_ness2,USM_radi_us2,0).Lancz os4Resize(W,H)



    #DEGRAINING/SHARPENING
    #................................................. .................................................. .................................................. ..............


    vectors= cleaned.MVAnalyseMulti(refframes=denoising_frames, pel=2, blksize=block_size, blksizev= block_size_v, overlap=block_over, idx=1)
    denoised= cleaned.MVDegrainMulti(vectors, thSAD=denoising_strength, SadMode=1, idx=2).unsharpmask(USM_sharp_ness3,USM_radi_us3,0)






    #CHANGING FRAME RATE WITH INTERPOLATION/FINALSHARPENING
    #................................................. .................................................. .................................................. .......

    super= denoised.MSuper()
    backward_vec= MAnalyse(super, blksize=block_size, blksizev= block_size_v, overlap=block_over, isb=true)
    forward_vec= MAnalyse(super,blksize=block_size, blksizev= block_size_v, overlap=block_over, isb= false)

    interpolated= denoised.MFlowFps(super, backward_vec, forward_vec, num=numerator, den= denumerator, ml=100)\
    .sharpen(last_sharp).sharpen(last_sharp).blur(last _blur)


    #RESULT1: AUTOLEVELS,AUTOWHITE
    #................................................. .................................................. .................................................. .................
    result1= interpolated.coloryuv(autowhite=true).addborders(X ,0,0,0,$FFFFFF).addborders(0,0,X2,0,$000000)\
    .autolevels().crop(X,0,-X2,-0).addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT2: MANUAL LEVELS, AUTOWHITE
    #................................................. .................................................. .................................................. .................
    result2= interpolated.levels(black_level,1.0,white_level,0, 255).coloryuv(autowhite=true)\
    .addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT3: AUTOLEVELS, MANUAL COLOR CORRECTIONS
    #................................................. .................................................. .................................................. ................
    result3= interpolated.coloryuv(off_U=blue,off_V=red).addbor ders(X,0,0,0,$FFFFFF)\
    .addborders(0,0,X2,0,$000000).autolevels().crop(X, 0,-X2,-0).addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT4: MANUAL LEVELS, MANUAL COLOR CORRECTIONS
    #................................................. .................................................. .................................................. ................
    result4= interpolated.coloryuv(off_U=blue,off_V=red).levels (black_level,1.0,white_level,0,255)\
    .addborders(bord_left, bord_top, bord_right, bord_bot)

    #RESULT5: SPECIAL SERVICE CLIP FOR RESULT S5
    #................................................. .................................................. .................................................. ................
    result5= overlay(source1,stab_reference,x=est_left,y=est_to p).addborders(2,2,2,2,$FFFFFF).Lanczos4Resize(WS,H S)




    #PARAMETERS FOR THE COMPARISONS
    #................................................. .................................................. .................................................. ................
    W2= W+bord_left+bord_right
    H2= H+bord_top+bord_bot




    final_framerate= numerator/denumerator
    source4=Lanczos4Resize(source1,W2,H2).changeFPS(fi nal_framerate)



    #COMPARISONS: ORIGINAL VS RESULTS
    #................................................. .................................................. .................................................. .................
    resultS1= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result1,"result1: autolevels, autowhite",size=28,align=2))
    resultS2= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result2,"result2: autowhite, manual levels correction",size=28,align=2))
    resultS3= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result3,"result3: autolevels, manual color correction",size=28,align=2))
    resultS4= stackhorizontal(subtitle(source4,"original",size=2 8,align=2),subtitle(result4,"result4: manual colors and levels correction",size=28,align=2))


    #SPECIAL COMPARISON CLIP FOR TESTING THE STABILIZER
    #................................................. .................................................. .................................................. ....................
    resultS5= 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))

    SetMTMode(5)

    Eval(result)
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!