VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or buy Replay Video Capture or PlayON and record Netflix, HBO, etc! :)
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. I've been fiddling with Avisynth and AvsPmod (for later encoding in Megui) for about a month now, trying different things, so I have a pretty good grasp on things. However I can't quite figure out how to apply Avisynth filters to certain frames as well as all the frames. This is the example I'm following:

    clip=AviSource(clip.avi)
    clip1=Trim(clip, 0, 1999)
    clip2=Trim(clip, 2000, 3000).Tweak(sat=0.5)
    clip3=Trim(clip, 3001, 0)
    final_clip=clip1 + clip2 + clip3
    ConvertYUY(final_clip)

    Which seems pretty self-explanatory to me. But as far as translating it to my script, I'm a little confused.
    Here is my script (please note that I am using Avisynth 2.6 MT):

    LoadPlugin("C:\Program Files\MeGUI\tools\dgindex\DGDecode.dll")
    SetMemoryMax (1804)
    SetMTMode(5, 0)
    # Set DAR in encoder to 67 : 49. The following line is for automatic signalling
    global MeGUI_darx = 67
    global MeGUI_dary = 49
    Source=DGDecode_mpeg2source("C:\Users\Travis\Video s\Movies + TV Show Rips\TMNT (1987 TV Series)\Season 1\AVS Scripts\Episode 2\VTS_02_1.d2v", info=3, CPU=6) .tfm(order=1).tdecimate(mode=1,hybrid=1)
    part1=Trim(Source, 0, 1440) .crop(2, 2, -4, 0) .Spline36Resize(720,540)
    part2=Trim(Source, 1440, 0) .Spline36Resize(720,540)
    final=part1+part2
    Return final
    SetMTMode(2, 0)
    super = MSuper(pel=2, sharp=1)
    backward_vec3 = MAnalyse(super, isb = true, delta = 3, overlap=4)
    backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
    backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
    forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
    forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
    forward_vec3 = MAnalyse(super, isb = false, delta = 3, overlap=4)
    MDegrain3(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, backward_vec3, forward_vec3, thSAD=400)
    FastLineDarkenMod(strength=48, luma_cap=191, threshold=4, thinning=24)
    naa()
    DeHalo_alpha_mt(darkstr=1.0, brightstr=1.0, ss=2.0)
    distributor()
    Return(last)

    But when I use my variable "final" for my filters, so I can filter the whole video, like so:

    super = MSuper(final, pel=2, sharp=1)
    MDegrain3(final, super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, backward_vec3, forward_vec3, thSAD=400)
    FastLineDarkenMod(final, strength=48, luma_cap=191, threshold=4, thinning=24)
    naa(final)
    DeHalo_alpha_mt(darkstr=1.0, brightstr=1.0, ss=2.0)


    It has no effect on my video. What am I doing wrong?
    Quote Quote  
  2. delete the 'Return final' or your scripts ends there,...

    Code:
    LoadPlugin("C:\Program Files\MeGUI\tools\dgindex\DGDecode.dll")
    SetMemoryMax (1804)
    SetMTMode(5, 0)
    # Set DAR in encoder to 67 : 49. The following line is for automatic signalling
    global MeGUI_darx = 67
    global MeGUI_dary = 49
    Source=DGDecode_mpeg2source("C:\Users\Travis\Video s\Movies + TV Show Rips\TMNT (1987 TV Series)\Season 1\AVS Scripts\Episode 2\VTS_02_1.d2v", info=3, CPU=6) .tfm(order=1).tdecimate(mode=1,hybrid=1)
    part1=Trim(Source, 0, 1440).crop(2, 2, -4, 0) .Spline36Resize(720,540)
    part2=Trim(Source, 1440, 0).Spline36Resize(720,540)
    final=part1+part2
    SetMTMode(2, 0)
    super = final.MSuper(pel=2, sharp=1) # after this line final is not needed anymore, everything that follows uses the implicit 'last' or something that derives from 'super'
    backward_vec3 = MAnalyse(super, isb = true, delta = 3, overlap=4)
    backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
    backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
    forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
    forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
    forward_vec3 = MAnalyse(super, isb = false, delta = 3, overlap=4)
    MDegrain3(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, backward_vec3, forward_vec3, thSAD=400)
    #all the following lines use the implicit 'last' parameter
    FastLineDarkenMod(strength=48, luma_cap=191, threshold=4, thinning=24)
    naa()
    DeHalo_alpha_mt(darkstr=1.0, brightstr=1.0, ss=2.0)
    distributor()
    Return(last)
    Quote Quote  
  3. Okay, that makes sense to me now, thank you. Except now it is giving me the following error:
    Script error: Invalid arguments to function "MDegrain3" (line 19)
    How do I go about solving this?
    Quote Quote  
  4. Originally Posted by DarkSamus993 View Post

    part1=Trim(Source, 0, 1440) .crop(2, 2, -4, 0) .Spline36Resize(720,540)
    part2=Trim(Source, 1440, 0) .Spline36Resize(720,540)
    final=part1+part2

    I doubt you intentionally increased the frame count by one. Maybe this would be better:

    part1=Trim(Source, 0, 1440) .crop(2, 2, -4, 0) .Spline36Resize(720,540)
    part2=Trim(Source, 1441, 0) .Spline36Resize(720,540)
    final=part1+part2

    And so that your crop and resize filters actually get used, even better might be:

    part1=Trim(Source, 0, 1440) .crop(2, 2, -4, 0) .Spline36Resize(720,540)
    part2=Trim(Source, 1441, 0) .Spline36Resize(720,540)
    part1+part2

    And, as selur suggested, leave off the 'return final' or nothing happens after that command.
    Quote Quote  
  5. Wow, you guys are quick! Thank you, that did indeed solve the problem.
    Quote Quote  



Similar Threads