Programmable Media

iOS video transformations

Last updated: Oct-30-2024

Overview

After uploading videos to Cloudinary, they can be transformed in many ways.

The syntax for transforming and delivering videos is generally similar to that for images, and you can apply the majority of available image transformations to video as well. For example, you can resize, crop, rotate, set video quality and format, add text or image overlays to your videos, and more.

There are also a number of special options you can use for transforming and delivering video content. For example, you can adjust their size, shape, speed, duration, quality, and appearance. There are also some features that are specific to audio.

This section introduces you to video-specific transformation functionality using iOS.
For complete details on all video transformation functionality, see Video transformations and the Transformation URL API Reference.

Video transformation functionality

In addition to transformation features that are equally relevant for images and video, such as resizing, cropping, rotating, adding text or image overlays, and setting video quality or format, there are a variety of special transformations you can use for video. For example, you can:

You can optionally specify all of the above transformations to videos using methods that generate image tags or via direct URL-building directives.

Deliver videos

To deliver videos, you can either use the Cloudinary native video player or generate a video URL using the createUrl method. Make sure to include the resourceType parameter set to "video".

You can also include transformation parameters in the request, for example, to return the URL for a video padded to a width of 400 pixels:

Important
If you want to stream your video using the HLS protocol, make sure to include the streaming profile as an eager transformation in your upload preset and in your transformation definition. For more details, see the HLS documentation

Video transformation examples

This section provides examples of using iOS code to apply some of the video transformation features mentioned in the previous section.

Example 1:

The following example resizes the video to 30% of it's original size and rounds the corners by 20 pixels. It also adds a semi-transparent Cloudinary logo in the bottom right corner, using a southeast gravity with adjusted x and y coordinates to reach the corner of the video.

Example 2:

The following example adjusts the brightness of the video, and sets its radius to max in order to give a telescope-like effect. It then appends a copy of the video in reverse, and then plays forward again, but in slow motion.

Example 3:

The following example returns the first 10 seconds of the video. The video is also cropped to 360X480 using the pad cropping method, and it is generated at 70% quality to control file size.

Help us improve our SDK
We'd love to hear your thoughts on using our iOS SDK. Please take a moment to complete this short survey.
Thanks for your time!

✔️ Feedback sent!

Rate this page: