# adaptive


Create HLS adaptive bitrate streams

```bash
ittybit adaptive \
  -i video.mp4 \
  -o stream.m3u8
```

Creates an HLS stream. Players switch quality based on viewer bandwidth. Output must be `.m3u8`. Adaptive streams prevent buffering for users on slow connections.

## Options

| Flag      | Values  | Default |
| --------- | ------- | ------- |
| `--start` | seconds | —       |
| `--end`   | seconds | —       |

## Examples

```bash
ittybit adaptive \
  -i video.mp4 \
  -o output/stream.m3u8
```

Trim before streaming:

```bash
ittybit adaptive \
  -i video.mp4 \
  -o trimmed.m3u8 \
  --start 10 \
  --end 120
```

---

From S3 to S3:

```bash
ittybit adaptive \
  -i s3://bucket/raw/video.mp4 \
  -o s3://bucket/streams/stream.m3u8 \
  --connection my-s3
```

## Local

Run locally using FFmpeg instead of cloud:

```bash
ittybit adaptive \
  -i video.mp4 \
  -o ./hls/master.m3u8 \
  --local
```

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

## See also

- [API `POST /jobs`](/api/create-job) with `kind: "adaptive_video"` — create HLS streams via HTTP
- [`video`](/cli/video) — produce a single-file MP4 instead
- [`connections`](/cli/connections) — set up S3 for input/output