Sampler - An Avisynth filter for pulling samples from a clip
By Ross Thomas <ross@grinfinity.com>
This is a very simple Avisynth filter to construct "sample strips" from the source clip. This concept is best explained with an example. Suppose you had a source clip that was 10 frames in length, and you used this filter to extract 3 samples, each 2 frames in length. The resulting clip would be exactly 6 frames long, and would be made up of the 1st, 2nd, 5th, 6th, 9th and 10th frames of the original clip. Or, graphically, this clip:
becomes this clip:
In other words, this filter pulls out the specified number of evenly distributed samples of the specified length from the source clip and concatenates them into one clip which will always be precisely samples-times-sample-length frames long.
Usage
Code:
Sampler(clip clip, int samples, int length)
Parameter | Meaning | Default |
clip | Specifies the clip to affect. | last |
samples | The number of samples to take from the clip. | Running time of clip in minutes |
length | The length of each sample in frames. | 1 second (i.e., the clip's frame rate rounded to the nearest integer) |
Known Issues: None.
History
- 0.2a - Changed defaults to samples=movie_length_in_minutes and length=one_second.
- 0.2 - Added audio support. Recompiled 2.5 with latest avisynth.h and renamed AvisynthPluginInit to AvisynthPluginInit2. Enabled "full optimization" for release builds.
- 0.1a - AKA stupid bugfix release 1: 2.5 version is now actually compiled for 2.5 and not 2.0. Added SetCacheHints for 2.5 version and fixed, er, minor documentation bug.
- 0.1 - First release. Alpha code. Danger, Will Robinson!
Download here: SansGrip's Avisynth Filters [DOWNLOADS]