Exporter
interface Exporter
The main interface for implementing custom exporters.
Implemented by
Methods
configuration
public configuration(): PromisevoidRendererSettings
Prepare the rendering configuration.
Called at the beginning of the rendering process, before anything else has been set up. The returned value can be used to override the rendering settings provided by the user.
downloadVideos
public downloadVideosassetsInfo: AssetInfo[][]: Promisevoid
Download all assets necessary for the export process
Parameters
assetsInfo: AssetInfo[][]
generateAudio
public generateAudioassetsInfo: AssetInfo[][]startFrame: numberendFrame: number: Promisevoid
Take in media assets per frame and generate audio track for the video.
Parameters
assetsInfo: AssetInfo[][]
startFrame: number
endFrame: number
handleFrame
public handleFramecanvas: HTMLCanvasElementframe: numbersceneFrame: numbersceneName: stringsignal: AbortSignal: Promisevoid
Export a frame.
Called each time after a frame is rendered.
Parameters
canvas: HTMLCanvasElement
A canvas containing the rendered frame.
frame: number
The frame number.
sceneFrame: number
The frame number within the scene.
sceneName: string
The name of the scene with which the frame is associated.
signal: AbortSignal
An abort signal triggered if the user aborts the rendering.
kill
public kill(): Promisevoid
Finish the rendering process.
Guaranteed to be called after the rendering has finished - no matter the result. Performs clean-up.
mergeMedia
public mergeMedia(): Promisevoid
after processing the image stream and generating an audio file, merge the video and audio stream as the final video
start
public start(): Promisevoid
Begin the rendering process.
Called after the rendering has been set up, right before the first frame
is rendered. Once start()
is called, it is guaranteed that the stop()
method will be called as well. Can be used to initialize any resources that
require a clean-up.
stop
public stopresult: RendererResult: Promisevoid
Finish the rendering process.
Called after rendering the visual elements has finished and audio so that audio track can be merged.
Parameters
result: RendererResult
The result of the rendering.