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 trimming

Last updated: Sep-06-2026

Use Cloudinary's video trimming options to keep a specific part of a video or audio clip. To join assets after trimming, see Video concatenation.

Works with audio too
Audio files use the video asset type in Cloudinary, because an audio file is essentially a video file without a visual element. Many of the transformations described on this page work on audio files as well, and you can combine audio and video assets in the same URL. For a summary of which transformations apply to audio, see Which video transformations apply to audio.

Trimming videos

Trim a video (and discard the rest) by using a combination of the following 3 parameters to specify the section of video to keep after trimming:

  • start_offset (so in URLs) specifies the start.
  • end_offset (eo in URLs) specifies the end.
  • duration (du in URLs) specifies the duration.

Possible values:

  • A float representing the time in seconds e.g. 5.44 (5 seconds and 440 milliseconds).
  • A string representing the percentage of the video length. This string consists of a number with a p appended e.g. 35p (0p is the first frame and 100p is the last frame). The client libraries also support appending a % instead of a p.

Examples:

  1. Trimming the video to the section that starts at 6.5 seconds and ends at 10 seconds:

  2. Trimming the video to the section that starts 10 percent into the original video and then lasts a duration of 30 percent (effectively from the 10 percent mark to the 40 percent mark):

Tip
If you want a video to play at a certain position but not trim the rest of the video out, use the HTML5 #t parameter in the video source.

For example, this URL starts playback of the docs/bathroom video at 4.5 seconds and stops it again at 10 seconds:

Trimming audio

Trim audio files with the same three parameters used for trimming videos, start_offset (so), end_offset (eo), and duration (du), in seconds or as a percentage of the track's length. For example, to keep the section of the docs/franck/audio/piano_low track that starts at 2 seconds and ends at 8 seconds:

To join trimmed audio files together, see Concatenate audio files.

Video tutorial: Trim videos using the Node.js SDK

Watch this video tutorial to learn how to trim your videos using the Node.js SDK:

This video is brought to you by Cloudinary's video player - embed your own!
Use the controls to set the playback speed, navigate to chapters of interest and select subtitles in your preferred language.

Related topics

✔️ Feedback sent!

Rate this page:

one star two stars three stars four stars five stars