---
updatedAt: 2025-06-18T15:29:30.000Z
agentTools:
  projectIndex: https://api.encoding.com/llms.txt
---

# Video Overlay

<a name="videooverlay"></a>Overlay one video over another, similar to a picture in picture effect.

```xml
<?xml version="1.0"?>
<query>
    <userid>&lt;UserID&gt;</userid> {/* required */}
    <userkey>&lt;UserKey&gt;</userkey> {/* required */}
    <action>&lt;Action&gt;</action> {/* required */}
    <source>&lt;SourceFile&gt;</source> {/* required */}
    <format>
        {/* Format params */}
        <overlay>
            {/* Common overlay params */}
            <overlay_source>&lt;Overlay1Source&gt;</overlay_source> {/* required */}
            <overlay_left>&lt;Overlay1PositionXfromLeft&gt;</overlay_left>
            <overlay_right>&lt;Overlay1PositionXfromRight&gt;</overlay_right>
            <overlay_top>&lt;Overlay1PositionYfromTop&gt;</overlay_top>
            <overlay_bottom>&lt;Overlay1PositionYfromBottom&gt;</overlay_bottom>
            <size>&lt;Overlay1Size&gt;</size>
            <keep_audio>[0,1]</keep_audio>
        </overlay>
        {/* ... */}
        <overlay>
            {/* Overlay params */}
        </overlay>
    </format>
</query>
```
```json
{
    "query": {
        "userid": "[UserID]",
        "userkey": "[UserKey]",
        "action": "[Action]",
        "source": "[SourceFile]", // required
        "format": {
            "overlay": [
                {
                    // Common overlay params
                    "overlay_source": "[Overlay1Source]",
                    "overlay_left": "[Overlay1PositionXfromLeft]",
                    "overlay_right": "[Overlay1PositionXfromRight]",
                    "overlay_top": "[Overlay1PositionYfromTop]",
                    "overlay_bottom": "[Overlay1PositionYfromBottom]",
                    "size": "[Overlay1Size]",
                    "keep_audio": "[0,1]"
                },
                {
                    // Overlay params
                }
            ]
        }
    }
}
```

| Parameter           | Description                                                                      | Allowed Values                                                       | Default Value |
| :------------------ | :------------------------------------------------------------------------------- | :------------------------------------------------------------------- | :------------ |
| **overlay\_source** | Specify a valid URL to the overlay source file.                                  | Valid URL.                                                           | None          |
| **overlay\_left**   | Specify the position x of left overlay's side with starting point from left.     | Non-negative integer, or % from output video width, or ‘center’      | None          |
| **overlay\_right**  | Specify the position x of right overlay's sidewith starting point from right.    | Non-negative integer or % from output video width                    | None          |
| **overlay\_top**    | Specify the position y of top overlay's side (with starting point from top).     | Non-negative integer, % from output video width, or ‘center’         | None          |
| **overlay\_bottom** | Specify the position y of bottom overlay's side with starting point from bottom. | Non-negative integer or % from output video width                    | None          |
| **size**            | Specify the overlay size in pixels.                                              | WxH where W and H – positive integers, or % from result video width. | None          |
| **keep\_audio**     | Keep overlay's audio.                                                            | 0,1                                                                  | 0             |

> ❗️ For overlay\_source parameter
>
> **\<overlay\_source />** is a required field.

> 👍 For overlay\_source parameter
>
> Use ‘RLE(qtrle)’ video for alpha-transparent overlay.

> 🚧 For overlay\_right and overlay\_left parameters
>
> If **\<overlay\_right />** and **\<overlay\_left />** are specified simultaneously – **\<overlay\_right />** will be ignored.

> 🚧 For overlay\_bottom and overlay\_top parameters
>
> If **\<overlay\_bottom />** and **\<overlay\_top />** are specified simultaneously – **\<overlay\_bottom />** will be ignored.

> ❗️ For size parameter
>
> Size of overlay source **can’t** be greater then size of output media.