Configure FFmpeg Thumbnail Filter Search Window

This article explains how to configure the search window size in the FFmpeg thumbnail filter. By adjusting this parameter, you can control the number of consecutive frames FFmpeg analyzes to select the most representative image for your video thumbnail.

The FFmpeg thumbnail filter works by analyzing a sequence of frames and choosing the one that best represents the entire batch based on color histogram analysis. The size of this sequence—referred to as the search window—is determined by a single option within the filter.

The Search Window Parameter

To configure the search window size, you use the n option (or simply pass a single numeric argument to the filter). This number defines the frame cluster size.

The basic syntax is:

thumbnail=batch_size

Or explicitly:

thumbnail=n=batch_size

How to Use It in a Command

By default, if you do not specify a value, FFmpeg uses a default search window size of 100 frames.

To change this window size, apply the video filter (-vf) in your FFmpeg command. For example, to expand the search window to 300 frames to find a representative image from a wider selection, use the following command:

ffmpeg -i input.mp4 -vf "thumbnail=300" -frames:v 1 output.png

Choosing the Right Window Size