> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tavus.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Background Customizations

> Customize AI video backgrounds with transparency, scrolling websites, or custom video sources.

## Transparent Background

You can enable a transparent background for the video by setting the `transparent_background` parameter to `true`.

<Note>
  This feature is only available when the `fast` parameter is set to `true`, and the output will be generated exclusively in .webm format.
</Note>

```sh {6-7} theme={null}
curl --request POST \
  --url https://tavusapi.com/v2/videos \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "fast": true,
  "transparent_background": true,
  "replica_id": "<replica_id>",
  "script": "<text_script>"
}'
```

## Website Background

You can set a website as the background for your generated video by using the `background_url` field. Simply provide the URL of the website you'd like to use, making sure it is publicly accessible and correctly formatted.

```sh {6} theme={null}
curl --request POST \
  --url https://tavusapi.com/v2/videos \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "background_url": "<background_url>",
  "replica_id": "<replica_id>",
  "script": "<text_script>"
}'
```

The resulting video will feature the website as a background, with the content scrolling vertically from top to bottom.

### Background Scroll

You can configure the background scroll by adjusting the scroll distance, pattern, and whether the scroll should loop back to the top by adjusting the following parameter:

* `properties.background_scroll`: Enable or disable background scrolling.
* `properties.background_scroll_type`: Defines the scroll pattern when background scrolling is enabled, with two options: `human` (mimics natural scrolling with pauses) and `smooth` (continuous uniform scrolling).
* `properties.background_scroll_depth`: Determines how far the background video will scroll down the webpage, with two options: `middle` (scrolls to the middle of the page) or `bottom` (scrolls all the way to the end).
* `properties.background_scroll_return`:  Defines the behavior after reaching the scroll depth set by `background_scroll_depth`, with two options: `return` (scrolls back up) or `halt` (pauses at the specified depth).

```sh {10-13} theme={null}
curl --request POST \
  --url https://tavusapi.com/v2/videos \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "replica_id": "<replica_id>",
  "script": "<text_script>",
  "background_url": "<background_url>",
  "properties": {
    "background_scroll": true,
    "background_scroll_type": "smooth",
    "background_scroll_depth": "bottom",
    "background_scroll_return": "true"
  }
}'
```

## Custom Video Background

You can also set a custom video background by providing a direct, publicly accessible link (e.g., from an S3 bucket) to the `background_source_url` parameter.

```sh {8} theme={null}
curl --request POST \
  --url https://tavusapi.com/v2/videos \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "replica_id": "<replica_id>",
  "script": "<text_script>",
  "background_source_url": "<background_source_url>"
}'
```


Built with [Mintlify](https://mintlify.com).