Decimate
(Version 1.2)

[Place this text file in the VirtualDub plugins directory to make it available via the Help button on the filter configuration dialog box. The computer must have an HTML browser, such as Internet Explorer or Netscape, available in its search path.]

This filter acts on the output of the Telecide filter (or any other stream of progressive frames derived from a de-telecined clip) and deletes extra duplicated frames, while enforcing a desired decimation ratio. For example, suppose Telecide has been used to produce a clip containing progressive frames derived from 3:2 pulldown material. Decimate can take the processed clip as input and delete the duplicated frames by deleting one frame out of each group of five. Actually, because VirtualDub filters cannot delete frames, Decimate writes an Avisynth script that is used to do the actual frame deletion. It is acknowledged that this is a cumbersome procedure. The next generation of VirtualDub will allow filters to delete frames. Avisynth is available from a link given on the main page of the site at the bottom of this file. Version 0.3 (not 1.0 beta 3) is the most stable and reliable version. Later betas are now available from third parties (other than the original author Ben Rudiak-Gould) that may be perfectly usable.

First, detailed instructions for using Decimate are given, then the options are described. The following example is for 3:2 pulldown removal.

  • Use your method of choice to convert the pulldown material to a clip containing progressive frames. This might be a) Telecide, b) Smart Deinterlacer, or c) simple field discarding.

  • Start VirtualDub and load the processed clip. Add the Decimate filter and enter 5 in the "Decimate 1 in" edit box. Using the Browse button, specify the path and file name for the Avisynth script to be written. Hit OK twice to close the filter dialog and return to the VirtualDub main window.

  • Hit VirtualDub's rewind button on the timeline player (|<). Now hit the play button (>o). When the clip has finished playing, do not hit any player buttons and exit VirtualDub.

  • Edit the generated Avisynth script as desired. At a minimum this will require you to add a clip source command above the DeleteFrame() lines. For example:

        AVISource("d:\don\test.avi")
        DeleteFrame(1)
        ...

    Obviously, the specified clip should be the same one that was input to Decimate.

  • Restart VirtualDub and load the Avisynth script. Set the desired compression and set the output frame rate appropriately (4/5 of the original). Save the AVI. The output AVI will be the final inverse telecined product.

    The filter has the following configuration options:

    Path for Avisynth delete script: Use the Browse button to specify the destination path and filename for the output script. If no filename is specified, an Avisynth script will not be generated, but the DebugView option (see below) will still function. This would be useful for tweaking the threshold before generating the final output file.

    Decimate 1 in: Set this option to N to remove one of every N frames. For example, for a 12fps source that was doubled up to 24fps and then sped up to 25fps for PAL transmission, you'd enter 2 to restore it to 12 fps. Decimate 1 in 5 is useful for removing 3:2 pulldown. Decimate 1 in 25 is useful for removing PAL pulldown in which 24fps material is telecined to 25fps. The maximum number that can use is 50. If you enter more than 50, it will be changed to 50 when you hit OK.

    DebugView: If the DebugView checkbox is checked, the filter outputs processing information that is viewable using the DebugView utility that is available on the home page of the web site given below. This information, while possibly interesting to an end user, is designed to assist filter development.

    Please note that the frame numbers shown are the absolute frame numbers in the source clip. They do not correspond to the frame numbers used in the Avisynth DeleteFrame() lines because as each frame is deleted all the following frame numbers reduce by one.

    Warning

    When deciding which frames to delete, Decimate does not care if the frames are key frames or not. Therefore, you should be sure to feed Decimate with a format in which every frame is a key frame, such as MJPEG, DV, uncompressed RGB, HUFYUV, etc. Using DivX ;-) is a very bad idea.

    Thanks to Simon Walters for suggesting the idea of writing Avisynth scripts to delete frames (VirtualDub filters cannot delete frames). Thanks to James Lin for proposing to simply delete the most similar frame in the set of N frames.

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

    Filters for VirtualDub
    http://sauron.mordor.net/dgraft/index.html

    Donald Graft
    December 31, 2001
    (C) Copyright 2001, All Rights Reserved