Extract thumbnails from video
Every video needs a poster image. Thumbnails drive click-through rates in feeds, search results, and video players.
API
curl -X POST https://api.ittybit.com/tasks \
-H "Authorization: Bearer $ITTYBIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "https://example.com/video.mp4", "kind": "image"}'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({
input: "https://example.com/video.mp4",
kind: "image",
}),
});
const task = await res.json();import requests
res = requests.post(
"https://api.ittybit.com/tasks",
headers={"Authorization": f"Bearer {api_key}"},
json={
"input": "https://example.com/video.mp4",
"kind": "image",
},
)
task = res.json() At 5 seconds, resized:
{"input": "https://...", "kind": "image", "options": {"start": 5, "format": "webp", "width": 640}}
CLI
ittybit image -i video.mp4 -o poster.jpg
ittybit image -i video.mp4 -o poster.webp --start 5 --width 640
Multiple sizes
ittybit image -i video.mp4 -o large.webp --width 1280
ittybit image -i video.mp4 -o medium.webp --width 640
ittybit image -i video.mp4 -o small.webp --width 320
Format choice
| Format | Best for |
|---|---|
jpeg | Broadest compatibility |
webp | 25-35% smaller than JPEG |
avif | Smallest files, slower decode |
png | Lossless |
S3 input/output
Extract thumbnails from S3-hosted video using connections:
ittybit image -i s3://uploads/video.mp4 -o s3://media/poster.webp --connection my-s3 --start 5 --width 640
See also
- API
POST /taskswithkind: "image"— extract thumbnails via HTTP - CLI
image— full reference for image flags and options - Convert uploads for web playback — process the video itself
- Extract audio — pull the audio track from the same video