Insert a Shapes

πŸ”Ά Enhance visuals with shape overlays in your video.

Our API allows you to add shape overlays to a video, such as a circle, rectangle, or ellipse. You can specify the properties of the shape, such as the position and size. It enables you to enhance or modify the visual appearance of the media by superimposing shapes on top of it.

In this example, we will add a circle to the video. Follow the steps below:

  1. Specify the overlay type.
  2. Specify the X-coordinate of the center of the circle (centerX). It determines the horizontal position of the circle's center within the video.
  3. Specify the Y-coordinate of the center of the circle (centerY). It determines the vertical position of the circle's center within the video.
  4. Define the radius of the circle. It determines the size or scale of the circle overlay.

🚧

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 for adding a circle:

curl --request POST \
     --url https://api.yepic.ai/v1/videos \
     --header 'X-Api-Key: YOUR_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "slides": [
    {
      "overlays": [
        {
          "type": "CircleOverlay",
          "centerX": 1,
          "centerY": 0.7,
          "radius": 1
        }
      ]
    }
  ],
  "videoTitle": "My first video",
  "videoFormat": "mp4"
}

For details on the available shape fields, refer to the tables below:

1. Circle Overlay

FieldsData TypeRequiredDescription
typestringYesThe type of the asset overlay, for example, "CircleOverlay", "EllipseOverlay", "RectangleOverlay", etc.
centerXdoubleYesThe x coordinate of the insertion point in the canvas.
centerYdoubleYesThe Y coordinate of the insertion point in the canvas.
radiusdoubleYesThe radius of the circle.

2. Ellipse Overlay

FieldsData TypeRequiredDescription
typestringYesThe type of the asset overlay, for example, "CircleOverlay", "EllipseOverlay", "RectangleOverlay", etc.
centerXdoubleYesThe x coordinate of the insertion point in the canvas.
centerYdoubleYesThe Y coordinate of the insertion point in the canvas.
radiusXdoubleYesThe radius of the ellipse on the x-axis.
radiusYdoubleYesThe radius of the ellipse on the y-axis.
angledoubleNoThe rotation angle to be applied over the asset.

3. Rectangle Overlay

FieldsData TypeRequiredDescription
typestringYesThe type of the asset overlay, for example, "CircleOverlay", "EllipseOverlay", "RectangleOverlay", etc.
xPositiondoubleNoThe x coordinate of the insertion point in the canvas.
yPositiondoubleNoThe y coordinate of the insertion point in the canvas.
heightdoubleYesThe height of the rectangle.
widthdoubleYesThe width of the rectangle.
angledoubleNoThe rotation angle to be applied over the asset.
radiusXdoubleNoThe horizontal corner radius of the rectangle.
radiusYdoubleNoThe vertical corner radius of the rectangle.

πŸ“Œ Need help?

If you require assistance or encounter any issues, we recommend referring to our FAQ page first. If you are still unable to resolve your issue, please don't hesitate to contact us for further support.