Vapoursynth SelectRangeEvery: Difference between revisions
New filter page (via create-page on MediaWiki MCP Server) |
Update to current Hybrid behaviour; code as <pre> (via update-page on MediaWiki MCP Server) |
||
| Line 25: | Line 25: | ||
== Example == | == Example == | ||
Default settings on a 10-bit YUV 4:2:0 source (640x356, 25 fps): | Default settings on a 10-bit YUV 4:2:0 source (640x356, 25 fps): | ||
< | <pre> | ||
# adjusting frame count with Select(Range)Every | # adjusting frame count with Select(Range)Every | ||
clip = core.std.SelectEvery(clip, cycle=1500, offsets=range(0, 0 + 50)) # new fps: 0.833333 | clip = core.std.SelectEvery(clip, cycle=1500, offsets=range(0, 0 + 50)) # new fps: 0.833333 | ||
</ | </pre> | ||
== How Hybrid calls it == | == How Hybrid calls it == | ||
Latest revision as of 09:52, 16 November 2026
SelectRangeEvery keeps one stretch of consecutive frames out of every block and drops the rest, for example 50 frames out of every 1500. It is mainly used to cut a short, representative sample out of a long source for quick test encodes.
Filtering → Vapoursynth → Frame → Reduction

What it does
The clip is cut into blocks of Every frames. From each block Length frames are kept, starting at frame Offset of the block. The sample spreads over the whole clip, so bitrate and quality of a test encode are representative of the full encode.
Settings
| Control | Parameter | Range / values | Hybrid default | Meaning |
|---|---|---|---|---|
| Every | – | 1 – 1000000 | 1500 | Block length in frames. |
| Length | – | 1 – 1000000 | 50 | Frames kept per block. |
| Offset | – | 0 – 100000 | 0 | First kept frame inside each block. |
| Adjust FPS | – | on/off | on | On: the frame rate is lowered in the same ratio as the frame count. Off: the original frame rate is kept, so the sample plays at the source speed. |
Offset + Length can not exceed Every; the controls keep this limit.
Example
Default settings on a 10-bit YUV 4:2:0 source (640x356, 25 fps):
# adjusting frame count with Select(Range)Every clip = core.std.SelectEvery(clip, cycle=1500, offsets=range(0, 0 + 50)) # new fps: 0.833333
How Hybrid calls it
- VapourSynth has no SelectRangeEvery; Hybrid builds it from the core function SelectEvery with the cycle Every and the positions Offset … Offset + Length − 1.
- Works on any format, also on interlaced material; nothing is converted and no value depends on the bit depth. All three values are always written.
- Frame count: Length / Every of the input frames. With Adjust FPS on the frame rate changes by the same factor (29.97 fps, 50 of 1500 → about 1 fps); with Adjust FPS off the input rate is kept.
Background
AviSynth
AviSynth has SelectRangeEvery as a core filter with the same defaults (every 1500, length 50, offset 0). There it also has an option to keep the original audio.
Related
To keep frames at fixed positions of a short cycle, see Vapoursynth SelectEvery.