# Process course videos for streaming

Convert lecture recordings to streamable formats with multiple quality levels

"Chalkboard" (a course platform like Teachable) gets uploads ranging from phone recordings to 4K screencasts. Every video needs to stream smoothly on any device and connection.

## Step 1: Web-ready MP4

Convert the raw upload to a browser-friendly format:

<CodeGroup labels={["CLI", "TypeScript", "Python", "curl"]}>
```bash
ittybit video \
  -i https://chalkboard-app.com/uploads/lesson-3.mov \
  --width 1920 \
  --format mp4 \
  --quality high
```

```typescript
const task = {
  input: 'https://chalkboard-app.com/uploads/lesson-3.mov',
  kind: 'video',
  options: {
    width: 1920,
    format: 'mp4',
    quality: 'high',
  },
};

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://chalkboard-app.com/uploads/lesson-3.mov",
    "kind": "video",
    "options": {
        "width": 1920,
        "format": "mp4",
        "quality": "high",
    },
}

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

```bash
TASK='{
  "input": "https://chalkboard-app.com/uploads/lesson-3.mov",
  "kind": "video",
  "options": {
    "width": 1920,
    "format": "mp4",
    "quality": "high"
  }
}'

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

</CodeGroup>

## Step 2: HLS for adaptive streaming

For longer lectures, HLS adapts to the viewer's bandwidth:

```json
{ "input": "https://...", "kind": "adaptive_video", "options": { "format": "hls" } }
```

## Step 3: Thumbnail for the catalog

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

## CLI -- all three steps

```bash
ittybit video \
  -i lesson-3.mov \
  -o lesson-3.mp4 \
  --width 1920 \
  --quality high

ittybit adaptive \
  -i lesson-3.mov \
  -o lesson-3.m3u8

ittybit image \
  -i lesson-3.mov \
  -o lesson-3-thumb.webp \
  --start 10 \
  --width 640
```

## Quality recommendations for courses

| Content type        | Recommended width | Quality  |
| ------------------- | ----------------- | -------- |
| Talking head        | 1280              | `medium` |
| Screencast          | 1920              | `high`   |
| Whiteboard / slides | 1920              | `high`   |
| Phone recording     | 720               | `medium` |