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.- 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
.Note:
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 --request POST \ --url https://api.yepic.ai/v1/videos \ --header 'X-Api-Key: YOUR_API_KEY' \ --header 'content-type: application/json' \ --data @- <<EOF { "slides": [ { "overlays": [ { "length": "Loop", "type": "VideoOverlay", "assetId": "e87e38db-1820-48a1-b7c8-a5fe493902ca", "xPosition": 0, "yPosition": 0, "height": 1920, "width": 1080, "scale": "height", "volume": 0, "angle": 0 } ] } ], "videoTitle": "My first video" }
For details on the video asset fields, refer to the table below:
Fields Data Type Required Description type
string Yes The type of 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 is to be applied to 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 7 months ago