Transformation Options

API reference for video transformation like crop, pad, and trim. Following transformations can be used with Create Asset request with specified parameters.

Crop

This transformation can be used to crop the video by defining a rectangular area within the dimensions of the output video. Crop transformation takes the following parameters embedded within crop. Either width or height is required for this transformation.

Parameter

Description

horizontal_margin

This parameter defines the horizontal coordinate value of the upper-left corner of the cropping area. Values can be an absolute number of pixels or a percentage value relative to the video width. Default: 0

vertical_margin

This parameter defines the vertical coordinate value of the upper-left corner of the cropping area. Values can be an absolute number of pixels or a percentage value relative to the video height. Default: 0

width

Width of the cropping area in pixels.

height

Height of the cropping area in pixels.

cURL
cropped
original
cURL
curl -L -X POST 'https://api.gumlet.com/v1/video/process' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"input":"https://gumlet.sgp1.digitaloceanspaces.com/video/sample_1.mp4",
"source_id": "5f462c1561cf8a766464ffc4",
"format": "mp4",
"crop": {
"horizontal_margin": "10%",
"vertical_margin": "10%",
"width":"640",
"height": "360"
}
}'
cropped
original

Pad

This transformation can be used to add padding to the video. Pad transformation takes the following parameters embedded within pad parameter.

Parameter

Description

top

Width of padding on the top side. Values can be an absolute number of pixels or a percentage value relative to the video height. Default: 5%

left

Width of padding on the left side. Values can be an absolute number of pixels or a percentage value relative to the video width. Default: 0

bottom

Width of padding on the bottom side. Values can be an absolute number of pixels or a percentage value relative to the video height. Default: 5%

right

Width of padding on the right side. Values can be an absolute number of pixels or a percentage value relative to the video width. Default: 0

cURL
pad
original
cURL
curl -L -X POST 'https://api.gumlet.com/v1/video/process' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"input":"https://gumlet.sgp1.digitaloceanspaces.com/video/sample_2.mp4",
"source_id": "5f462c1561cf8a766464ffc4",
"format": "mp4",
"pad": {
"top": "10%",
"bottom": "10%",
"left":"20%",
"right": "20%"
}
}'
pad
original

Trim

Trim transformation can be used to trim videos with a combination of three parameters start_offset, end offsetand duration (optional) embedded in trim. These parameters can be specified in absolute value in seconds or inHH:MM:SSformat.

cURL
trimmed
original
cURL
curl -L -X POST 'https://api.gumlet.com/v1/video/process' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"input":"https://gumlet.sgp1.digitaloceanspaces.com/video/sample_1.mp4",
"source_id": "5f462c1561cf8a766464ffc4",
"format": "mp4",
"trim": {
"start_offset": "00:00:00",
"end_offset": "00:00:10"
}
}'
trimmed

original
Contents
Crop
Pad
Trim