Script files

SpotRemover accepts script files to allow manual control of the spot detection and/or removal. The format of the script file is very simple. Each line of the file can be in the form of

 Frame Mode X1 X2 Y1 Y2

or

 FromFrame-ToFrame Mode X1 X2 Y1 Y2

where
Frame is the ordinal number of the processed frame of the input video file, assuming the first frame number in the file to be 0. (i.e. the number you see in the VirtualDub's status line)
FromFrame-ToFrame defines a range of frames to be processed with the same parameters. Has the same effect as if the command was repeated with incremented Frame number.
X1 X2 Y1 Y2 define a rectangle within the frame to process. X=0, Y=0 point is in the lower left corner of the screen.
A line not beginning with a number is skipped during the parsing of script file.
This can be used for inserting comments.
Mode can be one of the following:
P forces removal of a spot with coordinates (X1,X2,Y1,Y2) by replacing its contents with the data of the Previous frame; has higher priority than the motion table;
N same but the data are taken from the Next frame;
A same but the data are the Average of the previous and the next frames;
C all detected spots are Cleared because this disables spot filtering with motion detection, perimeter clearance and spot fullness; has higher priority than M-mode. X1 X2 Y1 Y2 are ignored (if any).
M defines a rectangle with Motion and thus disables spot removal within that area; has lower priority than P-, N-, and A-modes;
The following modes take effect from this frame forward:
L Set the Motion Table Level two times Lower*.
X1 X2 Y1 Y2 are ignored (if any).
H Set the Motion Table Level two times Higher*.
X1 X2 Y1 Y2 are ignored (if any).
B Change Brightness controls relative to the current values
(see example below).
Accepts from 1 to 6 parameters**:
brightness,
contrast,
saturation,
saturation balance,
Shift Red, and
Shift Blue.
D Change Spot Detection controls (see example below).
Accepts from 1 to 5 parameters**:
Level for spot detection***,
Level for spot clearance,
Required perimeter clearance,
Motion table level, and
Spot fullness factor.
S Change Smoothing controls (see example below).
Accepts from 1 to 4 parameters**:
Strength for Intensity,
Correction for Color,
Level to Lock Intensity, and
Level to Lock Color.
T Change Motion Tracking controls (see example below).
Accepts from 1 to 3 parameters**:
Motion distance X,
Motion distance Y,
Interrupted motion history flag (0 or 1).


*This will alter the internal (scaled) number for the Motion Table Level. So, you can safely apply L-mode several times to the initial value of, for example, 5 without worrying about rounding errors.

**Controls corresponding to the missing parameters are not changed.

***Change of the "Level for spot detection" takes effect several frames later because of the time lag.


Examples:

120-131 c Clear all detected spots in all frames from 120 to 131.
135-136 m 0 50 0 50 Force Motion and keep all detected spots on frames 135,136 in the rectangle (0,50,0,50).
137 p 10 30 20 40 Replace the data in rectangle (10,30,20,40) on frame 137 with the data of the same rectangle from frame 136.
138 p 10 30 20 40 Replace the data on frame 138 with the data from frame 137 (i.e. those copied from frame 136).
138 n 50 50 70 60 Replace the data on frame 138 with the data of the frame 139.
140 a 50 50 70 60 Replace the data on frame 140 with data average of frame 139 and frame 141.
141-160 b -5 will decrease brightness by 5%,
for each frame from 141 to 160 (fade out effect)
138 b +15 -5 +10 2 0 7 will increase brightness by 15,
will reduce contrast by 5,
will increase saturation by 10,
will increase saturation balance by 2,
will not change Shift Red and
will increase Shift Blue by 7.
138 d 26 16 5 6 10 will set new parameters for spot removal:
Level for spot detection = 26,
Level for spot clearance = 16,
Required perimeter clearance = 5,
Motion table level = 6,
Spot fullness factor = 10.
130 s 6 -4 3 4 will set new parameters for smoothing:
Strength for Intensity = 6,
Correction for Color = -4,
Level to Lock Intensity = 3,
Level to Lock Color = 4.
130 t 6 3 0 will set new parameters for motion tracking:
Motion distance X = 6%,
Motion distance Y = 3%,
Interrupted motion history: "Unchecked".

Note:

A frame number can be repeated on several subsequent lines with same or different modes. In this case, however, the C-mode (if used) should precede the others (if any).

The frame numbers in your script file are also good for processing a part of you movie.

Script file is always read forward. If you need to step back in your source file when previewing the output (i.e. pressing Alt-LeftArrow) make sure you reset the filter by opening the "Filters" dialog.

Limitations: