type VideoExportOptions = object;Represents the options for exporting a video.
Defines the possible options for exporting a video.
- ‘mimeType’: The MIME type of the output video file.
- ‘onProgress’: A callback which reports on the progress of the export.
- ‘h264Profile’: Determines the encoder feature set and in turn the quality, size and speed of the encoding process.
- ‘h264Level’: Controls the H.264 encoding level.
- ‘videoBitrate’: The video bitrate in bits per second.
- ‘audioBitrate’: The audio bitrate in bits per second.
- ‘timeOffset’: The time offset in seconds of the scene’s timeline from which the video will start.
- ‘duration’: The duration in seconds of the final video.
- ‘framerate’: The target framerate of the exported video in Hz. Defaults to the scene’s
scene/frameRate. - ‘targetWidth’: An optional target width. Without a target height, the height follows from the block’s aspect ratio.
- ‘targetHeight’: An optional target height. Without a target width, the width follows from the block’s aspect ratio.
- ‘abortSignal’: An abort signal that can be used to cancel the export.
Properties#
| Property | Type | Default value | Description |
|---|---|---|---|
coverTimeOffset? |
number |
null |
undefined |
mimeType? |
VideoMimeType |
'video/mp4' |
The MIME type of the output video file: 'video/mp4' with H.264 or HEVC video, or 'video/webm' with VP8, VP9 or AV1 video. |
onProgress? |
(numberOfRenderedFrames, numberOfEncodedFrames, totalNumberOfFrames) => void |
undefined |
A callback which reports on the progress of the export. |
h264Profile? |
number |
77 (Main) |
Determines the encoder feature set and in turn the quality, size and speed of the encoding process. |
h264Level? |
number |
52 |
Controls the H.264 encoding level. This relates to parameters used by the encoder such as bit rate, timings and motion vectors. Defined by the spec are levels 1.0 up to 6.2. To arrive at an integer value, the level is multiplied by ten. E.g. to get level 5.2, pass a value of 52. |
videoBitrate? |
number |
VideoBitrateMode |
|
audioBitrate? |
number |
undefined |
The audio bitrate in bits per second. If the value is 0, the bitrate is automatically determined by the engine (128kbps for a stereo stream). Note that the browser decides which bitrates it encodes. Chrome and Edge on Windows encode AAC only at 96000, 128000, 160000 and 192000 bits per second. For any other value, the export fails. |
audioCodec? |
AudioCodec |
AudioCodec.Auto |
The codec to encode the audio with. For 'video/mp4', AudioCodec.Auto picks AAC, and Opus in a browser that encodes Opus but not AAC, such as Firefox or Chrome on Linux. For 'video/webm', it picks Opus. No browser encodes Vorbis. A codec that the file type cannot hold fails the export, and so does an explicit codec that the browser cannot encode: check editor.getCapabilityState('aacEncode') or 'opusEncode' first. |
videoCodec? |
VideoCodec |
VideoCodec.Auto |
The codec to encode the video with. VideoCodec.Auto picks H.264 for 'video/mp4' and VP9 for 'video/webm'. 'video/mp4' holds H.264 and HEVC, and 'video/webm' holds VP8, VP9 and AV1. Another codec fails the export. Check editor.getCapabilityState('vp9Encode') or the state of the codec you choose first. |
exportAlpha? |
boolean |
false |
Keep the transparency of the page as a second stream of a 'video/webm' export with VP8 or VP9. The browser has no encoder for this stream, so the export fails in the browser. @cesdk/node-native and the mobile engines export it. |
timeOffset? |
number |
0 |
The time offset in seconds of the scene’s timeline from which the video will start. |
duration? |
number |
The duration of the scene. |
The duration in seconds of the final video. |
framerate? |
number |
The scene’s scene/frameRate. |
The target framerate of the exported video in Hz, greater than 0 and at most 240. Without it the video uses the scene’s scene/frameRate, the frame that the preview motion blur shows; 30 when that is not a positive number. |
targetWidth? |
number |
undefined |
An optional target width. If used, the block will be rendered large enough that it fills the target size entirely while maintaining its aspect ratio. Without a target height, the height follows from that aspect ratio. |
targetHeight? |
number |
undefined |
An optional target height. If used, the block will be rendered large enough that it fills the target size entirely while maintaining its aspect ratio. Without a target width, the width follows from that aspect ratio. |
allowTextOverhang? |
boolean |
false |
If true, the export will include text bounding boxes that account for glyph overhangs. When enabled, text blocks with glyphs that extend beyond their frame (e.g., decorative fonts with swashes) will be exported with the full glyph bounds visible, preventing text clipping. |
abortSignal? |
AbortSignal |
undefined |
An abortsignal that can be used to cancel the export. |