Resize video for social platforms

View Markdown

โ€œMegaphoneโ€ (a social scheduling app like Buffer) needs to take one video and produce versions sized for different platforms.

Standard sizes

PlatformDimensionsAspect ratio
YouTube / Web1920x108016:9
Instagram Feed1080x10801:1
Instagram Reels / TikTok1080x19209:16
Twitter / X1280x72016:9

API

1080p for YouTube:

ittybit video \
  -i https://megaphone-app.com/uploads/original.mov \
  --width 1920 \
  --height 1080 \
  --fit cover \
  --format mp4
const task = {
  input: 'https://megaphone-app.com/uploads/original.mov',
  kind: 'video',
  options: {
    width: 1920,
    height: 1080,
    fit: 'cover',
    format: 'mp4',
  },
};

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://megaphone-app.com/uploads/original.mov",
    "kind": "video",
    "options": {
        "width": 1920,
        "height": 1080,
        "fit": "cover",
        "format": "mp4",
    },
}

res = requests.post(
    "https://api.ittybit.com/jobs",
    headers={"Authorization": f"Bearer {api_key}"},
    json=task,
)
data = res.json()
TASK='{
  "input": "https://megaphone-app.com/uploads/original.mov",
  "kind": "video",
  "options": {
    "width": 1920,
    "height": 1080,
    "fit": "cover",
    "format": "mp4"
  }
}'

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

Square for Instagram feed:

{
  "input": "https://...",
  "kind": "video",
  "options": { "width": 1080, "height": 1080, "fit": "cover", "format": "mp4" }
}

Vertical for Reels/TikTok:

{
  "input": "https://...",
  "kind": "video",
  "options": { "width": 1080, "height": 1920, "fit": "cover", "format": "mp4" }
}

CLI

ittybit video \
  -i original.mov \
  -o youtube.mp4 \
  --width 1920 \
  --height 1080 \
  --fit cover

ittybit video \
  -i original.mov \
  -o square.mp4 \
  --width 1080 \
  --height 1080 \
  --fit cover

ittybit video \
  -i original.mov \
  -o reels.mp4 \
  --width 1080 \
  --height 1920 \
  --fit cover

Fit modes

FitBehavior
containFits inside dimensions, may letterbox
coverFills dimensions, may crop edges
fillStretches to exact dimensions

Use cover for social media โ€” it fills the frame cleanly.