not working properly yet, i'm not sure what im doing wrong i'm uploading the processed video atm here's the script so far: #Setmemorymax(512) ############################################################################### LoadPlugin("C:\Video-tools\avisynth 2.5\plugins\FrameSel.dll") LoadPlugin("C:\Video-tools\avisynth 2.5\plugins\Prune.dll") LoadPlugin("C:\Video-tools\avisynth 2.5\plugins\RT_Stats.dll") LoadPlugin("C:\Video-tools\avisynth 2.5\plugins\GScript.dll") ############################################################################### #DirectShowSource("F:\Video-Capture\First Day At School 24.avi").converttoYV12() #for Win64 AVISource("D:\Temp\Video-edit2\Dropped Frames\Question\Black_drops_sample.avi").converttoYV12().killaudio #Colorbars.ConvertToYV12.killAudio A=Trim(0,-100) B=A.Levels(16,1.0,235,16,50,Coring=false) A++B++A GreyMouse(Last,DelPre=10,delPost=20) Function GreyMouse(clip c, Float "Th",Int "delPre",Int "delPost",String "FramesFile") { # Does NOT return until FramesFile created. # Req RT_Stats, GScript(c) Gavino. c Th = Float(Default(Th, 64.0)) # AverageLuma <= Th ==== DARK delPre = Default(delPre, 0) # Number of frames to drop before first dark one delPost = Default(delPost, 0) # Number of frames to drop after last dark one FramesFile = Default(FramesFile, "Frames.txt") # Output file RT_GetFullPathName(FramesFile) RT_FileDelete(FramesFile) GSCript(""" c FC=FrameCount WrE = -1 for(i=0,FC-1) { if(RT_AverageLuma(n=i) <= Th) { sLight=FC for(j=i+1,FC-1) { if(RT_AverageLuma(n=j) > Th) { sLight = j j = FC # Break } } WrS = Max(WrE+1,i-delPre) WrE = Min(sLight-1+delPost,FC-1) RT_WriteFile(FramesFile,"%d,%d",WrS,WrE,Append=True) i=WrE # Next i iteration continue at WrE + 1 } } """) return c #Return MessageClip("FrameFile Created") } Function RejectRanges(clip c,String "SCmd",String "Cmd",Bool "TrimAudio",Float "FadeMS") { # RejectRanges() by StainlessS. Required:- FrameSel, Prune, RT_Stats # Wrapper to delete frames/ranges along with audio, can supply frames/ranges in SCmd string And/Or Cmd file. # The wrapper makes for easier usage of Prune() which supports up to 256 input clips, but requires a clip index, # eg '3, 100,200' would specify clip 3, range 100 to 200. The wrapper does away with the necessity for the clip index as we # are only using a single clip here. Prune also does not have a 'reject' arg to delete specified frames rather than select them, # this wrapper also converts a list of frames to delete into a list of frames to select so that we can use Prune and its audio # capability. # # SCmd: Frames/Ranges specified in String (Frames/Ranges either Chr(10) or ';' separated, infix ',' specifies range, eg 'start,end'). # Cmd: Frames/Ranges specified in file (one frame/range per line, comments also allowed, see FrameSel for Further info). # TrimAudio: # True(default), deletes audio belonging to deleted frames # False, returns original audio, probably out of sync. # FadeMS: (default 1.0 millisec). Linear Audio Fade duration at splices when TrimAudio==true, 0 = dont fade (might result in audio 'clicks/cracks'). c TrimAudio=Default(TrimAudio,True) # default true trims audio, false returns original audio (audiodubbed, as Framesel returns no audio) FadeMS=Float(Default(FadeMS,1.0)) # 1 millisecond linear fadeout/fadein at splices PruneCmd = (TrimAudio) ? "~Prune_"+RT_LocalTimeString+".txt" : "" (!TrimAudio) \ ? FrameSel(scmd=SCmd,cmd=Cmd,reject=true) \ : FrameSel_CmdReWrite(PruneCmd,scmd=SCmd,cmd=Cmd,reject=true,Prune=True,range=true) (TrimAudio) ? Prune(Cmd=PruneCmd,FadeIn=True,FadeSplice=True,FadeOut=True,Fade=FadeMS) : NOP # If TrimAudio==true then delete Prune temp file, Else restore original Audio to the now audio-less clip (TrimAudio) \ ? RT_FileDelete(PruneCmd) \ : (c.HasAudio) ? AudioDub(c) : NOP Return Last }