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: |
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: |
width | Width of the cropping area in pixels. |
height | Height of the cropping area in pixels. |
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"}}'
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: |
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: |
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: |
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: |
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%"}}'
Trim transformation can be used to trim videos with a combination of three parameters start_offset
, end offset
and duration
(optional) embedded in trim
. These parameters can be specified in absolute value in seconds or inHH:MM:SS
format.
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"}}'