Avisynth SelectEvery

From wiki.selur.net
Revision as of 23:08, 21 November 2026 by Selur (talk | contribs) (Avisynth filter documentation (via create-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

SelectEvery keeps only chosen frames out of every repeating group of frames, for example every second frame. It is a core filter of AviSynth+, no plugin is needed.

Filtering → Avisynth → Frame → Reduction

SelectEvery controls in Hybrid
SelectEvery controls in Hybrid

What it does

The clip is cut into groups of Cycle frames. From every group only the frames at the listed Offsets are kept, in the order given. The filter generalises SelectEven and SelectOdd.

Typical uses:

  • Cycle 2, Offsets 0: keep every second frame (halves the frame rate).
  • Cycle 5, Offsets 1 2 3 4: drop one frame of five, for example to remove the duplicate of a pulldown pattern.
  • Cycle 4, Offsets 0 1 2 3 3: repeat the last frame of every four.
  • Cycle 10, Offsets 3 6 7: keep frames 3, 6 and 7 of every ten.

Settings

Control Parameter Range Hybrid default Meaning
SelectEvery – on/off off Enables the filter.
Cycle step_size 2–100 5 Number of frames in one group.
Offsets offset1, offset2, … numbers 0 to Cycle − 1, separated by spaces empty Positions to keep. An offset may appear more than once, which repeats that frame. With no offsets the filter is not added.
Adjust FPS – on/off on On: the frame rate changes with the number of kept frames (rate × offsets / cycle). Off: the frame rate stays, so the clip plays faster and gets shorter.

Example

Cycle 2, Offsets 0, Adjust FPS on, on a 10-bit YUV 4:2:0 source:

# adjusting frame rate and count using SelectEvery
SelectEvery(2,0)

How Hybrid calls it

  • Hybrid writes SelectEvery(cycle, offset1, offset2, …). No plugin is loaded and Hybrid adds no conversion; every color space and bit depth works.
  • The filter needs progressive input and is placed after the deinterlacing and field-matching filters and before the frame rate interpolation.
  • AviSynth itself scales the frame rate by offsets / cycle. With Adjust FPS off, Hybrid appends .AssumeFPS( the numerator and denominator of the input clip's rate) to restore the original rate, for example SelectEvery(5,0,1).AssumeFPS(last.FrameRateNumerator, last.FrameRateDenominator).
  • Hybrid also uses the new frame rate and frame count (kept / cycle) for the following steps.
  • SelectEvery also offers the common options and can be added to the filter queue several times.

Background

SelectEvery(clip, 2, 0) equals SelectEven and SelectEvery(clip, 2, 1) equals SelectOdd. The AviSynth+ documentation also uses it with SeparateFields and Weave to build NTSC film telecine (24 → 30 fps).

See also: Vapoursynth SelectEvery, SelectRangeEvery

Sources