Add a Video Layer
🎞️ Let's add a video layer to the scene!
For more information about overlay ordering, please refer to this page.
Our API allows you to include any videos you want in the video. The videos you intend to utilize must be registered as assets with a unique assetId
.
To add a video layer to the scene, follow these steps:
- Specify the
type
of asset item you want to add. In this case, it's a "VideoOverlay". - Enter the
assetId
of the video you insert into the scene. For example, we use the video below:
- Define the variables
xPosition
andyPosition
to specify the position of the video asset in the scene. - Define the asset item's
height
andwidth
. - Set the
scale
factor over the asset's shape. - Specify
length
on how the video will be played. For example, "Loop". The video will play continuously until the end of the video. - Specify the video's
volume
. Set to "0.0" to mute the video, while valid values for volume are "0.0" to "1.0".
Caution:
Don't forget to replace the placeholder "YOUR_API_KEY" with your unique API key in the header. If you haven't obtained one yet, please contact us at [email protected], and we will provide one as soon as possible.
The following is a request example of adding a video layer:
curl -X 'POST' \
'https://api.yepic.ai/v1/videos' \
-H 'accept: application/json' \
-H 'X-Api-Key: 'X-Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"parentId": null,
"groupId": null,
"draft": false,
"videoTitle": "My video from Swagger",
"videoFormat": "mp4",
"videoHeight": 1080,
"videoWidth": 1920,
"slides": [
{
"id": "19a90b4c-ae86-49fd-ab54-154b01f4bece",
"slideDuration": null,
"backgroundColor": "#ffffff",
"soundtrack": null,
"transition": null,
"overlays": [
{
"type": "VideoOverlay",
"assetId": "e87e38db-1820-48a1-b7c8-a5fe493902ca",
"assetName": "",
"assetUrl": "",
"xPosition": 0,
"yPosition": 0,
"height": 1920,
"width": 1080,
"scale": "height",
"length": "Full",
"volume": 1,
"angle": 0
}
]
}
]
}'
For details on the video asset fields, refer to the table below:
Fields | Data Type | Required | Description |
---|---|---|---|
type | string | Yes | The type of the asset overlay, for example, "AvatarOverlay", "ImageOverlay", "TextOverlay", "VideoOverlay", etc. |
assetId | string | Yes | The unique identifier of the asset. |
xPosition | number | No | The x-coordinate of the asset's insertion position. |
yPosition | number | No | The y-coordinate of the asset's insertion position. |
height | number | No | The height of the video. If height is specified, the scale value will be ignored. |
width | number | No | The width of the video. If width is specified, the scale value will be ignored. |
scale | number | Yes | The scale factor is applied over the asset's shape, i.e., height and width. |
length | string | No | Options for how the video will be played. Valid values are "Loop," "Full", and "Speech". |
volume | double | No | The volume of the video overlay. |
angle | double | No | The rotation angle to be applied over the asset. |
The following video will be generated along with the video layer you just specified.
✅Congratulations! You have successfully added a video layer to the video using our API!
📌 Need Help?
Updated 10 days ago