# Extract thumbnails from video

Pull poster frames as JPEG, WebP, or AVIF

Every video needs a poster image. Thumbnails drive click-through rates in feeds, search results, and video players.

## API

<CodeGroup labels={["CLI", "TypeScript", "Python", "curl"]}>
```bash
ittybit image \
  -i https://example.com/video.mp4
```

```typescript
const task = {
  input: 'https://example.com/video.mp4',
  kind: 'image',
};

const res = await fetch('https://api.ittybit.com/jobs', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.ITTYBIT_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(task),
});
const data = await res.json();
```

```python

task = {
    "input": "https://example.com/video.mp4",
    "kind": "image",
}

res = requests.post(
    "https://api.ittybit.com/jobs",
    headers={"Authorization": f"Bearer {api_key}"},
    json=task,
)
data = res.json()
```

```bash
TASK='{
  "input": "https://example.com/video.mp4",
  "kind": "image"
}'

curl -X POST https://api.ittybit.com/jobs \
  -H "Authorization: Bearer $ITTYBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$TASK"
```

</CodeGroup>

At 5 seconds, resized:

```json
{
  "input": "https://...",
  "kind": "image",
  "options": { "start": 5, "format": "webp", "width": 640 }
}
```

## CLI

```bash
ittybit image \
  -i video.mp4 \
  -o poster.jpg

ittybit image \
  -i video.mp4 \
  -o poster.webp \
  --start 5 \
  --width 640
```

## Multiple sizes

```bash
ittybit image \
  -i video.mp4 \
  -o large.webp \
  --width 1280

ittybit image \
  -i video.mp4 \
  -o medium.webp \
  --width 640

ittybit image \
  -i video.mp4 \
  -o small.webp \
  --width 320
```

## Format choice

| Format | Best for                      |
| ------ | ----------------------------- |
| `jpeg` | Broadest compatibility        |
| `webp` | 25-35% smaller than JPEG      |
| `avif` | Smallest files, slower decode |
| `png`  | Lossless                      |

## S3 input/output

Extract thumbnails from S3-hosted video using [connections](/cli/connections):

```bash
ittybit image \
  -i s3://uploads/video.mp4 \
  -o s3://media/poster.webp \
  --connection my-s3 \
  --start 5 \
  --width 640
```

## See also

- [API `POST /jobs`](/api/create-job) with `kind: "image"` — extract thumbnails via HTTP
- [CLI `image`](/cli/image) — full reference for image flags and options
- [Convert uploads for web playback](/guides/convert-uploads-for-web-playback) — process the video itself
- [Extract audio](/guides/extract-audio-from-video) — pull the audio track from the same video