VideoHelp Forum
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Member
    Join Date
    Dec 2003
    Location
    north america
    Search Comp PM
    i have a restoration script that works pretty well for my materials. nothing like what johnmeyer and videofred have done but it does make my old film material look good. it's painfully slow, though.

    in playing with the scripts from johnmeyer and videofred, i've found just how much of a difference multithreading and memory make to render time. i've put 'SetMemoryMax(24576)' into the script and it made a huge difference (i have 32gb). i've not been able to figure out how to get multithreading to work, though. i have twelve cores. for the testing i did on john meyer's script i used nine threads and it made a significant difference. can anyone post what i need to add/change to get that working? here's my script:
    Code:
    import("/home/babag/.wine/drive_c/Program Files (x86)/AviSynth+/plugins+/RemoveDirtMC.avs")
    
    FFMPEGSource2("input.mov", atrack=1)
    #LSmashVideoSource("input.mov")
    z_ConvertFormat(pixel_type="YUV420P16")     # Preserve 10 bit
    
    #threads=9
    
    SetMemoryMax(24576)
    
    BilinearResize(width/2, height/2)
    KNLMeansCL(d=1, h=1.6, a=1, s=4)
    
    RemoveDirtMC(60, false)
    
    UnsharpMask2(strength=50, radius=2, threshold=0)
    
    nnedi3_rpow2(2, cshift="Spline36Resize")
    KNLMeansCL(d=1, h=10, a=2, s=4)
    
    GrainFactory3(g1str=39, g2str=45, g3str=0, g1shrp=100, g2shrp=100, g3shrp=100, g1size=4.00, g2size=4.00, g3size=0.5, g1tex=30, g2tex=30, g3tex=30, temp_avg=0, th1=24, th2=56, th3=128, th4=160, ontop_grain=10)
    Sharpen(0.50)           #   Accepts values -1.58 to 1.0
    
    Levels(4400,1.2,65535,0,65535, false)     # 16 bit values
    
    #Prefetch(9)
    thanks,
    babag
    Quote Quote  
  2. a. read: http://avisynth.nl/index.php/SetFilterMTMode
    b. try adding:
    Code:
    SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
    at the top
    and add back the
    Code:
    Prefetch(9)
    at the end.
    But no clue whether this will work at all in wine,...

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. Member
    Join Date
    Dec 2003
    Location
    north america
    Search Comp PM
    thanks, selur.

    tried your suggestions and am getting an error regarding masktools2 and knlmeanscl.

    as for wine, i've gotten most of johnmeyers restoration script to run as well as videofred's stabilisation script. also, many simpler ones of my own so i don't think wine is an issue. on the other hand, i know next to nothing about this stuff and am pretty much restricted to copy/pasting things people here and elsewhere tell me to.

    thanks again,
    babag
    Quote Quote  
  4. tried your suggestions and am getting an error regarding masktools2 and knlmeanscl.
    I hope you don't expect anyone to guess what that error might be?
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  5. Member
    Join Date
    Dec 2003
    Location
    north america
    Search Comp PM
    you're gonna take all the fun out of it!

    Code:
    Avisynth read error:
    masktools2 error on invoking "Expr" call with
    use_expr: masktools2 error on invoking "Expr"call 
    with use_expr: KNLMeansCL: fatal error!
    (AviSynthGetFrame)
    it seemed odd to me and redundant and long for retyping in here so i wasn't sure what to do. hope this makes sense to someone.

    when i open the script in virtualdub2, the screen is gray. if i try to render the file, or a section of it, i get the above error.

    thanks (and sorry),
    babag
    Quote Quote  
  6. I assume you are using Avisynth+, right?
    What masktools2 version are you using? Masktools v2.2.30 (20220219) from https://github.com/pinterf/masktools/releases/ ?
    For KNLMeansCL, which requires opencl I suspect a problem with wine. Does it make a difference if you use device_type="cpu" ?

    Cu Selur

    Ps.: I would recommend to move the sharpen over the GrainFactory3 call, assuming you do not want to increase the sharpness of the grain you are adding.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  7. Member
    Join Date
    Dec 2003
    Location
    north america
    Search Comp PM
    thanks again, selur.

    yes to both the avisynth and masktools2 questions. yes it's avisynth+ and yes, it's the version of masktools2 you reference.

    how would i use the device_type="cpu" code? is that a standalone line? a parameter for something else? if standalone, where would i put it? beginning? end? somewhere specific in the middle?

    thanksd,
    babag
    Quote Quote  
  8. Member
    Join Date
    Dec 2003
    Location
    north america
    Search Comp PM
    placing the device_type="cpu" code at the start of the script changes the error. now it's just:
    Code:
    Avisynth read error:
    KNLMeansCL: fatal error!
    _AviSynthGetFrame)
    frames still appear as gray in virtualdub2.

    babag
    Quote Quote  
  9. device_type is a parameter for KNLMeansCL, see: http://avisynth.nl/index.php/KNLMeansCL
    so change:
    Code:
    KNLMeansCL(d=1, h=10, a=2, s=4)
    to
    Code:
    KNLMeansCL(d=1, h=10, a=2, s=4, device_type="cpu")
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  10. Member
    Join Date
    Dec 2003
    Location
    north america
    Search Comp PM
    ah! thanks.

    changed to as you suggest and get new error:
    Code:
    Avisynth open failure:
    KNLMeansCL: no compatible opencl platforms available!
    (z:\path\to\input.avs,
    line 104)
    fwiw, this script runs fine until i try to invoke multithreading.

    thanks again,
    babag
    Quote Quote  
  11. fine until i try to invoke multithreading.
    Then its some issue with wine (or the runtimes it uses), all those filters run fine with multithreading on Windows itself.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  12. Member
    Join Date
    Dec 2003
    Location
    north america
    Search Comp PM
    do you know of an alternative to knlmeanscl that i could try substituting?

    thanks,
    babag
    Quote Quote  
  13. fft3dfilter, neo_fft3d, hqdn3d, xNLMeans
    see over at: http://avisynth.nl/index.php/External_filters
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  14. Member
    Join Date
    Dec 2003
    Location
    north america
    Search Comp PM
    thanks! i'll look into them.
    Quote Quote  



Similar Threads

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