Encode video with AV1

View Markdown

AV1 produces files 30-50% smaller than h264 at comparable quality. The tradeoff is slower encoding โ€” which is where parallel chunked encoding helps.

โ€œStreamlineโ€ (a video hosting platform like Vimeo) wants to cut bandwidth costs without degrading quality.

API

ittybit video \
  -i https://streamline-app.com/uploads/talk.mov \
  --codec av1 \
  --format mp4 \
  --quality high
const task = {
  input: 'https://streamline-app.com/uploads/talk.mov',
  kind: 'video',
  options: {
    codec: 'av1',
    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();
import requests

task = {
    "input": "https://streamline-app.com/uploads/talk.mov",
    "kind": "video",
    "options": {
        "codec": "av1",
        "format": "mp4",
        "quality": "high",
    },
}

res = requests.post(
    "https://api.ittybit.com/jobs",
    headers={"Authorization": f"Bearer {api_key}"},
    json=task,
)
data = res.json()
TASK='{
  "input": "https://streamline-app.com/uploads/talk.mov",
  "kind": "video",
  "options": {
    "codec": "av1",
    "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"

CLI

ittybit video \
  -i talk.mov \
  -o talk-av1.mp4 \
  --codec av1 \
  --quality high

Codec comparison

CodecContainerBrowser supportFile sizeEncode speed
h264mp4EverythingBaselineFast
h265mp4Safari, Edge~30% smallerMedium
vp9webmChrome, Firefox~30% smallerMedium
av1mp4, webmModern browsers~40% smallerSlow*

*AV1 encoding is slow sequentially. Ittybit splits the video into chunks and encodes them in parallel โ€” on managed cloud, this is up to 200x faster than sequential.

With fallback

Encode both h264 (universal) and AV1 (smaller). Serve AV1 to browsers that support it:

ittybit video \
  -i talk.mov \
  -o talk-h264.mp4 \
  --codec h264 \
  --quality high

ittybit video \
  -i talk.mov \
  -o talk-av1.mp4 \
  --codec av1 \
  --quality high