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 Name | Description | Data Type |
|---|---|---|
| kind | Spokesperson | string |
| spokesperson_video | SpokespersonVideo | object |
Text Asset
| Parameter | Description | Data Type | Example |
|---|---|---|---|
| kind | Text | String | |
| text | The actual text content | String | Title Text |
| textStyle | The styling for the text | Object | {"fontColor": "#631111", "fontSize": "4em", "textDecorationColor": "#631111", "align": "left"} |
Image Asset
| Parameter | Description | Data Type | Example |
|---|---|---|---|
| kind | Image | String | |
| use | The purpose of the asset. Set to "Background" to use the image as a background. | String or null | Background or null |
| url | The URL of the asset | String | https://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
| Parameter | Description | Data Type | Example |
|---|---|---|---|
| kind | Video | String | |
| use | The purpose of the asset. Set to "Background" to use the video as a background. | String or null | Background or null |
| url | The URL of the asset | String | https://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
| Parameter | Description | Data Type | Example |
|---|---|---|---|
| kind | Shape | String | |
| url | The URL of the asset | String | https://rephrase-assets.s3.ap-south-1.amazonaws.com/media/elements/shapesV3/Arrow%20circle.svg |
| shapeStyle | The styling for the shape | Object | {"fill": "#631111", "strokeWidth": 2, "stroke": "#070708"} |
Constraints:
- Maximum File size: For Shape - 5 MB
- Accepted File Type: .svg
Components
SpokespersonVideo
| Parameter Name | Description | Data Type |
|---|---|---|
| model | Name of the actor to use for generating the video | string |
| voiceId | Unique identifier for the selected voice to be used in the video | string |
| output_params | SpokespersonVideo.OutputParams | object |
| transcript | The transcript of the message the spokesperson will deliver | string |
| transcript_type | The type of transcript provided, currently supports ssml_limited, ssml_standard, text | string |
SpokespersonVideo.OutputParams
| Parameter Name | Description | Data Type |
|---|---|---|
| video | SpokespersonVideo.OutputParams.Video | object |
SpokespersonVideo.OutputParams.Video
| Parameter Name | Description | Data Type | Example |
|---|---|---|---|
| crop | Preset crop size for the spokesperson | Object | {"preset": "MS"} |
| resolution | Desired video resolution | Object | {"height": 720, "width": 1280} |
| background | Background settings for the video | Object | {"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
| Parameter | Description | Data Type | Example |
|---|---|---|---|
| height | The height of the element, as a percentage of its container | String | 100% |
| width | The width of the element, as a percentage of its container | String | 100% |
| position | The positioning of the element relative to its container | String | absolute |
| zIndex | The z-index of the element, which determines its stacking order | Integer | 1 |
Image
| Parameter | Description | Data Type | Example |
|---|---|---|---|
| height | The height of the element | String | 43.28756938625066em |
| width | The width of the element | String | 43.28756938625066em |
| bottom | The distance between the bottom of the element and the bottom of its container | String | 6.458198131217985em |
| left | The distance between the left of the element and the left of its container | String | 54.50089154637617em |
| zIndex | The z-index of the element, which determines its stacking order | Integer | 10 |
| position | The positioning of the element relative to its container | String | absolute |
Text
| Parameter Name | Description | Data Type | Example |
|---|---|---|---|
| variant | Type of text variant | string | subheading |
| fontSize | Font size in em | string | 5em |
| fontFamily | Font family name | string | Arial, Roboto, Calibri, DM Sans, Raleway, Times New Roman |
| color | Font color | string | #FFFFFF |
| position | Position of text in the asset | string | absolute |
| zIndex | Layer order of the text | integer | 15 |
| align | Text alignment | string | right |
| height | Height of the text element | string | 7em |
| width | Width of the text element | string | 33em |
| bottom | Distance of the text element from the bottom | string | 34em |
| left | Distance of the text element from the left | string | 60em |
| fontColor | Font color in RGB format | string | #000000 |
| textDecorationColor | Text decoration color in RGB format | string | #000000 |
Shape
| Parameter Name | Description | Data Type | Example |
|---|---|---|---|
| position | Position of shape in the asset | string | absolute |
| zIndex | Layer order of the shape | integer | 15 |
| height | Height of the shape element | string | 7em |
| width | Width of the shape element | string | 33em |
| bottom | Distance of the shape element from the bottom | string | 34em |
| left | Distance of the shape element from the left | string | 60em |
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 usehardcode_subtitlesinstead): A boolean value indicating whether to embed subtitles within the video.
Background Music
Click to expand
The background music field includes the following properties:
asset: The background music asset.url: The URL of the asset. Example: "https://rephrase-assets.s3.ap-south-1.amazonaws.com/media/panel_defaults/music/acoustic-motivation-11290.mp3"
mediaElProps: The media element properties.volume: The volume of the audio. Example: 0.5.
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
