action shotstack_post_render {
label: "Render Asset"
description: "Queue and render the contents of a timeline as a video, image or audio file."
provider: shotstack
method: POST
path: "/render"
encoding: json
input: {
type: "object"
description: "An edit defines the arrangement of a video on a timeline, an audio edit or an image design and the output format."
required: ["output", "timeline"]
properties: {
callback: {
type: "string"
description: "An optional webhook callback URL used to receive status notifications when a render completes or fails. See [webhooks](https://shotstack.gitbook.io/docs/guides/architecting-an-application/webhooks) for more details."
}
disk: {
type: "string"
description: "The disk type to use for storing footage and assets for each render. See [disk types](https://shotstack.gitbook.io/docs/guides/architecting-an-application/disk-types) for more details.
\n - `local` - optimized for high speed rendering with up to 512MB storage
\n - `mount` - optimized for larger file sizes and longer videos with 5GB for source footage and 512MB for output render
\n
"
enum: ["local", "mount"]
}
output: {
type: "object"
description: "The output format, render range and type of media to generate."
required: ["format"]
properties: {
aspectRatio: {
type: "string"
description: "The aspect ratio (shape) of the video or image. Useful for social media output formats. Options are: \n - `16:9` - regular landscape/horizontal aspect ratio (default)
\n - `9:16` - vertical/portrait aspect ratio
\n - `1:1` - square aspect ratio
\n - `4:5` - short vertical/portrait aspect ratio
\n - `4:3` - legacy TV aspect ratio
\n
"
enum: ["16:9", "9:16", "1:1", "4:5", "4:3"]
}
destinations: {
type: "array"
description: "A destination is a location where output files can be sent to for serving or hosting. By default all rendered assets are automatically sent to the Shotstack hosting destination. [DestinationShotstack](/#tocs_shotstackdestination) is currently the only option with plans to add more in the future such as S3, YouTube, Vimeo and Mux. If you do not require hosting you can opt-out using the `exclude` property."
items: {
type: "object"
}
}
format: {
type: "string"
description: "The output format and type of media file to generate. \n - `mp4` - mp4 video file
\n - `gif` - animated gif
\n - `jpg` - jpg image file
\n - `png` - png image file
\n - `bmp` - bmp image file
\n - `mp3` - mp3 audio file (audio only)
\n
"
enum: ["mp4", "gif", "mp3", "jpg", "png", "bmp"]
}
fps: {
type: "integer"
description: "Override the default frames per second. Useful for when the source footage is recorded at 30fps, i.e. on mobile devices. Lower frame rates can be used to add cinematic quality (24fps) or to create smaller file size/faster render times or animated gifs (12 or 15fps). Default is 25fps. \n - `12` - 12fps
\n - `15` - 15fps
\n - `24` - 24fps
\n - `25` - 25fps
\n - `30` - 30fps
\n
"
enum: [12, 15, 24, 25, 30]
}
poster: {
type: "object"
description: "Generate a poster image for the video at a specific point from the timeline. The poster image size will match the size of the output video."
required: ["capture"]
properties: {
capture: {
type: "number"
description: "The point on the timeline in seconds to capture a single frame to use as the poster image."
}
}
}
quality: {
type: "string"
description: "Adjust the output quality of the video, image or audio. Adjusting quality affects render speed, download speeds and storage requirements due to file size. The default `medium` provides the most optimized choice for all three factors. \n - `low` - slightly reduced quality, smaller file size
\n - `medium` - optimized quality, render speeds and file size
\n - `high` - slightly increased quality, larger file size
\n
"
enum: ["low", "medium", "high"]
}
range: {
type: "object"
description: "Specify a time range to render, i.e. to render only a portion of a video or audio file. Omit this setting to export the entire video. Range can also be used to render a frame at a specific time point - setting a range and output format as `jpg` will output a single frame image at the range `start` point."
properties: {
length: {
type: "number"
format: "float"
description: "The length of the portion of the video or audio to render - i.e. render 6 seconds of the video."
}
start: {
type: "number"
format: "float"
description: "The point on the timeline, in seconds, to start the render from - i.e. start at second 3."
}
}
}
resolution: {
type: "string"
description: "The output resolution of the video or image. \n - `preview` - 512px x 288px @ 15fps
\n - `mobile` - 640px x 360px @ 25fps
\n - `sd` - 1024px x 576px @ 25fps
\n - `hd` - 1280px x 720px @ 25fps
\n - `1080` - 1920px x 1080px @ 25fps
\n
"
enum: ["preview", "mobile", "sd", "hd", "1080"]
}
scaleTo: {
type: "string"
description: "Override the resolution and scale the video or image to render at a different size. When using scaleTo the asset should be edited at the resolution dimensions, i.e. use font sizes that look best at HD, then use scaleTo to output the file at SD and the text will be scaled to the correct size. This is useful if you want to create multiple asset sizes. \n - `preview` - 512px x 288px @ 15fps
\n - `mobile` - 640px x 360px @ 25fps
\n - `sd` - 1024px x 576px @25fps
\n - `hd` - 1280px x 720px @25fps
\n - `1080` - 1920px x 1080px @25fps
\n
"
enum: ["preview", "mobile", "sd", "hd", "1080"]
}
size: {
type: "object"
description: "Set a custom size for a video or image. When using a custom size omit the `resolution` and `aspectRatio`. Custom sizes must be divisible by 2 based on the encoder specifications."
properties: {
height: {
type: "integer"
description: "Set a custom height for the video or image file. Value must be divisible by 2. Maximum video height is 1920px, maximum image height is 4096px."
}
width: {
type: "integer"
description: "Set a custom width for the video or image file. Value must be divisible by 2. Maximum video width is 1920px, maximum image width is 4096px."
}
}
}
thumbnail: {
type: "object"
description: "Generate a thumbnail image for the video or image at a specific point from the timeline."
required: ["capture", "scale"]
properties: {
capture: {
type: "number"
description: "The point on the timeline in seconds to capture a single frame to use as the thumbnail image."
}
scale: {
type: "number"
description: "Scale the thumbnail size to a fraction of the viewport size - i.e. setting the scale to 0.5 will scale the thumbnail to half the size of the viewport."
}
}
}
}
}
timeline: {
type: "object"
description: "A timeline represents the contents of a video edit over time, an audio edit over time, in seconds, or an image layout. A timeline consists of layers called tracks. Tracks are composed of titles, images, audio, html or video segments referred to as clips which are placed along the track at specific starting point and lasting for a specific amount of time."
required: ["tracks"]
properties: {
background: {
type: "string"
description: "A hexadecimal value for the timeline background colour. Defaults to #000000 (black)."
}
cache: {
type: "boolean"
description: "Disable the caching of ingested source footage and assets. See [caching](https://shotstack.gitbook.io/docs/guides/architecting-an-application/caching) for more details."
}
fonts: {
type: "array"
description: "An array of custom fonts to be downloaded for use by the HTML assets."
items: {
type: "object"
description: "Download a custom font to use with the HTML asset type, using the font name in the CSS or font tag. See our [custom fonts](https://shotstack.io/learn/html-custom-fonts/) getting started guide for more details."
required: ["src"]
properties: {
src: {
type: "string"
description: "The URL of the font file. The URL must be publicly accessible or include credentials."
}
}
}
}
soundtrack: {
type: "object"
description: "A music or audio file in mp3 format that plays for the duration of the rendered video or the length of the audio file, which ever is shortest."
required: ["src"]
properties: {
effect: {
type: "string"
description: "The effect to apply to the audio file \n - `fadeIn` - fade volume in only
\n - `fadeOut` - fade volume out only
\n - `fadeInFadeOut` - fade volume in and out
\n
"
enum: ["fadeIn", "fadeOut", "fadeInFadeOut"]
}
src: {
type: "string"
description: "The URL of the mp3 audio file. The URL must be publicly accessible or include credentials."
}
volume: {
type: "number"
description: "Set the volume for the soundtrack between 0 and 1 where 0 is muted and 1 is full volume (defaults to 1)."
}
}
}
tracks: {
type: "array"
description: "A timeline consists of an array of tracks, each track containing clips. Tracks are layered on top of each other in the same order they are added to the array with the top most track layered over the top of those below it. Ensure that a track containing titles is the top most track so that it is displayed above videos and images."
items: {
type: "object"
description: "A track contains an array of clips. Tracks are layered on top of each other in the order in the array. The top most track will render on top of those below it."
required: ["clips"]
properties: {
clips: {
type: "array"
description: "An array of Clips comprising of TitleClip, ImageClip or VideoClip."
items: {
type: "object"
description: "A clip is a container for a specific type of asset, i.e. a title, image, video, audio or html. You use a Clip to define when an asset will display on the timeline, how long it will play for and transitions, filters and effects to apply to it."
required: ["asset", "start", "length"]
properties: {
asset: {
description: "The type of asset to display for the duration of this Clip. Value must be one of TitleAsset, ImageAsset, VideoAsset, HtmlAsset, AudioAsset or LumaAsset"
type: "object"
}
effect: {
type: "string"
description: "A motion effect to apply to the Clip. \n - `zoomIn` - slow zoom in
\n - `zoomOut` - slow zoom out
\n - `slideLeft` - slow slide (pan) left
\n - `slideRight` - slow slide (pan) right
\n - `slideUp` - slow slide (pan) up
\n - `slideDown` - slow slide (pan) down
\n
"
enum: ["zoomIn", "zoomOut", "slideLeft", "slideRight", "slideUp", "slideDown"]
}
filter: {
type: "string"
description: "A filter effect to apply to the Clip. \n - `boost` - boost contrast and saturation
\n - `contrast` - increase contrast
\n - `darken` - darken the scene
\n - `greyscale` - remove colour
\n - `lighten` - lighten the scene
\n - `muted` - reduce saturation and contrast
\n - `invert` - invert colors
\n
"
enum: ["boost", "contrast", "darken", "greyscale", "lighten", "muted", "negative"]
}
fit: {
type: "string"
description: "Set how the asset should be scaled to fit the viewport using one of the following options: \n \n - `cover` - stretch the asset to fill the viewport without maintaining the aspect ratio.
\n - `contain` - fit the entire asset within the viewport while maintaining the original aspect ratio.
\n - `crop` - scale the asset to fill the viewport while maintaining the aspect ratio. The asset will be cropped if it exceeds the bounds of the viewport.
\n - `none` - preserves the original asset dimensions and does not apply any scaling.
\n
"
enum: ["cover", "contain", "crop", "none"]
}
length: {
type: "number"
description: "The length, in seconds, the Clip should play for."
}
offset: {
type: "object"
description: "Offsets the position of an asset horizontally or vertically by a relative distance."
properties: {
x: {
type: "number"
format: "float"
description: "Offset an asset on the horizontal axis (left or right), range varies from -1 to 1. Positive numbers move the asset right, negative left. For all assets except titles the distance moved is relative to the width of the viewport - i.e. an X offset of 0.5 will move the asset half the screen width to the right."
}
y: {
type: "number"
format: "float"
description: "Offset an asset on the vertical axis (up or down), range varies from -1 to 1. Positive numbers move the asset up, negative down. For all assets except titles the distance moved is relative to the height of the viewport - i.e. an Y offset of 0.5 will move the asset up half the screen height."
}
}
}
opacity: {
type: "number"
description: "Sets the opacity of the Clip where 1 is opaque and 0 is transparent."
}
position: {
type: "string"
description: "Place the asset in one of nine predefined positions of the viewport. This is most effective for when the asset is scaled and you want to position the element to a specific position. \n - `top` - top (center)
\n - `topRight` - top right
\n - `right` - right (center)
\n - `bottomRight` - bottom right
\n - `bottom` - bottom (center)
\n - `bottomLeft` - bottom left
\n - `left` - left (center)
\n - `topLeft` - top left
\n - `center` - center
\n
"
enum: ["top", "topRight", "right", "bottomRight", "bottom", "bottomLeft", "left", "topLeft", "center"]
}
scale: {
type: "number"
description: "Scale the asset to a fraction of the viewport size - i.e. setting the scale to 0.5 will scale asset to half the size of the viewport. This is useful for picture-in-picture video and scaling images such as logos and watermarks."
}
start: {
type: "number"
description: "The start position of the Clip on the timeline, in seconds."
}
transition: {
type: "object"
description: "In and out transitions for a clip - i.e. fade in and fade out"
properties: {
in: {
type: "string"
description: "The transition in. Available transitions are:\n \n - `fade` - fade in
\n - `reveal` - reveal from left to right
\n - `wipeLeft` - fade across screen to the left
\n - `wipeRight` - fade across screen to the right
\n - `slideLeft` - move slightly left and fade in
\n - `slideRight` - move slightly right and fade in
\n - `slideUp` - move slightly up and fade in
\n - `slideDown` - move slightly down and fade in
\n - `carouselLeft` - slide in from right to left
\n - `carouselRight` - slide in from left to right
\n - `carouselUp` - slide in from bottom to top
\n - `carouselDown` - slide in from top to bottom
\n - `shuffleTopRight` - rotate in from top right
\n - `shuffleRightTop` - rotate in from right top
\n - `shuffleRightBottom` - rotate in from right bottom
\n - `shuffleBottomRight` - rotate in from bottom right
\n - `shuffleBottomLeft` - rotate in from bottom left
\n - `shuffleLeftBottom` - rotate in from left bottom
\n - `shuffleLeftTop` - rotate in from left top
\n - `shuffleTopLeft` - rotate in from top left
\n - `zoom` - fast zoom in
\n
\nThe transition speed can also be controlled by appending `Fast` or `Slow` to the transition, e.g. `fadeFast` or `CarouselLeftSlow`."
enum: ["fade", "fadeSlow", "fadeFast", "reveal", "revealSlow", "revealFast", "wipeLeft", "wipeLeftSlow", "wipeLeftFast", "wipeRight", "wipeRightSlow", "wipeRightFast", "slideLeft", "slideLeftSlow", "slideLeftFast", "slideRight", "slideRightSlow", "slideRightFast", "slideUp", "slideUpSlow", "slideUpFast", "slideDown", "slideDownSlow", "slideDownFast", "carouselLeft", "carouselLeftSlow", "carouselLeftFast", "carouselRight", "carouselRightSlow", "carouselRightFast", "carouselUp", "carouselUpSlow", "carouselUpFast", "carouselDown", "carouselDownSlow", "carouselDownFast", "shuffleTopRight", "shuffleTopRightSlow", "shuffleTopRightFast", "shuffleRightTop", "shuffleRightTopSlow", "shuffleRightTopFast", "shuffleRightBottom", "shuffleRightBottomSlow", "shuffleRightBottomFast", "shuffleBottomRight", "shuffleBottomRightSlow", "shuffleBottomRightFast", "shuffleBottomLeft", "shuffleBottomLeftSlow", "shuffleBottomLeftFast", "shuffleLeftBottom", "shuffleLeftBottomSlow", "shuffleLeftBottomFast", "shuffleLeftTop", "shuffleLeftTopSlow", "shuffleLeftTopFast", "shuffleTopLeft", "shuffleTopLeftSlow", "shuffleTopLeftFast", "zoom"]
}
out: {
type: "string"
description: "The transition out. Available transitions are:\n \n - `fade` - fade out
\n - `reveal` - reveal from right to left
\n - `wipeLeft` - fade across screen to the left
\n - `wipeRight` - fade across screen to the right
\n - `slideLeft` - move slightly left and fade out
\n - `slideRight` - move slightly right and fade out
\n - `slideUp` - move slightly up and fade out
\n - `slideDown` - move slightly down and fade out
\n - `carouselLeft` - slide out from right to left
\n - `carouselRight` - slide out from left to right
\n - `carouselUp` - slide out from bottom to top
\n - `carouselDown` - slide out from top to bottom
\n - `shuffleTopRight` - rotate out from top right
\n - `shuffleRightTop` - rotate out from right top
\n - `shuffleRightBottom` - rotate out from right bottom
\n - `shuffleBottomRight` - rotate out from bottom right
\n - `shuffleBottomLeft` - rotate out from bottom left
\n - `shuffleLeftBottom` - rotate out from left bottom
\n - `shuffleLeftTop` - rotate out from left top
\n - `shuffleTopLeft` - rotate out from top left
\n - `zoom` - fast zoom out
\n
\nThe transition speed can also be controlled by appending `Fast` or `Slow` to the transition, e.g. `fadeFast` or `CarouselLeftSlow`."
enum: ["fade", "fadeSlow", "fadeFast", "reveal", "revealSlow", "revealFast", "wipeLeft", "wipeLeftSlow", "wipeLeftFast", "wipeRight", "wipeRightSlow", "wipeRightFast", "slideLeft", "slideLeftSlow", "slideLeftFast", "slideRight", "slideRightSlow", "slideRightFast", "slideUp", "slideUpSlow", "slideUpFast", "slideDown", "slideDownSlow", "slideDownFast", "carouselLeft", "carouselLeftSlow", "carouselLeftFast", "carouselRight", "carouselRightSlow", "carouselRightFast", "carouselUp", "carouselUpSlow", "carouselUpFast", "carouselDown", "carouselDownSlow", "carouselDownFast", "shuffleTopRight", "shuffleTopRightSlow", "shuffleTopRightFast", "shuffleRightTop", "shuffleRightTopSlow", "shuffleRightTopFast", "shuffleRightBottom", "shuffleRightBottomSlow", "shuffleRightBottomFast", "shuffleBottomRight", "shuffleBottomRightSlow", "shuffleBottomRightFast", "shuffleBottomLeft", "shuffleBottomLeftSlow", "shuffleBottomLeftFast", "shuffleLeftBottom", "shuffleLeftBottomSlow", "shuffleLeftBottomFast", "shuffleLeftTop", "shuffleLeftTopSlow", "shuffleLeftTopFast", "shuffleTopLeft", "shuffleTopLeftSlow", "shuffleTopLeftFast", "zoom"]
}
}
}
}
}
}
}
}
}
}
}
}
}
output: {
type: "object"
description: "The response received after a [render request](#render-asset) is submitted. The render task is queued for rendering and a unique render id is returned."
required: ["message", "response", "success"]
properties: {
message: {
type: "string"
description: "`Created`, `Bad Request` or an error message."
}
response: {
type: "object"
description: "The response data returned with the [QueuedResponse](#tocs_queuedresponse)."
required: ["id", "message"]
properties: {
id: {
type: "string"
description: "The id of the render task in UUID format."
}
message: {
type: "string"
description: "Success response message or error details."
}
}
}
success: {
type: "boolean"
description: "`true` if successfully queued, else `false`."
}
}
}
}