It’s 2022. Developers are blessed with a plethora of resources to build websites, apps, and services. You can’t be left out!
In this article, I’ll show you how to make video transformations without spending time and brain power architecting video transformation services from scratch.
In one line of code via URL manipulation, you can make the following transformation to your videos.
Your videos have to be uploaded to have these transformations work on them seamlessly.
You can flip a video to any angle you desire with the parameter a_X where X stands for the following:
angle (a_) rotates or flips an asset by the specified number of degrees or automatically according to its orientation or available metadata.
- A positive integer value which rotates a video clockwise OR
- A negative integer value which rotates a video anticlockwise.
You might have seen a few videos like this:
You can make it happen like so:
- Start with the original Video: https://res.cloudinary.com/demo/video/upload/h-video.mp4
- Add a padding, height, and width to the URL like so:
c_pad, h_720, w_128
- Now, add background blur property like so:
You can make it happen like so:
- Start with the original video: https://res.cloudinary.com/demo/video/upload/celenarae.mp4
- Layer another Video on top of it like so: l_video:asltranslation
asltranslation is the public id of the video, while l_video is the parameter for layering a video.
- The Image: https://res.cloudinary.com/cdemo/image/upload/_mmm/washyourhands.png
- The Video: https://res.cloudinary.com/cdemo/video/upload/_mmm/washhands.mp4
You can merge an existing image to a video by using the following combination of parameters:
- overlay (l:) to specify the name of an uploaded image.
- splice flag (fl_splice) to indicate that the image should be concatenated on to the container video and not added as an overlay.
- duration parameter (du) to specify the amount of time in seconds to display the image.
- start_offset set to 0 (so_0) to concatenate the image at the beginning of the video instead of at the end.
- layer_apply (fl_layer_apply) to indicate that the above parameters are applied to the image (with the overlay parameter) and not the base video.
Now, check this out:
You can produce a short movie scene from a video by applying the following combination of transformation parameters:
- l_text: Adds a text overlay to an image or video.
You can adjust the dimensions and position of the overlay with the w(width),h(height), x, y (x & y coordinates) and g(gravity) parameters with the overlay transformation.
- start_offset set to 2 (so_2) to concatenate the text overlay from 2 seconds into the video instead of at the end.
- end_offset set to 5 (eo_5) specifies the last second to include in a video.
- e_fade fades into, or out of, an animated GIF or video. You can chain fade effects to both fade into and out of the media.
You can produce an excerpt from this video by applying the following combination of transformation parameters:
- start_offset set to 9.5(so_9.5) to start the video.
- end_offset set to 13(eo_13) specifies the last second to include in a video.
Check out the generated excerpt:
Original Video: https://res.cloudinary.com/cdemo/video/upload/_mmm/pushup.mp4
The Audio to add: https://res.cloudinary.com/cdemo/video/upload/_mmm/mafo.mp3
You can add audio to this video by applying the following combination of transformation parameters:
- l_video to overlay the audio on our original video.
You’re probably wondering why it’s not l_audio. Well, Cloudinary’s l_video parameter allows to overlay either audio or video.
Check out the new video with audio added:
A boomerang video is a short video clip that plays forwards and then backwards. You can find this filter on Instagram, Snapchat, Tiktok and the likes.
You can turn this video into a boomerang by applying the e_boomerang transformation parameter like so:
You can combine other transformations make it an enhanced video. Check out more info about boomerang transformation here.
There are different SDKs for integrating Cloudinary in your codebase. It’s instant, easy to integrate and ships with amazing fluent interfaces.
Cloudinary provides a lot of transformation effects and more for media files.
With Cloudinary, you can automate your entire image-management lifecycle, from upload and transformation to optimization and delivery. The platform also features numerous capabilities for editing and managing videos.