# Video operations

{% hint style="info" %}
Video Optimisation is powered by Visual Operations Credits; full details on consumption rates can be found here: [Visual Operation Credits table](https://docs.cloudimage.io/account-management/usage#visual-operation-credits-table)
{% endhint %}

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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/cpG9qS9ZSrcTA0mnRDjB)                                    | <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>                                                                                                                                                                                                                                                             |
| ![](/files/BZy5l3hGFcqNaYQmRLfx)                                    | <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>                                                                                                                                                                                        |
| ![](/files/uR50yEEUvy1p69komA5h)                                    | <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="/files/VxwRzuB4dbXJDN1PZwzk" 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>                                                                                                                                                                            |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudimage.io/transformations/video-operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
