Cloudinary icon

Cloudinary

Upload images and videos, generate images with AI from text prompts or reference images, build optimized transformation and delivery URLs, generate video players, and manage, search, tag, and edit metadata in your Cloudinary media library

Transform → Video: Trim

AI-generated

Summary

Trim a video asset hosted on Cloudinary by specifying start and end offsets or duration to create a clipped transformation URL.

Inputs

  • Public ID (required) — Public ID of the video asset, including any folder path and without the file extension.
  • Type (required) — Cloudinary delivery type (e.g., 'upload' for public assets). Usually left as 'upload' unless accessing private or social source assets.
  • Continue From Transformation — Optional existing transformation string to prepend, allowing chaining of transformations.
  • Start Offset — Start time in seconds to begin the trimmed clip (maps to 'so_').
  • End Offset — End time in seconds to end the trimmed clip (maps to 'eo_').
  • Duration — Duration in seconds for the clip length (maps to 'du_'). Allows combinations with start/end offsets.
  • Additional Options — Optional parameters such as 'Version' to bust CDN caches using a version segment in the URL.

Output shape

a single JSON object containing a 'transformation' string and a 'url' for the trimmed video transformation resource on Cloudinary.

The output includes a 'transformation' field representing the composed Cloudinary transformation string and a direct 'url' to access the trimmed video asset. This operation does not perform video editing on Cloudinary's server but assembles a delivery URL using transformation parameters. Partial combinations of start/end/duration are supported according to Cloudinary's URL transformation syntax.

Examples

Example 1: Trim the first 5 seconds of a video with Public ID 'folder/sample'.

Public ID set to 'folder/sample', Type set to 'upload', Start Offset set to '0', Duration set to '5'.

Links

Discussion