digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Sampler filter for Avisynth [Readme] (http://www.digitalfaq.com/archives/avisynth/14686-sampler-filter-avisynth.html)

kvcd.net Archives 11-25-2012 06:24 PM

Sampler filter for Avisynth [Readme]
 
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:

http://www.digitalfaq.com/archives/i.../2012/11/1.jpg

becomes this clip:

http://www.digitalfaq.com/archives/i.../2012/11/2.jpg

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)
ParameterMeaningDefault
clipSpecifies the clip to affect.last
samplesThe number of samples to take from the clip.Running time of clip in minutes
lengthThe 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: http://www.digitalfaq.com/archives/a...h-filters.html


All times are GMT -5. The time now is 08:06 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.