Skip to content

Resize Video

The resize recipe scales video to a target width and height. Specify one or both dimensions — if you only set one, the other scales proportionally to preserve aspect ratio.

Resize to 1280×720 (HD):

Terminal window
curl -X POST https://api.xora.sh/v1/jobs \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "recipe",
"input": {
"url": "https://example.com/4k-video.mp4"
},
"output": {
"format": "mp4"
},
"recipe": {
"name": "resize",
"width": 1280,
"height": 720
}
}'
{
"jobId": "01JXYZ1234ABCDEF56789000",
"state": "queued"
}
ParameterTypeRequiredDescription
namestringYesMust be "resize"
widthnumberNo*Target width in pixels
heightnumberNo*Target height in pixels

*At least one of width or height is needed to resize.

ProvidedBehavior
Both width and heightScales to exact dimensions
Only widthHeight auto-calculated to preserve aspect ratio
Only heightWidth auto-calculated to preserve aspect ratio
NameWidthHeightAspect
4K UHD3840216016:9
1080p Full HD1920108016:9
720p HD128072016:9
480p SD85448016:9
Instagram Square108010801:1
Instagram Story108019209:16

Only set width to scale proportionally:

{
"mode": "recipe",
"input": { "url": "https://example.com/4k-video.mp4" },
"output": { "format": "mp4" },
"recipe": { "name": "resize", "width": 1280 }
}

A 3840×2160 input becomes 1280×720 (maintains 16:9).

{
"mode": "recipe",
"input": { "url": "https://example.com/landscape.mp4" },
"output": { "format": "mp4" },
"recipe": { "name": "resize", "width": 1080, "height": 1920 }
}
{
"mode": "recipe",
"input": { "url": "https://example.com/video.mp4" },
"output": { "format": "webm" },
"recipe": { "name": "resize", "width": 854, "height": 480 }
}
FormatDescription
mp4H.264 in MP4 container
webmVP8/VP9 in WebM container
movH.264 in QuickTime container