# video


Transcode, resize, and trim video

```bash
ittybit video \
  -i input.mp4 \
  -o output.mp4
```

Converts video between formats, codecs, and resolutions. Smaller files mean faster page loads and lower CDN costs.

## Options

| Flag           | Values                                               | Default       |
| -------------- | ---------------------------------------------------- | ------------- |
| `--format`     | `mp4` · `webm` · `mov`                               | `mp4`         |
| `--codec`      | `h264` · `h265` · `vp9` · `av1`                      | per format    |
| `--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`)                           | —             |
| `--fps`        | 1–60                                                 | same as input |
| `--start`      | seconds                                              | —             |
| `--end`        | seconds                                              | —             |
| `--no-audio`   |                                                      | strip audio   |
| `--frames`     | integer                                              | —             |

## Examples

Make a video work in every browser:

```bash
ittybit video \
  -i recording.mov \
  -o web.mp4
```

Defaults to h264 + AAC in MP4.

---

Resize and compress:

```bash
ittybit video \
  -i 4k.mp4 \
  -o 720p.mp4 \
  --width 1280 \
  --quality medium
```

---

Trim a clip:

```bash
ittybit video \
  -i long.mp4 \
  -o clip.mp4 \
  --start 10 \
  --end 15
```

---

WebM with VP9:

```bash
ittybit video \
  -i input.mp4 \
  -o output.webm \
  --format webm \
  --codec vp9
```

Codec must match container: h264/h265 → mp4/mov, vp9 → webm, av1 → mp4/webm.

---

Output to S3:

```bash
ittybit video \
  -i input.mp4 \
  -o s3://bucket/output.mp4 \
  --connection my-s3
```

---

Read from S3 and write back to S3:

```bash
ittybit video \
  -i s3://bucket/raw/upload.mov \
  -o s3://bucket/web/video.mp4 \
  --connection my-s3 \
  --quality medium
```

## Local

Run locally using FFmpeg instead of cloud:

```bash
ittybit video \
  -i input.mp4 \
  -o output.mp4 \
  --local \
  --quality medium
```

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

## See also

- [API `POST /jobs`](/api/create-job) with `kind: "video"` — process via HTTP
- [Convert uploads for web playback](/guides/web-video) — full guide for browser-ready video
- [`audio`](/cli/audio) — extract audio from video
- [`image`](/cli/image) — extract frames from video
- [`adaptive`](/cli/adaptive) — create HLS streams from video
- [`connections`](/cli/connections) — set up S3 for input/output