Process files from S3

Your files live in S3 (or R2, or MinIO, or any S3-compatible store). Pass an s3:// URL as input and Ittybit reads directly from your bucket.

Set up a connection

First, create a named connection to your bucket:

ittybit connections add s3 \
  --name my-bucket \
  --endpoint https://s3.us-east-1.amazonaws.com \
  --region us-east-1 \
  --access-key-id $AWS_ACCESS_KEY_ID \
  --secret-access-key $AWS_SECRET_ACCESS_KEY

API

ittybit video \
  -i s3://my-media-bucket/uploads/video.mov \
  --width 1280 \
  --format mp4 \
  --cloud
const task = {
  input: "s3://my-media-bucket/uploads/video.mov",
  kind: "video",
  options: {
    width: 1280,
    format: "mp4",
  },
};

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

task = {
    "input": "s3://my-media-bucket/uploads/video.mov",
    "kind": "video",
    "options": {
        "width": 1280,
        "format": "mp4",
    },
}

res = requests.post(
    "https://api.ittybit.com/tasks",
    headers={"Authorization": f"Bearer {api_key}"},
    json=task,
)
data = res.json()
TASK='{
  "input": "s3://my-media-bucket/uploads/video.mov",
  "kind": "video",
  "options": {
    "width": 1280,
    "format": "mp4"
  }
}'

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

CLI

ittybit video \
  -i s3://my-media-bucket/uploads/video.mov \
  -o processed.mp4 \
  --width 1280

Or reference the connection by name:

ittybit video \
  -i s3://my-media-bucket/uploads/video.mov \
  --connection my-bucket \
  --width 1280

Cloudflare R2

R2 is S3-compatible. Use your R2 endpoint:

ittybit connections add s3 \
  --name my-r2 \
  --endpoint https://<account-id>.r2.cloudflarestorage.com \
  --region auto \
  --access-key-id $R2_ACCESS_KEY_ID \
  --secret-access-key $R2_SECRET_ACCESS_KEY

Then use it the same way:

ittybit video \
  -i s3://my-r2-bucket/video.mov \
  --connection my-r2 \
  --width 1280