Last updated: Aug-06-2025
OverviewThis video tutorial teaches you how to trim videos on the fly using the Cloudinary Node.js SDK.
Video tutorialYou can find the code from this tutorial in
GitHub.
Tutorial contentsThis tutorial presents the following topics. Click a timestamp to jump to that part of the video.
Introduction Define the length of your video   0:23 Having installed and configured the Cloudinary Node.js SDK in your Node.js app, define the start offset and either the end offset or duration of the video that you want to deliver. Ensure you use the variable namesstart_offset
, end_offset
and duration
as these are the object key names that you need in the next step, which uses object property shorthand notation. Create the URL to trim the video   0:38 Use the cloudinary.url
method to create the URL to deliver the trimmed video according to the set parameters. Specify the public ID of the video that you've previously uploaded to your Cloudinary product environment, the resource type and transformation parameters. For example, to trim the samples/elephants
video to make it start at 6.5 seconds and end at 20 seconds:
See the full code example in GitHub.
Check the resulting URL Â Â 1:27 Open the resulting URL in a browser to see the trimmed elephants video. Keep learning If you like this, you might also like...Â
Â
Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.
Â
âï¸ Feedback sent!
âï¸Â  ErrorUnfortunately there's been an error sending your feedback.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4