API Reference
Log In
API Reference

Create a new video

Introduction

The request primarily consists of scenes. Each scene is an independent segment of the video.
A scene consists of a list of elements which are it's basic building blocks.
Each element contains an asset and a style.
Note: The total video duration can't exceed 900 seconds.


Assets

Click to expand

We have the following asset types:

Spokesperson Asset

Parameter NameDescriptionData Type
kindSpokespersonstring
spokesperson_videoSpokespersonVideoobject

Text Asset

ParameterDescriptionData TypeExample
kindTextString
textThe actual text contentStringTitle Text
textStyleThe styling for the textObject{"fontColor": "#631111", "fontSize": "4em", "textDecorationColor": "#631111", "align": "left"}

Image Asset

ParameterDescriptionData TypeExample
kindImageString
useThe purpose of the asset. Set to "Background" to use the image as a background.String or nullBackground or null
urlThe URL of the assetStringhttps://res.cloudinary.com/rephraseai/image/upload/v1673019001/music_uploads/kcblw77nviultytkcpht.png

Constraints:

  • Maximum File size: For Image - 10 MB, For Background Image - 15 MB
  • Accepted File Type: .jpg, .png, .gif, .svg, .webp

Video Asset

ParameterDescriptionData TypeExample
kindVideoString
useThe purpose of the asset. Set to "Background" to use the video as a background.String or nullBackground or null
urlThe URL of the assetStringhttps://res.cloudinary.com/rephraseai/video/upload/v1673019001/music_uploads/kcblw77nviultytkcpht.mp4

Constraints:

  • Maximum File size: For Video - 100 MB, For Background Video - 100 MB
  • Accepted File Type: .mp4, .webm

Shape Asset

ParameterDescriptionData TypeExample
kindShapeString
urlThe URL of the assetStringhttps://rephrase-assets.s3.ap-south-1.amazonaws.com/media/elements/shapesV3/Arrow%20circle.svg
shapeStyleThe styling for the shapeObject{"fill": "#631111", "strokeWidth": 2, "stroke": "#070708"}

Constraints:

  • Maximum File size: For Shape - 5 MB
  • Accepted File Type: .svg

Components

SpokespersonVideo

Parameter NameDescriptionData Type
modelName of the actor to use for generating the videostring
voiceIdUnique identifier for the selected voice to be used in the videostring
output_paramsSpokespersonVideo.OutputParamsobject
transcriptThe transcript of the message the spokesperson will deliverstring
transcript_typeThe type of transcript provided, currently supports ssml_limited, ssml_standard, textstring

SpokespersonVideo.OutputParams

Parameter NameDescriptionData Type
videoSpokespersonVideo.OutputParams.Videoobject

SpokespersonVideo.OutputParams.Video

Parameter NameDescriptionData TypeExample
cropPreset crop size for the spokespersonObject{"preset": "MS"}
resolutionDesired video resolutionObject{"height": 720, "width": 1280}
backgroundBackground settings for the videoObject{"alpha": 0}

Styles

Click to expand

Different elements have different possible styles. Parameters for style depends on the asset type associated with the element.

Background Image

ParameterDescriptionData TypeExample
heightThe height of the element, as a percentage of its containerString100%
widthThe width of the element, as a percentage of its containerString100%
positionThe positioning of the element relative to its containerStringabsolute
zIndexThe z-index of the element, which determines its stacking orderInteger1

Image

ParameterDescriptionData TypeExample
heightThe height of the elementString43.28756938625066em
widthThe width of the elementString43.28756938625066em
bottomThe distance between the bottom of the element and the bottom of its containerString6.458198131217985em
leftThe distance between the left of the element and the left of its containerString54.50089154637617em
zIndexThe z-index of the element, which determines its stacking orderInteger10
positionThe positioning of the element relative to its containerStringabsolute

Text

Parameter NameDescriptionData TypeExample
variantType of text variantstringsubheading
fontSizeFont size in emstring5em
fontFamilyFont family namestringArial, Roboto, Calibri, DM Sans, Raleway, Times New Roman
colorFont colorstring#FFFFFF
positionPosition of text in the assetstringabsolute
zIndexLayer order of the textinteger15
alignText alignmentstringright
heightHeight of the text elementstring7em
widthWidth of the text elementstring33em
bottomDistance of the text element from the bottomstring34em
leftDistance of the text element from the leftstring60em
fontColorFont color in RGB formatstring#000000
textDecorationColorText decoration color in RGB formatstring#000000

Shape

Parameter NameDescriptionData TypeExample
positionPosition of shape in the assetstringabsolute
zIndexLayer order of the shapeinteger15
heightHeight of the shape elementstring7em
widthWidth of the shape elementstring33em
bottomDistance of the shape element from the bottomstring34em
leftDistance of the shape element from the leftstring60em

Animation

Click to expand

The animation field includes the following properties:

  • type: The type of the animation. Example: "start".
  • duration: The duration of the animation in seconds. Example: 1.5.
  • offset: The time when the animation starts playing in seconds (floating point). Example: 0.2.
  • presets: An array of animation presets. Example: ["fade_in", "fade_out"].
  • fields: An array of objects representing the different animation properties. You can use fields to create a custom animation instead of using a preset.
    • name: The name of the animation property. Examples: "left", "right", "top", "bottom", "rotate", "scale".
    • startValue: The start value of the animation (between 0 and 1).
    • endValue: The end value of the animation (between 0 and 1).
  • timingFunction: An object representing the timing function of the animation.
    • type: The type of the timing function. Examples: "linear", "quad", "cubic", "cubic-bezier", "circle", "sin", "exp", "bounce", "elastic".
    • params: An array of parameters for the timing function.
"animations": [
  {
    "type": "start",
    "duration": 1.5,
    "offset": 0.2,
    "fields": [
      {
        "name": "rotate",
        "startValue": 0,
        "endValue": 1
      }
    ],
    "timingFunction": {
      "type": "linear"
    }
  }
]

Scene Transitions

Click to expand

The scene transition field includes the following properties:

  • duration: The duration of the scene transition in seconds. Example: 1.5.
  • preset: The type of scene transition.
    • name: The name of the scene transition. Examples: "slide", "push", "dissolve".
    • params: An object representing the parameters for the scene transition.
  • timingFunction: An object representing the timing function of the scene transition.
    • type: The type of the timing function. Examples: "linear", "cubic", "cubic-bezier".
    • params: An array of parameters for the timing function.
"sceneTransitions": [
  {
    "startScene": 0,
    "endScene": 1,
    "transition": {
        "duration": 1.5,
        "preset": {
            "name": "slide",
            "params": {
                "motionBlur": "1.5px",
                "direction": "left"
            }
        }
        "timingFunction": {
            "type": "linear"
        }
    }
  }
]

Subtitles

Click to expand

The subtitles field includes the following properties:

  • hardcode_subtitles: A boolean value indicating whether to embed subtitles within the video.
  • generate_srt_file: A boolean value indicating whether to generate an SRT file for the video.
  • create_captions (to be deprecated, please use hardcode_subtitles instead): A boolean value indicating whether to embed subtitles within the video.

Background Music

Click to expand

The background music field includes the following properties:

Constraints:

  • Maximum File size: For Background Music - 30 MB
  • Accepted File Type: .m4a, .mp3, .opus, .flac, .wav, .aac, .oga

Examples

Use the Examples dropdown in the REQUEST code box on this page to view the examples

Language
Click Try It! to start a request and see the response here!