# animation


Extract animated clips from video as GIF or WebP

```bash
ittybit animation \
  -i video.mp4 \
  -o clip.gif \
  --start 3 \
  --end 6
```

Extracts a short animated clip from a video as GIF or WebP. Use this for reaction GIFs, preview loops, or animated thumbnails.

## Options

| Flag           | Values                                               | Default       |
| -------------- | ---------------------------------------------------- | ------------- |
| `--format`     | `gif` · `webp`                                       | `gif`         |
| `--quality`    | `very_low` · `low` · `medium` · `high` · `very_high` | auto          |
| `--width`      | pixels or `"50%"`                                    | same as input |
| `--height`     | pixels or `"50%"`                                    | same as input |
| `--fit`        | `contain` · `cover` · `fill`                         | ---           |
| `--background` | hex color (e.g. `#000000`)                           | ---           |
| `--start`      | seconds                                              | 0             |
| `--end`        | seconds (required)                                   | ---           |
| `--fps`        | frame rate                                           | 10            |

## Examples

Extract a 3-second GIF:

```bash
ittybit animation \
  -i video.mp4 \
  -o reaction.gif \
  --start 3 \
  --end 6 \
  --width 320
```

---

Use WebP for smaller files:

```bash
ittybit animation \
  -i video.mp4 \
  -o clip.webp \
  --start 10 \
  --end 15 \
  --width 480 \
  --quality medium
```

---

Output to S3:

```bash
ittybit animation \
  -i s3://bucket/raw/video.mp4 \
  -o s3://bucket/clips/reaction.gif \
  --connection my-s3 \
  --start 3 \
  --end 6 \
  --width 320
```

## Local

Run locally using FFmpeg instead of cloud:

```bash
ittybit animation \
  -i video.mp4 \
  -o reaction.gif \
  --local \
  --start 3 \
  --end 6 \
  --width 320
```

Requires FFmpeg installed. The file is processed on your machine.

## See also

- [API `POST /jobs`](/api/create-job) with `kind: "animation"` --- process animated clips via HTTP
- [Extract GIF from video](/guides/extract-gif-from-video) --- full guide
- [`image`](/cli/image) --- extract a single frame
- [`video`](/cli/video) --- transcode the full video
- [`connections`](/cli/connections) --- set up S3 for input/output