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?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
-
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)
-
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) -
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.
Similar Threads
-
AviSynth - Looping through frames?
By Mister Epic in forum EditingReplies: 13Last Post: 25th Apr 2014, 11:23 -
Avisynth : Encoding Issues (Out Of Memory and Frames Count)
By DayDreamer3d in forum EditingReplies: 8Last Post: 8th Nov 2013, 00:36 -
applying different filters to different sections in a clip (via avisynth)
By unclescoob in forum RestorationReplies: 28Last Post: 30th Jan 2012, 14:50 -
Virtualdub VCR capture no dropped frames but 5400 inserted frames in 1 hour
By suloku in forum Capturing and VCRReplies: 12Last Post: 17th Aug 2011, 23:33 -
How do you blur selected frames in AVIsynth?
By Nagashi in forum EditingReplies: 4Last Post: 9th Jan 2011, 20:30