# Extract frames from video and animations

> Use the frame parameter to extract a single still frame from a video or animated image.

`frame` extracts a single frame from a video or animated image, which is commonly used to generate covers, thumbnails, and previews. You can apply any other image parameter to the extracted frame, including resize, crop, watermark, and format conversion.

## Parameters

| Parameter    | Source type    | Meaning                             | Values                |
| :----------- | -------------- | ----------------------------------- | --------------------- |
| `frame`      | Video          | **Timestamp**, in milliseconds      | Integer, 0 or greater |
| `frame`      | Animated image | **Frame number**, starting from 1   | Integer, 1 or greater |
| `frame=auto` | Video          | **Automatic cover frame selection** | `auto`                |

### Video

- `frame=0`: the first frame
- `frame=5000`: the frame at 5 seconds
- `frame=60000`: the frame at 1 minute

Frames captured from HDR video (including Dolby Vision) keep HDR by default. See [HDR images and video](/en/coreix/hdr).

### Animated images

Supported formats: GIF, animated WebP, APNG, and animated AVIF.

- `frame=1`: the first frame
- `frame=n`: the nth frame

> **Warning**
>
> If the specified frame number exceeds the actual number of frames, the last frame is returned.

### Automatic cover frame selection

`frame=auto` automatically picks a frame from the video that works well as a cover: it avoids black frames, white flashes, and solid-color frames, and favors a sharp, colorful, well-composed frame.

- The selected timestamp is returned in the `x-coreix-frame-time` response header, in milliseconds.
- If frame selection fails, the first frame is returned.

> **Tip**
>
> To extract a segment rather than a single frame (clipping video, converting video to an animation, or extracting part of an animated image), use the range syntax of `frame`. See [Clip video and convert to animations](/en/coreix/features/video-clip).

## Examples

Source video: <https://demo.bitiful.com/hdr-img/rainbow.mov>

Capture the frame at 4950 ms and resize it to 1000 px wide: [https://demo.bitiful.com/hdr-img/rainbow.mov? **`frame=4950 & w=1000`**](https://demo.bitiful.com/hdr-img/rainbow.mov?frame=4950\&w=1000)

![Video frame capture: 4950 ms](https://demo.bitiful.com/hdr-img/rainbow.mov?frame=4950\&w=1000)

Automatic cover frame selection:

<https://demo.bitiful.com/hdr-img/rainbow.mov?frame=auto&w=1000>
