How to Resize a Video while Preserving Aspect Ratio in Node.JS

Maintaining the correct aspect ratio for a video is extremely important to convey your content in the way that you choose. When resizing a video, you may run into a problem with your aspect ratio changing to scale with the new size. Using this Cloudmersive API in Node.JS, however, you can preserve the aspect ratio while altering the size of a video to fit your needs.

First, you’ll need to install our client software:

npm install cloudmersive-video-api-client --save

Or, add this snippet to your package.json:

"dependencies": {
"cloudmersive-video-api-client": "^2.0.1"
}

Next, you can call the function, VideoResizeVideo:

var CloudmersiveVideoApiClient = require('cloudmersive-video-api-client');
var defaultClient = CloudmersiveVideoApiClient.ApiClient.instance;

With that, all of your future video projects will look exactly the way you planned. To receive you personal API Key, giving you access to up to 800 calls across our entire API library, visit the Cloudmersive website.

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.