This filter uses a 2-pass approach to allow for full timeline random access navigation, random decimation, and the later addition of a GUI-based manual tweaking capability.
This filter is valuable when traditional 1-in-5 decimation is not sufficient. For example, many silent films are transferred to DVD by adding duplicates in unusual patterns, because the original frame rates are not 24fps. It is not unusual to see clips requiring strange decimations such as 20 in 43. Sometimes these strange decimations can be attained, or nearly attained, through repeated application of Decimate() using different cycles, but that is a cumbersome approach that cannot always attain the exact decimation ratios required. This filter tries to approach the problem more directly, but at the expense of 2-pass operation.
Another typical application is removing 3 out of 4 frames for clips that were rendered at 120fps to properly present hybrids of film and video.
This version supports YUY2 only for Avisynth 2.5. YV12 will be added when the functionality stabilizes.
Load the script and play it straight through from the beginning to completion (do not jump around on the timeline first!). This makes the metrics file, mfile.txt, in your script directory. If you want to examine your video for duplicate patterns, comment out the MultiDecimate() call, do not try to do it during pass 1, as any timeline jumps will corrupt the metrics file. Finally, after pass 1 completes, immediately exit VirtualDub; do not scroll around.
It is a waste of time to include any filters after the MultiDecimate() call in the first pass. Comment them out for faster performance. Comment them back in for the second pass.
Step 2. Execute MultiDecimate.exe to run the GUI. Browse to select the mfile.txt file. Select the desired mode (see below for a description of the modes). Set the remaining configuration boxes as required (see below). Then click on the Create button. This makes the cfile.txt and dfile.txt files in your script directory.
Step 3. Edit the script to change pass=1 to pass=2. Now you can load the script and it will have the correct decimated video, and timeline random access navigation will be supported. Pass 2 reads the dfile.txt file into memory and uses it to determine which frames to deliver.
To address this, use the "protect static scenes" mode. When you choose this mode from the drop down list, two extra edit boxes appear. Threshold is the metric below which duplicates are declared. The metrics are the same as those used in the mfile.txt file, so you can use that to help you. The fields in mfile.txt are as follows:
FrameNum IsADup Metric
Run Length is the number of duplicates (thus defined) in a row that defines a static scene subject to protection. A protected static scene is decimated by the ratio remove/cycle, no more and no less (subject to integer truncation).
pass (1 or 2, default 1): This parameter defines the processing pass as described above.
quality (0-3, default 2) This option allows the user to trade off quality of difference detection against speed. Following are the possibilities:
quality = 0: Subsampled for speed and chroma not considered (fastest).
quality = 1: Subsampled for speed and chroma considered.
quality = 2: Fully sampled and chroma not considered.
quality = 3: Fully sampled and chroma considered (slowest).
show (true/false, default false) enables information to be displayed on the frame. Also displays the software version.
debug (true/false, default false) enables information to be printed via OutputDebugString(). A utility called DebugView is available for catching these strings. The information displayed is the same as shown by the show option above.
Copyright (C) 2003, Donald A. Graft, All Rights Reserved.
Feedback/inquiries to neuron2 at attbi.com.
For updates and other filters/tools, visit my web site:
$Date: 2004/08/13 21:57:25 $