StainlessS
3rd December 2018, 04:10
Post #2 of 2.
IgnorePixelsOutside=Default(IgnorePixelsOutside,False)
IgnorePixelsOutsideLeft=Default(IgnorePixelsOutsideLeft,0)
IgnorePixelsOutsideRight=Default(IgnorePixelsOutsideRight,0)
IgnorePixelsOutsideTop=Default(IgnorePixelsOutsideTop,0)
IgnorePixelsOutsideBottom=Default(IgnorePixelsOutsideBottom,0)
IgnorePixelsInside=Default(IgnorePixelsInside,False)
IgnorePixelsInsideLeft=Default(IgnorePixelsInsideLeft,0)
IgnorePixelsInsideRight=Default(IgnorePixelsInsideRight,0)
IgnorePixelsInsideTop=Default(IgnorePixelsInsideTop,0)
IgnorePixelsInsideBottom=Default(IgnorePixelsInsideBottom,0)
VideoTypeInterlaced=Default(VideoTypeInterlaced,False)
VideoTypeUpperFieldFirst=Default(VideoTypeUpperFieldFirst,False)
ExtraZoomFactor=Float(Default(ExtraZoomFactor,1.0))
Assert(0.0<ExtraZoomFactor,RT_String("%s0.0 < ExtraZoomFactor(%f)",myName,ExtraZoomFactor))
MaxCorrectionLimitsHorizontalPanning=Float(Default(MaxCorrectionLimitsHorizontalPanning,15.0))
Assert(1.0<=MaxCorrectionLimitsHorizontalPanning,RT_String("%s1.0 <= MaxCorrectionLimitsHorizontalPanning(%f)",
\ myName,MaxCorrectionLimitsHorizontalPanning))
MaxCorrectionLimitsVerticalPanning=Float(Default(MaxCorrectionLimitsVerticalPanning,15.0))
Assert(1.0<=MaxCorrectionLimitsVerticalPanning,RT_String("%s1.0 <= MaxCorrectionLimitsVerticalPanning(%f)",
\ myName,MaxCorrectionLimitsVerticalPanning))
MaxCorrectionLimitsRotation=Float(Default(MaxCorrectionLimitsRotation,5.0))
Assert(1.0<=MaxCorrectionLimitsRotation,RT_String("%s1.0 <= MaxCorrectionLimitsRotation(%f)",myName,MaxCorrectionLimitsRotation))
MaxCorrectionLimitsZoom=Float(Default(MaxCorrectionLimitsZoom,15.0))
Assert(1.0<=MaxCorrectionLimitsZoom,RT_String("%s1.0 <= MaxCorrectionLimitsZoom(%f)",myName,MaxCorrectionLimitsZoom))
UsePreviousAndFutureFramesToFillInBordersPreviousFramesEnabled=Default(UsePreviousAndFutureFramesToFillInBordersPreviousFramesEnabled,False)
UsePreviousAndFutureFramesToFillInBordersFutureFramesEnabled=Default(UsePreviousAndFutureFramesToFillInBordersFutureFramesEnabled,False)
UsePreviousAndFutureFramesToFillInBordersPreviousFrames=Default(UsePreviousAndFutureFramesToFillInBordersPreviousFrames,30)
Assert(0<=UsePreviousAndFutureFramesToFillInBordersPreviousFrames,
\ RT_String("%s0 <= UsePreviousAndFutureFramesToFillInBordersPreviousFrames(%d)",
\ myName,UsePreviousAndFutureFramesToFillInBordersPreviousFrames))
UsePreviousAndFutureFramesToFillInBordersFutureFrames=Default(UsePreviousAndFutureFramesToFillInBordersFutureFrames,30)
Assert(0<=UsePreviousAndFutureFramesToFillInBordersFutureFrames,
\ RT_String("%s0 <= UsePreviousAndFutureFramesToFillInBordersFutureFrames(%d)",
\ myName,UsePreviousAndFutureFramesToFillInBordersFutureFrames))
IgnorePixelsOutside_LetAreaFollowMotion=Default(IgnorePixelsOutside_LetAreaFollowMotion,False)
DeepAnalysisIfLessThanXPercentOfVectorsAreOk=Default(DeepAnalysisIfLessThanXPercentOfVectorsAreOk,0)
Assert(0<=DeepAnalysisIfLessThanXPercentOfVectorsAreOk<=100,
\ RT_String("%s 0 <= DeepAnalysisIfLessThanXPercentOfVectorsAreOk <= 100(%d)",myName,DeepAnalysisIfLessThanXPercentOfVectorsAreOk))
CamcorderHasARollingShutter=Default(CamcorderHasARollingShutter,false)
GenerateInterlacedProgressiveVideo=Default(GenerateInterlacedProgressiveVideo,false)
SoftBorders=Default(SoftBorders,false)
ExtrapolateColorsIntoBorder=Default(ExtrapolateColorsIntoBorder,false)
SoftBorders_EdgeTransitionWidth=Default(SoftBorders_EdgeTransitionWidth,10)
Assert(0<=SoftBorders_EdgeTransitionWidth,RT_String("%s0 <= SoftBorders_EdgeTransitionWidth(%d)",myName,SoftBorders_EdgeTransitionWidth))
DiscardMotionOfBlocksThatMoveMoreThanXPixels=Float(Default(DiscardMotionOfBlocksThatMoveMoreThanXPixels,1000.0))
Assert(0.0<DiscardMotionOfBlocksThatMoveMoreThanXPixels, RT_String("%s0.0 < DiscardMotionOfBlocksThatMoveMoreThanXPixels(%f)",
\ myName,DiscardMotionOfBlocksThatMoveMoreThanXPixels))
RememberDiscardedAreasToNextFrame=Default(RememberDiscardedAreasToNextFrame,true)
RollingShutterAmount=Float(Default(RollingShutterAmount,88.0)) ##### Any Value ???
DetectRotation=Default(DetectRotation,true)
DetectZoom=Default(DetectZoom,true)
DetectScenes_Threshold=Float(Default(DetectScenes_Threshold,20.0))
Assert(0.0<=DetectScenes_Threshold<=1000.0, RT_String("%s0.0 <= DetectScenes_Threshold <= 1000.0(%f)",
\ myName,DetectScenes_Threshold))
AdaptiveZoomSmoothness=Float(Default(AdaptiveZoomSmoothness,5000.0))
Assert(0.0<AdaptiveZoomSmoothness,RT_String("%s0.0 < AdaptiveZoomSmoothness(%f)",myName,AdaptiveZoomSmoothness))
AdaptiveZoomAmount=Float(Default(AdaptiveZoomAmount,100.0)) ##### Any Value ???
DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX=Default(DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX,20)
Assert(0<=DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX<=255,
\ RT_String("%s0 <= DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX <= 255(%d)",
\ myName,DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX))
DetectScenes=Default(DetectScenes,true)
UseColorMask=Default(UseColorMask,false)
MaskColorInHexRRGGBB=BitAnd(Default(MaskColorInHexRRGGBB,$FF00FF),$FFFFFF)
#########
Auto=Default(Auto,Pass==1) # Default True if Pass==1 or False if Pass==2
Assert(Pass==1 || !Auto,RT_String("%sCannot use Auto=True if Pass==2",myName))
Debug=Default(Debug,True)
Plugin=Default(Plugin,"Deshaker.vdf")
Assert(Plugin!="",RT_string("%sRequires Plugin",myName))
Plugin=RT_GetFullPathName(Plugin)
(Debug) ? RT_DebugF("Plugin = '%s'",Plugin,name=myName) : NOP
PreRoll = Max(Default(PreRoll,0),0)
#########
Fmt1="%d|%d"
Fmt2="|%d|%d|%.*f|%d|%.*f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%.*f|%d|%d|%d|%.*f|%d|%.*f|%.*f|" +
\ "%s|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%.*f|%.*f|%.*f|%.*f|%.*f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%.*f|%d|%.*f|%d|%d|%.*f|%.*f|%.*f|%d|%d|%d|%x"
S1=RT_String(Fmt1,DSVersion,Pass)
S2=RT_String(Fmt2,
\ BlockSize,DifferentialSearchRange,
\ f2ip(SourcePixelAspectValue),SourcePixelAspectValue,SourcePixelAspectSelection,
\ f2ip(DestinationPixelAspectValue),DestinationPixelAspectValue,DestinationPixelAspectSelection,
\ DestinationWidth,DestinationHeight,Scale,UsePixels,
\ MotionSmoothnessHorizontalPanning,MotionSmoothnessVerticalPanning,MotionSmoothnessRotation,MotionSmoothnessZoom,
\ f2ip(DiscardMotionOfXBlocks),DiscardMotionOfXBlocks,VideoOutput,EdgeCompensation,Resampling,
\ f2ip(SkipFrameIfLessThanXPercentOfBlocksOk),SkipFrameIfLessThanXPercentOfBlocksOk,InitialSearchRange,
\ f2ip(DiscardMotionOfBlocksMatchingValueLessThanX),DiscardMotionOfBlocksMatchingValueLessThanX,
\ f2ip(DiscardMotionOfBlocksThatHave2ndBestMatchLargerThanBestMinusX),DiscardMotionOfBlocksThatHave2ndBestMatchLargerThanBestMinusX,
\ LogFile,AppendToFile?1:0,
\ IgnorePixelsOutside?1:0,IgnorePixelsOutsideLeft,IgnorePixelsOutsideRight,IgnorePixelsOutsideTop,IgnorePixelsOutsideBottom,
\ IgnorePixelsInside?1:0,IgnorePixelsInsideLeft,IgnorePixelsInsideRight,IgnorePixelsInsideTop,IgnorePixelsInsideBottom,
\ VideoTypeInterlaced?1:0,VideoTypeUpperFieldFirst?1:0,
\ f2ip(ExtraZoomFactor),ExtraZoomFactor,
\ f2ip(MaxCorrectionLimitsHorizontalPanning),MaxCorrectionLimitsHorizontalPanning,
\ f2ip(MaxCorrectionLimitsVerticalPanning),MaxCorrectionLimitsVerticalPanning,
\ f2ip(MaxCorrectionLimitsRotation),MaxCorrectionLimitsRotation,
\ f2ip(MaxCorrectionLimitsZoom),MaxCorrectionLimitsZoom,
\ UsePreviousAndFutureFramesToFillInBordersPreviousFramesEnabled?1:0,UsePreviousAndFutureFramesToFillInBordersFutureFramesEnabled?1:0,
\ UsePreviousAndFutureFramesToFillInBordersPreviousFrames,UsePreviousAndFutureFramesToFillInBordersFutureFrames,
\ IgnorePixelsOutside_LetAreaFollowMotion?1:0,DeepAnalysisIfLessThanXPercentOfVectorsAreOk,
\ CamcorderHasARollingShutter?1:0,GenerateInterlacedProgressiveVideo?1:0,SameDestinationPropertiesAsSource?1:0,
\ SoftBorders?1:0,ExtrapolateColorsIntoBorder?1:0,SoftBorders_EdgeTransitionWidth,
\ f2ip(DiscardMotionOfBlocksThatMoveMoreThanXPixels),DiscardMotionOfBlocksThatMoveMoreThanXPixels,
\ RememberDiscardedAreasToNextFrame?1:0,
\ f2ip(RollingShutterAmount),RollingShutterAmount,
\ DetectRotation?1:0,DetectZoom?1:0,f2ip(DetectScenes_Threshold),DetectScenes_Threshold,
\ f2ip(AdaptiveZoomSmoothness),AdaptiveZoomSmoothness,
\ f2ip(AdaptiveZoomAmount),AdaptiveZoomAmount,
\ DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX,
\ DetectScenes?1:0,UseColorMask?1:0,MaskColorInHexRRGGBB
\ )
DBUG = true # Used during debugging
S=S1+S2
Fn=RT_String("ShakeRattleAndRoll_Debug_%d.txt",Pass)
(Debug&&DBUG) ? RT_WriteFile(Fn,"%s",S) : NOP
(Debug) ? RT_DebugF("Loading VDPlugin='%s' As '%s', PreRoll=%d",Plugin, "Deshaker",PreRoll,name=myName) : NOP
LoadVirtualDubPlugin (Plugin, "Deshaker", preroll=PreRoll)
(Debug) ? RT_DebugF("Calling Pass=%d Dehaker(S)",(Auto)?1:Pass,name=myName) : NOP
Tmp=Deshaker(S)
(Auto) ? RT_ForceProcess(Tmp) : NOP
(Auto) ? Tmp.RT_AverageLuma(n=0,w=1,h=1) : NOP # Rewind, Read Frame 0. Fixes Avs 2.60 Standard Black Clip, no idea why.
(Auto) ? Last : Tmp # If NOT Auto, then we return result of previous DeShaker(Pass=Whatever).
Fn=(Auto) ? "ShakeRattleAndRoll_Debug_2.txt" : Fn
S =(Auto) ? RT_String(Fmt1,DSVersion,2)+S2 : S
(Auto&&Debug&&DBUG) ? RT_WriteFile(Fn,"%s",S) : NOP
(Auto&&Debug) ? RT_DebugF("Calling Pass=2 Dehaker(S)",name=myName) : NOP
(Auto) ? Deshaker(S) : NOP
Return Last
}
Example Mod for eg previously given GoorawinStub, mods Added in Blue. (Do similar for the preset demo stub)
Function GoorawinStub(clip c,Int "Pass",String "LogFile",Bool "Auto",Bool "Debug",String "Plugin",Int "PreRoll") { # Specific fixed settings.
ShakeRattleAndRoll(c,Pass,
\ EdgeCompensation=4,MaxCorrectionLimitsHorizontalPanning=8.0,MaxCorrectionLimitsVerticalPanning=8.0,
\ MaxCorrectionLimitsRotation=3.0,MaxCorrectionLimitsZoom=8.0,CamcorderHasARollingShutter=True,RollingShutterAmount=90.0,
\ LogFile=LogFile,Auto=Auto,Debug=Debug,
\ Plugin=Plugin,PreRoll=PreRoll
\)
}
EDIT: Line In RED near end of script, Fixes v2.60 standard black clip, ALL working OK now. (also, flash "Deshaker" window no longer appears)
IgnorePixelsOutside=Default(IgnorePixelsOutside,False)
IgnorePixelsOutsideLeft=Default(IgnorePixelsOutsideLeft,0)
IgnorePixelsOutsideRight=Default(IgnorePixelsOutsideRight,0)
IgnorePixelsOutsideTop=Default(IgnorePixelsOutsideTop,0)
IgnorePixelsOutsideBottom=Default(IgnorePixelsOutsideBottom,0)
IgnorePixelsInside=Default(IgnorePixelsInside,False)
IgnorePixelsInsideLeft=Default(IgnorePixelsInsideLeft,0)
IgnorePixelsInsideRight=Default(IgnorePixelsInsideRight,0)
IgnorePixelsInsideTop=Default(IgnorePixelsInsideTop,0)
IgnorePixelsInsideBottom=Default(IgnorePixelsInsideBottom,0)
VideoTypeInterlaced=Default(VideoTypeInterlaced,False)
VideoTypeUpperFieldFirst=Default(VideoTypeUpperFieldFirst,False)
ExtraZoomFactor=Float(Default(ExtraZoomFactor,1.0))
Assert(0.0<ExtraZoomFactor,RT_String("%s0.0 < ExtraZoomFactor(%f)",myName,ExtraZoomFactor))
MaxCorrectionLimitsHorizontalPanning=Float(Default(MaxCorrectionLimitsHorizontalPanning,15.0))
Assert(1.0<=MaxCorrectionLimitsHorizontalPanning,RT_String("%s1.0 <= MaxCorrectionLimitsHorizontalPanning(%f)",
\ myName,MaxCorrectionLimitsHorizontalPanning))
MaxCorrectionLimitsVerticalPanning=Float(Default(MaxCorrectionLimitsVerticalPanning,15.0))
Assert(1.0<=MaxCorrectionLimitsVerticalPanning,RT_String("%s1.0 <= MaxCorrectionLimitsVerticalPanning(%f)",
\ myName,MaxCorrectionLimitsVerticalPanning))
MaxCorrectionLimitsRotation=Float(Default(MaxCorrectionLimitsRotation,5.0))
Assert(1.0<=MaxCorrectionLimitsRotation,RT_String("%s1.0 <= MaxCorrectionLimitsRotation(%f)",myName,MaxCorrectionLimitsRotation))
MaxCorrectionLimitsZoom=Float(Default(MaxCorrectionLimitsZoom,15.0))
Assert(1.0<=MaxCorrectionLimitsZoom,RT_String("%s1.0 <= MaxCorrectionLimitsZoom(%f)",myName,MaxCorrectionLimitsZoom))
UsePreviousAndFutureFramesToFillInBordersPreviousFramesEnabled=Default(UsePreviousAndFutureFramesToFillInBordersPreviousFramesEnabled,False)
UsePreviousAndFutureFramesToFillInBordersFutureFramesEnabled=Default(UsePreviousAndFutureFramesToFillInBordersFutureFramesEnabled,False)
UsePreviousAndFutureFramesToFillInBordersPreviousFrames=Default(UsePreviousAndFutureFramesToFillInBordersPreviousFrames,30)
Assert(0<=UsePreviousAndFutureFramesToFillInBordersPreviousFrames,
\ RT_String("%s0 <= UsePreviousAndFutureFramesToFillInBordersPreviousFrames(%d)",
\ myName,UsePreviousAndFutureFramesToFillInBordersPreviousFrames))
UsePreviousAndFutureFramesToFillInBordersFutureFrames=Default(UsePreviousAndFutureFramesToFillInBordersFutureFrames,30)
Assert(0<=UsePreviousAndFutureFramesToFillInBordersFutureFrames,
\ RT_String("%s0 <= UsePreviousAndFutureFramesToFillInBordersFutureFrames(%d)",
\ myName,UsePreviousAndFutureFramesToFillInBordersFutureFrames))
IgnorePixelsOutside_LetAreaFollowMotion=Default(IgnorePixelsOutside_LetAreaFollowMotion,False)
DeepAnalysisIfLessThanXPercentOfVectorsAreOk=Default(DeepAnalysisIfLessThanXPercentOfVectorsAreOk,0)
Assert(0<=DeepAnalysisIfLessThanXPercentOfVectorsAreOk<=100,
\ RT_String("%s 0 <= DeepAnalysisIfLessThanXPercentOfVectorsAreOk <= 100(%d)",myName,DeepAnalysisIfLessThanXPercentOfVectorsAreOk))
CamcorderHasARollingShutter=Default(CamcorderHasARollingShutter,false)
GenerateInterlacedProgressiveVideo=Default(GenerateInterlacedProgressiveVideo,false)
SoftBorders=Default(SoftBorders,false)
ExtrapolateColorsIntoBorder=Default(ExtrapolateColorsIntoBorder,false)
SoftBorders_EdgeTransitionWidth=Default(SoftBorders_EdgeTransitionWidth,10)
Assert(0<=SoftBorders_EdgeTransitionWidth,RT_String("%s0 <= SoftBorders_EdgeTransitionWidth(%d)",myName,SoftBorders_EdgeTransitionWidth))
DiscardMotionOfBlocksThatMoveMoreThanXPixels=Float(Default(DiscardMotionOfBlocksThatMoveMoreThanXPixels,1000.0))
Assert(0.0<DiscardMotionOfBlocksThatMoveMoreThanXPixels, RT_String("%s0.0 < DiscardMotionOfBlocksThatMoveMoreThanXPixels(%f)",
\ myName,DiscardMotionOfBlocksThatMoveMoreThanXPixels))
RememberDiscardedAreasToNextFrame=Default(RememberDiscardedAreasToNextFrame,true)
RollingShutterAmount=Float(Default(RollingShutterAmount,88.0)) ##### Any Value ???
DetectRotation=Default(DetectRotation,true)
DetectZoom=Default(DetectZoom,true)
DetectScenes_Threshold=Float(Default(DetectScenes_Threshold,20.0))
Assert(0.0<=DetectScenes_Threshold<=1000.0, RT_String("%s0.0 <= DetectScenes_Threshold <= 1000.0(%f)",
\ myName,DetectScenes_Threshold))
AdaptiveZoomSmoothness=Float(Default(AdaptiveZoomSmoothness,5000.0))
Assert(0.0<AdaptiveZoomSmoothness,RT_String("%s0.0 < AdaptiveZoomSmoothness(%f)",myName,AdaptiveZoomSmoothness))
AdaptiveZoomAmount=Float(Default(AdaptiveZoomAmount,100.0)) ##### Any Value ???
DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX=Default(DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX,20)
Assert(0<=DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX<=255,
\ RT_String("%s0 <= DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX <= 255(%d)",
\ myName,DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX))
DetectScenes=Default(DetectScenes,true)
UseColorMask=Default(UseColorMask,false)
MaskColorInHexRRGGBB=BitAnd(Default(MaskColorInHexRRGGBB,$FF00FF),$FFFFFF)
#########
Auto=Default(Auto,Pass==1) # Default True if Pass==1 or False if Pass==2
Assert(Pass==1 || !Auto,RT_String("%sCannot use Auto=True if Pass==2",myName))
Debug=Default(Debug,True)
Plugin=Default(Plugin,"Deshaker.vdf")
Assert(Plugin!="",RT_string("%sRequires Plugin",myName))
Plugin=RT_GetFullPathName(Plugin)
(Debug) ? RT_DebugF("Plugin = '%s'",Plugin,name=myName) : NOP
PreRoll = Max(Default(PreRoll,0),0)
#########
Fmt1="%d|%d"
Fmt2="|%d|%d|%.*f|%d|%.*f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%.*f|%d|%d|%d|%.*f|%d|%.*f|%.*f|" +
\ "%s|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%.*f|%.*f|%.*f|%.*f|%.*f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%.*f|%d|%.*f|%d|%d|%.*f|%.*f|%.*f|%d|%d|%d|%x"
S1=RT_String(Fmt1,DSVersion,Pass)
S2=RT_String(Fmt2,
\ BlockSize,DifferentialSearchRange,
\ f2ip(SourcePixelAspectValue),SourcePixelAspectValue,SourcePixelAspectSelection,
\ f2ip(DestinationPixelAspectValue),DestinationPixelAspectValue,DestinationPixelAspectSelection,
\ DestinationWidth,DestinationHeight,Scale,UsePixels,
\ MotionSmoothnessHorizontalPanning,MotionSmoothnessVerticalPanning,MotionSmoothnessRotation,MotionSmoothnessZoom,
\ f2ip(DiscardMotionOfXBlocks),DiscardMotionOfXBlocks,VideoOutput,EdgeCompensation,Resampling,
\ f2ip(SkipFrameIfLessThanXPercentOfBlocksOk),SkipFrameIfLessThanXPercentOfBlocksOk,InitialSearchRange,
\ f2ip(DiscardMotionOfBlocksMatchingValueLessThanX),DiscardMotionOfBlocksMatchingValueLessThanX,
\ f2ip(DiscardMotionOfBlocksThatHave2ndBestMatchLargerThanBestMinusX),DiscardMotionOfBlocksThatHave2ndBestMatchLargerThanBestMinusX,
\ LogFile,AppendToFile?1:0,
\ IgnorePixelsOutside?1:0,IgnorePixelsOutsideLeft,IgnorePixelsOutsideRight,IgnorePixelsOutsideTop,IgnorePixelsOutsideBottom,
\ IgnorePixelsInside?1:0,IgnorePixelsInsideLeft,IgnorePixelsInsideRight,IgnorePixelsInsideTop,IgnorePixelsInsideBottom,
\ VideoTypeInterlaced?1:0,VideoTypeUpperFieldFirst?1:0,
\ f2ip(ExtraZoomFactor),ExtraZoomFactor,
\ f2ip(MaxCorrectionLimitsHorizontalPanning),MaxCorrectionLimitsHorizontalPanning,
\ f2ip(MaxCorrectionLimitsVerticalPanning),MaxCorrectionLimitsVerticalPanning,
\ f2ip(MaxCorrectionLimitsRotation),MaxCorrectionLimitsRotation,
\ f2ip(MaxCorrectionLimitsZoom),MaxCorrectionLimitsZoom,
\ UsePreviousAndFutureFramesToFillInBordersPreviousFramesEnabled?1:0,UsePreviousAndFutureFramesToFillInBordersFutureFramesEnabled?1:0,
\ UsePreviousAndFutureFramesToFillInBordersPreviousFrames,UsePreviousAndFutureFramesToFillInBordersFutureFrames,
\ IgnorePixelsOutside_LetAreaFollowMotion?1:0,DeepAnalysisIfLessThanXPercentOfVectorsAreOk,
\ CamcorderHasARollingShutter?1:0,GenerateInterlacedProgressiveVideo?1:0,SameDestinationPropertiesAsSource?1:0,
\ SoftBorders?1:0,ExtrapolateColorsIntoBorder?1:0,SoftBorders_EdgeTransitionWidth,
\ f2ip(DiscardMotionOfBlocksThatMoveMoreThanXPixels),DiscardMotionOfBlocksThatMoveMoreThanXPixels,
\ RememberDiscardedAreasToNextFrame?1:0,
\ f2ip(RollingShutterAmount),RollingShutterAmount,
\ DetectRotation?1:0,DetectZoom?1:0,f2ip(DetectScenes_Threshold),DetectScenes_Threshold,
\ f2ip(AdaptiveZoomSmoothness),AdaptiveZoomSmoothness,
\ f2ip(AdaptiveZoomAmount),AdaptiveZoomAmount,
\ DiscardMotionOfBlocksThatHaveMaximumPixelValueDifferenceLessThanX,
\ DetectScenes?1:0,UseColorMask?1:0,MaskColorInHexRRGGBB
\ )
DBUG = true # Used during debugging
S=S1+S2
Fn=RT_String("ShakeRattleAndRoll_Debug_%d.txt",Pass)
(Debug&&DBUG) ? RT_WriteFile(Fn,"%s",S) : NOP
(Debug) ? RT_DebugF("Loading VDPlugin='%s' As '%s', PreRoll=%d",Plugin, "Deshaker",PreRoll,name=myName) : NOP
LoadVirtualDubPlugin (Plugin, "Deshaker", preroll=PreRoll)
(Debug) ? RT_DebugF("Calling Pass=%d Dehaker(S)",(Auto)?1:Pass,name=myName) : NOP
Tmp=Deshaker(S)
(Auto) ? RT_ForceProcess(Tmp) : NOP
(Auto) ? Tmp.RT_AverageLuma(n=0,w=1,h=1) : NOP # Rewind, Read Frame 0. Fixes Avs 2.60 Standard Black Clip, no idea why.
(Auto) ? Last : Tmp # If NOT Auto, then we return result of previous DeShaker(Pass=Whatever).
Fn=(Auto) ? "ShakeRattleAndRoll_Debug_2.txt" : Fn
S =(Auto) ? RT_String(Fmt1,DSVersion,2)+S2 : S
(Auto&&Debug&&DBUG) ? RT_WriteFile(Fn,"%s",S) : NOP
(Auto&&Debug) ? RT_DebugF("Calling Pass=2 Dehaker(S)",name=myName) : NOP
(Auto) ? Deshaker(S) : NOP
Return Last
}
Example Mod for eg previously given GoorawinStub, mods Added in Blue. (Do similar for the preset demo stub)
Function GoorawinStub(clip c,Int "Pass",String "LogFile",Bool "Auto",Bool "Debug",String "Plugin",Int "PreRoll") { # Specific fixed settings.
ShakeRattleAndRoll(c,Pass,
\ EdgeCompensation=4,MaxCorrectionLimitsHorizontalPanning=8.0,MaxCorrectionLimitsVerticalPanning=8.0,
\ MaxCorrectionLimitsRotation=3.0,MaxCorrectionLimitsZoom=8.0,CamcorderHasARollingShutter=True,RollingShutterAmount=90.0,
\ LogFile=LogFile,Auto=Auto,Debug=Debug,
\ Plugin=Plugin,PreRoll=PreRoll
\)
}
EDIT: Line In RED near end of script, Fixes v2.60 standard black clip, ALL working OK now. (also, flash "Deshaker" window no longer appears)