Documentation Index

Fetch the complete documentation index at: https://cloudinary.com/documentation/llms.txt

Use this file to discover all available pages before exploring further.

Image & Video APIs

Video crop modes

Last updated: Jun-19-2026

When the dimensions you want to deliver differ from your original video, you can either crop the video to fit or pad it with extra space. Crop modes control how Cloudinary crops the video, determining which part to keep, whether to scale first, and how aggressively to crop. This page covers fill, fill_pad, and crop. For resize and padding modes (scale, fit, limit, pad, lpad), see Video resize modes.

fill

The fill cropping mode creates a video with the exact specified dimensions, without distorting the video. This option first scales up or down as much as needed to at least fill both of the specified dimensions. If the requested aspect ratio is different than the original, cropping will occur on the dimension that exceeds the requested size after scaling. You can specify which part of the original video you want to keep if cropping occurs, using the gravity parameter (set to center by default).

See full syntax: c_fill in the Transformation Reference.

Example 1: Fill a specific area with a video

Fill a 250-pixel square with the Rubik's cube video:

Example 2: Fill a specific area with a specific part of a video

Fill a 250-pixel square with the top-right part (gravity northeast) of the Rubik's cube video:

fill_pad

The fill_pad cropping mode tries to prevent a "bad crop" by adding padding to any frames where interesting content is lost if the standard fill mode is applied. It's especially useful if the aspect ratio of the delivered video is considerably different from the original's aspect ratio. It's only supported in conjunction with Automatic gravity (g_auto).

Notes

See full syntax: c_fill_pad in the Transformation Reference.

Example: Compare standard fill mode with fill_pad mode

The video on the left is delivered at 9:16 aspect ratio using the fill crop mode, and the video on the right using the fill_pad crop mode. You'll see the beginning of the video is cropped the same, but the video on the right then pads the video to ensure all of the subjects are shown.

Original video (click to play)

c_fill c_fill_pad

crop

The crop cropping mode extracts a region of the specified dimensions from the original video. No scaling is applied, so applying the crop mode to the same video of different resolutions can provide very different results. You can specify the gravity parameter to select which area or object to extract, or use fixed coordinates cropping.

See full syntax: c_crop in the Transformation Reference.

Example 1: Crop a video to specified dimensions (width and height)

Crop the video to a width of 500 pixels and a height of 1000 pixels, with north gravity:

Example 2: Crop a video to specified dimensions (aspect ratio and width)

Crop the video to a width of 1000 pixels and an aspect ratio of 2.5:

Fixed coordinates cropping

You can specify a region of the original video to crop by giving the x and y coordinates of the top left corner of the region together with the width and height of the region. You can also use percentage based numbers instead of the exact coordinates for x, y, w and h (e.g., 0.5 for 50%) . Use this method when you know beforehand what the correct absolute cropping coordinates are, as in when your users manually select the region to crop out of the original video.

To resize the Rubik's cube video to focus mainly on the cube, the video is cropped to a 150x150 region starting at the coordinate x = 10 and y = 80:

Cropping videos with non-standard DAR

Some videos have a Display Aspect Ratio (DAR) that differs from their storage dimensions. This is common with anamorphic video content, where the video is stored at one resolution (e.g., 1440x1080) but is intended to be displayed at another (e.g., 1920x1080). The DAR metadata in the video file tells video players how to scale the pixels for correct display.

When you apply a crop or resize mode to anamorphic video, Cloudinary calculates output dimensions from the storage pixel dimensions. By default, Cloudinary also resets the DAR metadata to match the output pixel dimensions. The crop modes affected by this reset are c_scale, c_fit, c_limit, c_fill, and c_pad. Note that c_crop isn't affected because it doesn't modify DAR metadata.

For example, applying c_fill with only a width to this anamorphic video produces a distorted result because the height is calculated from the storage dimensions and the DAR is reset:

Adding fl_keep_dar preserves the original DAR metadata, so the player displays the video at the correct aspect ratio:

Note
When you specify both width and height with c_fill, Cloudinary crops to the exact requested dimensions and resets DAR to match, so the output displays correctly by default. Adding fl_keep_dar in this case preserves the original DAR on the new pixel dimensions, causing the player to stretch or squish the video. Avoid using fl_keep_dar with c_fill on anamorphic video when specifying both width and height.

Related topics
  • Video resize modes: Detailed examples of scale, fit, limit, pad, and lpad, including pad with blurred background and DPR.
  • Video gravity for crops: Control which part of the video is kept when cropping, using compass positions, face detection, and automatic gravity.

✔️ Feedback sent!

Rate this page:

one star two stars three stars four stars five stars