Generate social media cuts from long video

View Markdown

One video, three platforms, three aspect ratios. โ€œClipForgeโ€ (a creator tools platform like Canva or Descript) lets users mark a highlight in a long recording and publish vertical, square, and widescreen cuts in one step.

API

Trim a 30-second highlight and output a vertical cut for Reels/TikTok:

ittybit video \
  -i https://clipforge-app.com/uploads/webinar-full.mp4 \
  --start 124 \
  --end 154 \
  --width 1080 \
  --height 1920 \
  --crop center \
  --format mp4
const task = {
  input: 'https://clipforge-app.com/uploads/webinar-full.mp4',
  kind: 'video',
  options: {
    start: 124,
    end: 154,
    width: 1080,
    height: 1920,
    crop: 'center',
    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://clipforge-app.com/uploads/webinar-full.mp4",
    "kind": "video",
    "options": {
        "start": 124,
        "end": 154,
        "width": 1080,
        "height": 1920,
        "crop": "center",
        "format": "mp4",
    },
}

res = requests.post(
    "https://api.ittybit.com/jobs",
    headers={"Authorization": f"Bearer {api_key}"},
    json=task,
)
data = res.json()
TASK='{
  "input": "https://clipforge-app.com/uploads/webinar-full.mp4",
  "kind": "video",
  "options": {
    "start": 124,
    "end": 154,
    "width": 1080,
    "height": 1920,
    "crop": "center",
    "format": "mp4"
  }
}'

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

Square and widescreen variants

Fire all three tasks from the same input. Each produces a different frame size:

Square (1:1) for Instagram/LinkedIn:

{
  "input": "https://clipforge-app.com/uploads/webinar-full.mp4",
  "kind": "video",
  "options": {
    "start": 124,
    "end": 154,
    "width": 1080,
    "height": 1080,
    "crop": "center",
    "format": "mp4"
  }
}

Widescreen (16:9) for YouTube:

{
  "input": "https://clipforge-app.com/uploads/webinar-full.mp4",
  "kind": "video",
  "options": {
    "start": 124,
    "end": 154,
    "width": 1920,
    "height": 1080,
    "format": "mp4"
  }
}

CLI

All three cuts from one source file:

# Vertical -- Reels / TikTok (9:16)
ittybit video \
  -i webinar-full.mp4 \
  -o clip-vertical.mp4 \
  --start 124 --end 154 \
  --width 1080 --height 1920 \
  --crop center

# Square -- Instagram / LinkedIn (1:1)
ittybit video \
  -i webinar-full.mp4 \
  -o clip-square.mp4 \
  --start 124 --end 154 \
  --width 1080 --height 1080 \
  --crop center

# Widescreen -- YouTube (16:9)
ittybit video \
  -i webinar-full.mp4 \
  -o clip-wide.mp4 \
  --start 124 --end 154 \
  --width 1920 --height 1080

Automating all three via the API

In production, ClipForge submits all three tasks in parallel once a user confirms their highlight range:

const cuts = [
  { width: 1080, height: 1920, crop: 'center', label: 'vertical' },
  { width: 1080, height: 1080, crop: 'center', label: 'square' },
  { width: 1920, height: 1080, label: 'wide' },
];

const tasks = cuts.map(({ label, ...options }) => ({
  input: 'https://clipforge-app.com/uploads/webinar-full.mp4',
  kind: 'video',
  options: { start: 124, end: 154, format: 'mp4', ...options },
}));

const results = await Promise.all(
  tasks.map((task) =>
    fetch('https://api.ittybit.com/jobs', {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.ITTYBIT_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(task),
    }).then((r) => r.json()),
  ),
);

Three tasks, one input, zero re-uploads.

Output dimensions reference

PlatformAspect ratioWidthHeightCrop
TikTok / Reels9:1610801920center
Instagram / LinkedIn1:110801080center
YouTube16:919201080โ€”