# Video operations

Cloudimage offers on-the-fly video processing with delivery via CDN using the Cloudimage URL for seamless integration. This feature is suited for short clips for websites and web applications such as hero videos or product videos.&#x20;

{% hint style="warning" %}
Input files are limited to 500 MB, 4k resolution and maximum 60 seconds length. \
For longer videos, only the first minute will be optimized and delivered, resulting in a trimmed video.
{% endhint %}

{% hint style="info" %}
The video files processed in the URLs need the proper extension (eg. *.mp4*, *.webm*).
{% endhint %}

## Available Parameters <a href="#od_4580a7ea" id="od_4580a7ea"></a>

//<mark style="color:blue;">**token**</mark>.cloudimg.io/<mark style="color:red;">**original\_image\_url.mp4**</mark>?<mark style="color:orange;">**w=600**</mark>&<mark style="color:orange;">**format=auto**</mark>

<table><thead><tr><th width="131.33333333333331">Parameter</th><th width="301">Allowed values</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:orange;"><strong>w</strong></mark></td><td><code>>100</code></td><td>Sets the target video width</td></tr><tr><td><mark style="color:orange;"><strong>h</strong></mark></td><td><code>>100</code></td><td>Sets the target video height</td></tr><tr><td><mark style="color:orange;"><strong>func</strong></mark></td><td><code>crop</code> (default) | <code>fit</code> | <code>cropfit</code> | <code>bound</code> | <code>boundmin</code> | <code>cover</code></td><td>Sets the resize function if both <strong>width</strong> and <strong>height</strong> parameters are provided</td></tr><tr><td><mark style="color:orange;"><strong>bg_color</strong></mark></td><td>hex color code / color name</td><td>Background (padding) color<br>(for use with <strong>func=fit</strong>)</td></tr><tr><td><mark style="color:orange;"><strong>bg_img_fit</strong></mark></td><td><code>1</code></td><td>Use blurred version of the video for background / padding<br>(for use with <strong>func=fit</strong>)</td></tr><tr><td><mark style="color:orange;"><strong>format</strong></mark></td><td><code>auto</code> (default) | <code>mp4</code> | <code>webm</code> | <code>h264.mp4</code> | <code>h265.mp4</code> | <code>vp9.webm</code></td><td>Defines the video format</td></tr><tr><td><mark style="color:orange;"><strong>bitrate</strong></mark></td><td><code>10k..20000k</code> | <code>1m..20m</code> (ex.<code>300k, 2m</code>)</td><td>Sets the compression bitrate (in kilobits or megabits per second)</td></tr></tbody></table>

{% hint style="info" %}
The automatic format delivery chooses the most efficient codec and format based on the viewer platform support - h265 (HEVC) mp4, vp9 WebM, or h264 (AVC) mp4.
{% endhint %}

## Examples

| Preview                                                                                                                               | Syntax                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/iREQPl7zawgn5j36MSRt/image.png)                                    | <p>Simple resize:<br><a href="https://cymsecggja.cloudimg.io/https://samples.scaleflex.com/waterfall-hd.mp4?w=400">/samples.scaleflex.com/waterfall-hd.mp4?<mark style="color:orange;"><strong>w=400</strong></mark></a></p>                                                                                                                                                                                                                                                             |
| ![](https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/YT94Mnphr6bjUgu8BBIh/image.png)                                    | <p>Crop function:<br><a href="https://cymsecggja.cloudimg.io/https://samples.scaleflex.com/waterfall-hd.mp4?w=400&#x26;h=300">/samples.scaleflex.com/waterfall-hd.mp4?<mark style="color:orange;"><strong>w=400</strong></mark>&<mark style="color:orange;"><strong>h=300</strong></mark></a></p>                                                                                                                                                                                        |
| ![](https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/3rM8lBh8xyhKs2G1T9sM/image.png)                                    | <p>Fit function with blurred background:<br><a href="https://cymsecggja.cloudimg.io/https://samples.scaleflex.com/waterfall-hd.mp4?w=400&#x26;h=300&#x26;func=fit&#x26;bg_img_fit=1">/samples.scaleflex.com/waterfall-hd.mp4?<mark style="color:orange;"><strong>w=400</strong></mark>&<mark style="color:orange;"><strong>h=300</strong></mark>&<mark style="color:orange;"><strong>func=fit</strong></mark>&<mark style="color:orange;"><strong>bg\_img\_fit=1</strong></mark></a></p> |
| <img src="https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/uRKs1MCKlcQmLe9SAY17/image.png" alt="" data-size="original"> | <p>Sets the compression bitrate in kilobits or megabits per second.<br><a href="https://cymsecggja.cloudimg.io/https://samples.scaleflex.com/waterfall-hd.mp4?bitrate=1000k"><mark style="color:blue;"><strong>/samples.scaleflex.com/waterfall-hd.mp4?</strong><strong>bitrate=1000k</strong></mark></a></p>                                                                                                                                                                            |
