Resize video for social platforms
“Megaphone” (a social scheduling app like Buffer) needs to take one video and produce versions sized for different platforms.
Standard sizes
| Platform | Dimensions | Aspect ratio |
|---|---|---|
| YouTube / Web | 1920x1080 | 16:9 |
| Instagram Feed | 1080x1080 | 1:1 |
| Instagram Reels / TikTok | 1080x1920 | 9:16 |
| Twitter / X | 1280x720 | 16:9 |
API
1080p for YouTube:
ittybit video \
-i https://megaphone-app.com/uploads/original.mov \
--width 1920 \
--height 1080 \
--fit cover \
--format mp4 \
--cloudconst 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/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": "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/tasks",
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/tasks \
-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
| Fit | Behavior |
|---|---|
contain | Fits inside dimensions, may letterbox |
cover | Fills dimensions, may crop edges |
fill | Stretches to exact dimensions |
Use cover for social media — it fills the frame cleanly.