# Video Optimizations

### Keep videos hidden until needed the scene​ <a href="#keep-vides-hidden-until-needed-the-scene" id="keep-vides-hidden-until-needed-the-scene"></a>

A non-hidden video get decoded by CPU/GPU and blocks its bandwidth. Hidden videos don't consume any CPU/GPU. So keep them hidden until needed, and hide them again if not needed anymore.

### Maximum number of videos that can run in parallel​ <a href="#video-number-of-parallel-streams" id="video-number-of-parallel-streams"></a>

<table><thead><tr><th width="197">Platform</th><th width="269.3333333333333" align="center">No of HD videos, tested with (1280x720)</th><th align="center">No of ~4K Videos, tested with (3840x1920)</th></tr></thead><tbody><tr><td>Desktop/Laptop</td><td align="center">4</td><td align="center">1</td></tr><tr><td>Androids Phones</td><td align="center">4</td><td align="center">1</td></tr><tr><td>iOS Phones</td><td align="center">4</td><td align="center">1</td></tr></tbody></table>

Also check [media codec compatibility](/guidelines-compatibility/compatibility/platform-compatibility-matrix.md#media-codec-compatibility).

### Video Resolution and File Size Recommendation​ <a href="#videos" id="videos"></a>

| Device                  | Recommended Max Resolution | Recommended Max File Size |
| ----------------------- | :------------------------: | :-----------------------: |
| Desktop                 |          4096x2048         |            10MB           |
| Flagship mobile devices |          4096x2048         |            10MB           |
| Low-end mobile devices  |          2048x1024         |            5MB            |

{% hint style="danger" %}
Note that the video resolution here is 4096x2048 and **NOT 3840x2160** (true 4k). This is because for 3D processing both width and height are upscaled internally to the nearest power of 2.&#x20;

For 3840x2160, this upscales to 4096x4096, which is too high for current renderers.
{% endhint %}

### Optimize Video File Size <a href="#transparent-pixels-use-the-same-amount-of-memory-as-non-transparent-ones" id="transparent-pixels-use-the-same-amount-of-memory-as-non-transparent-ones"></a>

Before uploading any videos to the GMetri File Manager (by dragging and dropping files onto it), just run them through a compression tool to reduce their sizes drastically.

**We recommend** you use the Open Source tool [Handbrake](https://handbrake.fr/downloads.php/) to do this. Here's how:

{% embed url="<https://www.youtube.com/watch?v=qv2JnZcf7BA>" %}
Compressing a video using Handbrake
{% endembed %}

**Alternatively, you can compress/resize content on the Adobe Suite**

If you are using Adobe Premiere Pro or Adobe After Effects, directly compress and export the video from Adobe Media Encoder.

Here's a tutorial for this:

{% embed url="<https://www.youtube.com/watch?v=4b-jHxjdEWE>" %}
Compressing a Video using Media Encoder
{% endembed %}

You could also use [FFmpeg](https://ffmpeg.org/) for this.

### Video AutoStart Limitations

On Mobile devices a **Click** action is required in the rule that starts a video (as opposed to any other event like a variable reaching a value, or the scene loading). This is because Mobile devices are strict about getting a user interaction before allowing audio to play.

Also check [Audio AutoStart Limitations](/guidelines-compatibility/guidelines/experience-optimizations/audio-optimizations.md#audio-autostart-limitations).

Here's an example where click events are used to play a video.

<figure><img src="/files/SI0NFkSzc2mqBk9I3pa9" alt=""><figcaption><p>A rule where click event(s) are used to play a video</p></figcaption></figure>

Note that this restriction doesn't apply on muted videos. If you mute your video, you can play your video with any rule.

You can mute a video like this:

<figure><img src="/files/kMQm84dPcyv4Pj6Le6z7" alt=""><figcaption><p>Muting a Video</p></figcaption></figure>


---

# 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.gmetri.com/guidelines-compatibility/guidelines/experience-optimizations/video-optimizations.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.
