> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# coreav thumbnail

> Write a JPEG, PNG or WebP image of the frame at a time. Builds with a decoder backend only.

> [!NOTE]
>
> `coreav thumbnail` is only in builds with a decoder backend: `ffmpeg-fallback`, `dav1d`, `libvpx` or `native-h264` ([build features](/docs/build-features.md)).

`coreav thumbnail --output FILE INPUT` writes an image of an MP4, MOV, Matroska or WebM file: the keyframe at or before `--at`, or with `--exact` the frame at that time. The image is resized to `--width` or `--height`, keeping the display aspect ratio, and encoded as JPEG, PNG or WebP. The summary ([`coreav.thumbnail/1`](https://github.com/coreav-dev/coreav/blob/main/docs/schema/thumbnail-v1.md)) names the backend that decoded the frame.

Only the codecs on `--allow` are decoded, by default H.264, HEVC, AV1, VP9, VP8 and ProRes. Decoding stops after `--timeout` seconds. In [strict-safe mode](/docs/strict-safe.md#what-strict-safe-mode-covers) the `ffmpeg-fallback` backend does not decode, and a video only it would decode is refused with exit status 4.

## Examples

```sh theme={null}
coreav thumbnail --at 12.5 --width 320 -o poster.jpg input.mp4
coreav thumbnail --at 00:01:30 --exact --format webp -o frame.webp input.mkv
```

[The thumbnails design note](https://github.com/coreav-dev/coreav/blob/main/docs/design/thumbnails.md) has the details.

## Options

```text theme={null}
Write a thumbnail of an MP4, MOV, Matroska or WebM file: the keyframe at or before a time (or with --exact the frame at it), resized and encoded as JPEG, PNG or WebP

Usage: coreav thumbnail [OPTIONS] --output <FILE> <INPUT>

Arguments:
  <INPUT>  The file (or http(s) URL) to take the thumbnail of

Options:
  -o, --output <FILE>      Where to write the image: a new file, or `-` for standard output
      --at <TIME>          The time, from the file's start as for `ffmpeg -ss`: seconds (`12`, `12.5`, `12.5s`), milliseconds (`1500ms`) or `[HH:]MM:SS[.fff]` [default: 0]
      --exact              The first frame at or after the time (decoding from the keyframe before it) instead of the keyframe at or before it
      --width <PIXELS>     Image width; the height follows the display aspect ratio unless --height is given too
      --height <PIXELS>    Image height
      --format <FORMAT>    `jpeg`, `png` or `webp` (lossless); default: from the output's extension, else `jpeg` [possible values: jpeg, jpg, png, webp]
      --quality <Q>        JPEG quality, 1 to 100 [default: 91]
      --stream <STREAM>    The video stream index (default: the first video stream)
      --allow <CODEC>      Codecs that may be decoded, comma separated, by `ffprobe`'s names (default: h264, hevc, av1, vp9, vp8, prores)
      --threads <N>        Decoder threads (default: the decoder's own choice); fewer when the frames would not fit the decoder's memory budget [default: 0]
      --timeout <SECONDS>  Seconds decoding may take before it is stopped [default: 30]
      --force              Overwrite OUTPUT if it exists
  -h, --help               Print help
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.