Antiflicker Filter for Virtual Dub

Version 1.3


[Place this HTML file in the VirtualDub plugins directory to make it available via the Help button on the filter configuration dialog box.]


When video at one frame rate is projected and then recorded from the projection screen at a different frame rate, a temporal moire pattern, or flicker, is produced. This filter removes the flicker, thereby making this a viable process. For example, it becomes feasible to project 18 fps films and record them with a 25 fps PAL camcorder.

The first phase of the filter performs a moving average over the video and rescales the pixels in the frames to approach this average. The second phase applies a temporal softening.

Thanks to Niels Basjes for suggesting the creation of this filter, providing test files, and giving valuable feedback. The final temporal softening phase is adapted from code by Steven Don. Thanks to Jeff Gonion for valuable theoretical discussions on digital filtering. Thanks to Yury Malich for the one-pass implementation and scene change concepts.


The following options are available:

Window size: This is the size of the moving average of frame luminance values. This produces the luminance value that frames are adjusted to. The idea is that you want it as small as possible while still removing flicker. Ideally, it is equal to the number of frames that one flicker period spans. For example, if the video frame rate is 25 fps and the flicker is at 7 fps (example of 18 fps shot at 25 fps; 25 -18 = 7), then one flicker period is 25/7 = 3.57 frames. We want our window to exactly cover an integral number of flicker cycles. So a good choice here would be a window size of 7 (~ 2 * 3.57). You can always set a long window size if in doubt, but doing so will spread out luminance changes in the clip. A window size of 10 is a good general-purpose compromise.

Softening: This is the threshold for the final temporal softening phase. Often, the physical process that creates the flicker also creates within-frame illumination changes, causing adjacent frames to differ. This softening phase greatly reduces this effect. A higher number causes greater temporal softening but can leave motion trails. If the physical process does not produce within-frame changes, this phase can be disabled by setting the softening to 0.

Interlaced source: If the source video clip is interlaced, check this option to enable field-mode processing.

Scene change threshold: At a scene change it is desirable to reset the filtering so that sudden changes of luminance are not smoothed out by the filter. This threshold determines the sensitivity of the scene change detection. Use lower numbers for more sensitive scene change detection. Use a threshold of 256 to disable scene change detection.

Show scene changes: To help in tweaking the scene change threshold, this option when selected causes scene change frames to be replaced by completely red frames.


For additional information, version updates, and other filters, please go to my web site:

Filters for Avisynth and VirtualDub


Donald Graft
June 2006
(C) Copyright 2000-2006, All Rights Reserved