# Generate Multi-Format Videos

{% hint style="info" %}
This feature is available from the [**Pro**](https://www.abyssale.com/pricing) plan.
{% endhint %}

### Asynchronous Asset Generation Endpoint

`POST /async/banner-builder/{design_id}/generate`

### Generation Characteristics

* Supported Design Type: **Animated**
* Response: **Asynchronous**
* Enables batch generation of multiple assets
* Required Parameter: `image_file_type=mp4`
* Retrieval methods:
  * [Webhooks](https://developers.abyssale.com/rest-api/generation/asynchronous-generation/..#webhook-configuration)
  * [Polling](https://developers.abyssale.com/rest-api/generation/asynchronous-generation/..#polling-configuration)

### Output File Types

Supported formats:

* MP4 videos

### Additional information

#### Input Video Customization

* Supported Input Formats: MP4, WebM, MOV
* Maximum File Size: 100 MB
* The video can be trimmed using the following query properties to the video url:
  * `trim_start`: Start of the video in seconds. i.e: *?trim\_start=2.5*  to start your video at 2.5s
  * `trim_end`: End of the video in seconds. i.e: *?trim\_end=10* to end your video at 10s
* The sound can be muted by using the property `audio_muted` and set it to `1`

Example Input Video Configuration:

```json
"video_element_name": {
 "video_url": "https://example.com/video.mp4",
 "audio_muted": 0,
}
```

#### Output customisation

In addition to the supported image properties, a `video` property can be set to customise the output video. Here is the available option:

#### Video Frame Rate Configuration FPS (Frames Per Second)

* Default: 24 fps
* Range: 2-30 fps

Configuration Example:

```json
"video": {
 "fps": 24
}
```

### Sample request <a href="#sample-request" id="sample-request"></a>

​Do not forget to replace `{YOUR-API-KEY}` and `{design_id}`

{% tabs %}
{% tab title="cURL" %}

```
curl -X POST -H "x-api-key:{YOUR-API-KEY}" -H "Content-Type: application/json"  \
-d '{
  "callback_url": "https://webhook.mycompany.com/videos",
  "image_file_type": "mp4",
  "video": {
    "fps": 24
  },
  "template_format_names": ["facebook-feed", "instagram-post", "iab-medium"],
  "elements": {
    "primary_text": {
        "payload": "New branding available.",
        "color": "#FF0000"
    },
    "video_0": {
      "video_url": "https://mycompany.com/video.mp4",
      "audio_muted": 0
    }
  }
}' \
https://api.abyssale.com/async/banner-builder/{design_id}/generate
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const axios = require('axios');

const payload = {
  "callback_url": "https://webhook.mycompany.com/videos",
  "image_file_type": "mp4",
  "video": {
    "fps": 24
  },
  "template_format_names": ["facebook-feed", "instagram-post", "iab-medium"],
  "elements": {
    "primary_text": {
        "payload": "New branding available.",
        "color": "#FF0000"
    },
    "video_0": {
      "video_url": "https://mycompany.com/video.mp4",
      "audio_muted": 0
    }
  }
}

// Replace {id} by your template ID
axios.post("https://api.abyssale.com/async/banner-builder/{design_id}/generate", payload, {
    headers: {"x-api-key": "{YOUR-API-KEY}", "Content-Type": "application/json", "timeout": 30000}
  }).then(response => {
    console.log(response.data)
}j
```

{% endtab %}

{% tab title="Python" %}

```python
import json
import requests

image_generation_payload = {
  "callback_url": "https://webhook.mycompany.com/videos",
  "image_file_type": "mp4",
  "video": {
    "fps": 24
  },
  "template_format_names": ["facebook-feed", "instagram-post", "iab-medium"],
  "elements": {
    "primary_text": {
        "payload": "New branding available.",
        "color": "#FF0000"
   },
    "video_0": {
      "video_url": "https://mycompany.com/video.mp4",
      "audio_muted": 0
    }
  }
}

# Do not forget to replace {YOUR-API-KEY} and {template_id}
r = requests.post("https://api.abyssale.com/async/banner-builder/{design_id}/generate",
  headers={"x-api-key": "YOUR-API-KEY", "Content-Type": "application/json"},
  data=json.dumps(image_generation_payload),
  timeout=30
)
r.json()
```

{% endtab %}
{% endtabs %}

### Sample response <a href="#sample-response" id="sample-response"></a>

```
{
  "generation_request_id": "df75afa8-5a77-4e03-aeef-6d1b6dd0580a"
}
```


---

# 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://developers.abyssale.com/rest-api/generation/asynchronous-generation/generate-multi-format-videos.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.
