> For the complete documentation index, see [llms.txt](https://docs.scaleflex.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scaleflex.com/dynamic-media-optimization-dmo/transformations/video-optimization/on-the-fly-video-optimization.md).

# On-the-fly-video optimization

Short clip processing and delivery for websites and web applications

{% hint style="warning" %}
Please contact the support team to activate the video feature for your token.
{% endhint %}

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

Input files are limited to 500 MB and compressed videos are limited to 4k resolution and duration of no more than 1 minute. If your videos exceed those limits, your use case probably does not fall into the scope of this feature and you should consider using [Video optimization](https://docs.scaleflex.com/dynamic-media-optimization-dmo/transformations/video-optimization.md) and [Video API](https://docs.scaleflex.com/dynamic-media-optimization-dmo/transformations/video-optimization/video-api.md).

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

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

//<mark style="color:red;">**token**</mark>.filerobot.com/**folder/origin\_video.mp4**?<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://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2Fb2A74myTIegsjcpurr6v%2Fimage.png?alt=media\&token=39602140-3454-484f-b3b1-766907b3bdd7) | <p>Simple resize:<br><a href="https://fdocs.filerobot.com/docs/waterfall-hd.mp4?w=400">/docs/waterfall-hd.mp4?<mark style="color:orange;"><strong>w=400</strong></mark></a></p>                                                                                                                                                                                                                                                             |
| ![](https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2F0cEI78NBIvo5wUtLv3kn%2Fimage.png?alt=media\&token=9a35d429-ba50-4052-8158-cd9d72fb6317) | <p>Crop function:<br><a href="https://fdocs.filerobot.com/docs/waterfall-hd.mp4?w=400&#x26;h=300">/docs/waterfall-hd.mp4?<mark style="color:orange;"><strong>w=400</strong></mark>&<mark style="color:orange;"><strong>h=300</strong></mark></a></p>                                                                                                                                                                                        |
| ![](https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2FjcK8sr2IpMMPV8sytHYw%2Fimage.png?alt=media\&token=4b6af560-092b-41d1-a441-63bc7c433f26) | <p>Fit function with blurred background:<br><a href="https://fdocs.filerobot.com/docs/waterfall-hd.mp4?w=400&#x26;h=300&#x26;func=fit&#x26;bg_img_fit=1">/docs/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> |
