Add a Text
🔤 Add customized text to your videos.
You can add text to the scenes using our API. Adding text is similar to adding any other asset. Follow these easy-breezy steps to learn how to add text to a scene:
- Set the
type
of asset item you want to add, in this case, it's "TextOverlay". - Specify the
font
name andfontSize
i.e., "Montserrat" and "120". - Enter the text you want to add to the video, for this example, it's "Yepic API".
- Define the position of the text asset in the scene using the variables
xPosition
andyPosition
.
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.
A request example to add text as an asset in a single-scene video is as follows:
curl --request POST \
--url https://api.yepic.ai/v1/videos \
--header 'Authorization: YOUR_API_KEY' \
--header 'content-type: application/json' \
--data @- <<EOF
{
"slides": [
{
"overlays": [
{
"type": "AvatarOverlay",
"assetId": "1a901a33-8783-418e-af6a-a66dae945673",
"script": "Well done! This is your first video using Yepic's API.",
"voiceId": "en-US-JennyMultilingualNeural",
"xPosition": 448,
"yPosition": 56,
"width": 1024,
"height": 1024
},
{
"type": "TextOverlay",
"font": "Montserrat",
"fontSize": 120,
"text": "Yepic API",
"xPosition": 59,
"yPosition": 66
}
],
"backgroundColor": "#fc0a41"
}
],
"videoTitle": "My first video"
}
For details of the text
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", etc. |
font | string | No | The font type of the text asset. |
fontSize | number | No | The font size of the text asset. |
text | string | Yes | The user-defined text string. |
xPosition | number | No | The x-coordinate of the text's position. |
yPosition | number | No | The y-coordinate of the text's position. |
Here's your generated video with the text you just specified:
✅Congratulations! You have successfully added text to your video using our API!
📌 Need help?
Updated 2 days ago