← All tools
Crop video frame
Videovideo.crop
in: videoout: video
Crop video frame to a rectangle.
Pricing
- Price
- 6.25 cr / second
Prices in credits (1 credit = $0.01).
Crop Video Frame
Crop the video frame to a rectangular region, discarding everything outside it.
When to use
- Remove black bars from letterboxed or pillarboxed recordings.
- Focus on a region of interest within the frame.
- Square crop for social media formats.
Inputs & outputs
| Input modality | Video file (URL) |
| Output modality | Video file (GCS URL) |
| Max input duration | 30 min |
| Max input size | 5 GB |
Parameters
| Param | Required | Description |
|---|---|---|
x | yes | Left edge of the crop rectangle in pixels (non-negative) |
y | yes | Top edge of the crop rectangle in pixels (non-negative) |
width | yes | Width of the crop rectangle in pixels (positive) |
height | yes | Height of the crop rectangle in pixels (positive) |
All coordinates are relative to the top-left corner of the original frame.
Examples
Center crop to 640×480 from a 960×540 video
{
"type": "video.crop",
"input": { "video_url": "gs://infery-prod-media/example/input.mp4" },
"params": { "x": 160, "y": 30, "width": 640, "height": 480 }
}
Remove 20px border on all sides from a 1280×720 video
{
"type": "video.crop",
"input": { "video_url": "gs://infery-prod-media/example/input.mp4" },
"params": { "x": 20, "y": 20, "width": 1240, "height": 680 }
}
Related capabilities
video.scale— resize after cropping to hit an exact output resolutionvideo.watermark— overlay a logo on the cropped resultvideo.pipeline— chain crop with scale and transcode in one step
Examples
Center crop 640×480
{
"x": 160,
"y": 60,
"width": 640,
"height": 480
}