# Extract thumbnails from videos

Robot: `/video/thumbs`

🤖/video/thumbs extracts any number of images from videos for use as previews.

Set `smart: true` to select strong preview images with AI instead of taking frames only at regular intervals. The Robot scores candidate frames for clarity, brightness, composition, faces, expressions, action, and visual interest, then returns the best `count` frames in chronological order. Smart results include `file.meta.smart_score` and `file.meta.smart_reasons`. If AI scoring is unavailable, the Assembly continues with the candidate frames in fallback order. No AI credentials are required.

## AI pricing

Regular `/video/thumbs` processing charges still apply. AI frame analysis is billed separately at the underlying provider cost plus a 50% Transloadit markup. The exact AI charge varies with the number of candidate frames, the internally selected model and provider pricing, and the image payload size.

`smart_max_candidates` is the main cost and latency control. The Robot analyzes up to three candidates per requested thumbnail, capped by `smart_max_candidates`, but never fewer than `count`. With the defaults of `count: 8` and `smart_max_candidates: 20`, it analyzes 20 frames and returns the best 8. Lower the candidate limit to reduce AI cost and latency; raise it to give the AI more frames to choose from.

> [!Note]
> Use `count` with smart selection. The `offsets` parameter is for extracting exact timestamps and should not be combined with `smart`.

Stage: ga

## Usage example

Select three visually appealing thumbnails from each uploaded video with AI:

```json
{
  "steps": {
    "thumbnailed": {
      "robot": "/video/thumbs",
      "use": ":original",
      "count": 3,
      "ffmpeg_stack": "v7",
      "smart": true,
      "smart_max_candidates": 12
    }
  }
}
```

## Parameters

* `interpolate`: Controls whether Assembly Variables are interpolated for individual instruction fields.

  By default, most Robot instruction fields interpolate Assembly Variables. Set this to `false` to treat every instruction field as literal text, or set an individual field path to `false` to treat only that field as literal text. For Robot-specific fields that are literal by default, set this to `true` or set that field path to `true` to opt back into interpolation.

  Use field names such as `path`, or dotted paths such as `ffmpeg.vf` for nested objects.

* `output_meta`: Allows you to specify a set of metadata that is more expensive on CPU power to calculate, and thus is disabled by default to keep your Assemblies processing fast.

  For images, you can add `"has_transparency": true` in this object to extract if the image contains transparent parts and `"dominant_colors": true` to extract an array of hexadecimal color codes from the image.

  For images, you can also add `"blurhash": true` to extract a [BlurHash](https://blurha.sh) string — a compact representation of a placeholder for the image, useful for showing a blurred preview while the full image loads.

  For videos, you can add the `"colorspace": true` parameter to extract the colorspace of the output video.

  For videos, you can also add `"interlaced": true` to detect whether the video is interlaced. This combines the cheap ffprobe `field_order` flag with a bounded `idet` sampling pass over the first frames of the source, exposing `interlaced`, `field_order`, and a diagnostic `interlace_detection` object under `file.meta`. This is computationally expensive and billed accordingly.

  For audio, you can add `"mean_volume": true` to get a single value representing the mean average volume of the audio file.

  You can also set this to `false` to skip metadata extraction and speed up transcoding.

* `user_meta`: Adds custom metadata to each file emitted by this Robot without modifying the file’s contents.

  The values are merged with any existing `user_meta` carried by the input file. If both objects contain the same key, this Robot’s value takes precedence. Assembly Variables are supported, for example `{ "internal_file_id": "${file.id}" }`.

* `result`: Whether the results of this Step should be present in the Assembly Status JSON

* `queue`: Setting the queue to 'batch', manually downgrades the priority of jobs for this step to avoid consuming Priority job slots for jobs that don't need zero queue waiting times

* `force_accept`: Force a Robot to accept a file type it would have ignored.

  By default, Robots ignore files they are not familiar with.
  [🤖/video/encode](/docs/robots/video-encode.md), for
  example, will happily ignore input images.

  With the `force_accept` parameter set to `true`, you can force Robots to accept all files thrown at them.
  This will typically lead to errors and should only be used for debugging or combatting edge cases.

* `ignore_errors`: Ignore errors during specific phases of processing.

  Setting this to `["meta"]` will cause the Robot to ignore errors during metadata extraction.

  Setting this to `["execute"]` will cause the Robot to ignore errors during the main execution phase.

  Setting this to `true` is equivalent to `["meta", "execute"]` and will ignore errors in both phases.

* `use`: Specifies which Step(s) to use as input.

  * You can pick any names for Steps except `":original"` (reserved for user uploads handled by Transloadit)
  * You can provide several Steps as input with arrays:
    ```json
    {
      "use": [
        ":original",
        "encoded",
        "resized"
      ]
    }
    ```
  * You can also tag input Steps with `as` to pass semantic intent to robots:
    ```json
    {
      "use": [
        {
          "name": ":original",
          "as": "image"
        },
        {
          "name": ":original",
          "as": "mask"
        }
      ]
    }
    ```

  > [!Tip]
  > That's likely all you need to know about `use`, but you can view [Advanced use cases](/docs/topics/use-parameter.md).

* `ffmpeg`: A parameter object to be passed to FFmpeg. If a preset is used, the options specified are merged on top of the ones from the preset. For available options, see the [FFmpeg documentation](https://ffmpeg.org/ffmpeg-doc.html). Options specified here take precedence over the preset options.

* `ffmpeg_stack`: Selects the FFmpeg stack version to use for encoding. We currently recommend using "v7". The exact versions "v6.0.0", "v7.0.0", and "v8.0.0" are legacy values that remain accepted for backward compatibility. Deprecated "v5.x" values are also accepted.

* `count`: The number of thumbnails to be extracted. As some videos have incorrect durations, the actual number of thumbnails generated may be less in rare cases. The maximum number of thumbnails we currently allow is 999.

  The thumbnails are taken at regular intervals, determined by dividing the video duration by the count. For example, a count of 3 will produce thumbnails at 25%, 50% and 75% through the video.

  To extract thumbnails for specific timestamps, use the `offsets` parameter.

* `offsets`: An array of offsets representing seconds of the file duration, such as `[ 2, 45, 120 ]`. Millisecond durations of a file can also be used by using decimal place values. For example, an offset from 1250 milliseconds would be represented with `1.25`. Offsets can also be percentage values such as `[ "2%", "50%", "75%" ]`.

  This option cannot be used with the `count` parameter, and takes precedence if both are specified. Out-of-range offsets are silently ignored.

* `format`: The format of the extracted thumbnail. Supported values are `"jpg"`, `"jpeg"` and `"png"`. Even if you specify the format to be `"jpeg"` the resulting thumbnails will have a `"jpg"` file extension.

* `width`: The width of the thumbnail, in pixels. Defaults to the original width of the video.

* `height`: The height of the thumbnail, in pixels. Defaults to the original height of the video.

* `resize_strategy`: One of the [available resize strategies](/docs/topics/resize-strategies.md).

* `background`: The background color of the resulting thumbnails in the `"rrggbbaa"` format (red, green, blue, alpha) when used with the `"pad"` resize strategy. The default color is black.

* `rotate`: Forces the video to be rotated by the specified degree integer. Currently, only multiples of 90 are supported. We automatically correct the orientation of many videos when the orientation is provided by the camera. This option is only useful for videos requiring rotation because it was not detected by the camera.

* `input_codec`: Specifies the input codec to use when decoding the video. This is useful for videos with special codecs that require specific decoders.

* `smart`: When set to `true`, enables AI-powered smart thumbnail selection. Instead of returning thumbnails at regular intervals, the Robot will analyze candidate frames and select the most visually appealing ones.

  The AI evaluates frames based on:

  * Visual clarity (avoiding blurry or dark frames)
  * Composition quality
  * Face presence and expressions
  * Action and motion (avoiding transition frames)
  * Overall visual interest

  Regular `/video/thumbs` processing charges still apply. AI frame analysis is billed separately at the underlying provider cost plus a 50% Transloadit markup. You do not need to provide AI credentials.

* `smart_max_candidates`: The maximum size of the extra candidate pool when `smart` is `true`. The Robot analyzes up to three candidates per requested thumbnail, capped by this value, but it will never analyze fewer candidates than the requested `count`.

  A higher number may yield better results but increases processing time and AI cost. With the defaults of `count: 8` and `smart_max_candidates: 20`, the Robot analyzes 20 frames and returns the best 8 in chronological order.

  This parameter is only used when `smart` is `true`.
