- Source:
Methods
(async, static) render(optionsopt) → {Promise<void>}
- Source:
Name | Type | Default | Description |
---|---|---|---|
options ? |
RenderOptions |
{}
|
Example
import { render } from "@scenejs/render";
render({
input: "./index.html",
name: "scene",
output: "output.mp4",
});
Returns:
- Type
- Promise<void>
Type Definitions
RenderOptions
- Source:
Properties:
buffer
optional
Default Value: false
buffer?:
boolean | number | undefined | ""
Whether to use buffer instead of saving frame image file in capturing (cache is disabled.)
cache
optional
Default Value: false
cache?:
boolean | number | undefined | ""
If there are frames in the cache folder, the capture process is passed.
cacheFolder
optional
Default Value: ".scene_cache"
cacheFolder?:
string
Cache folder name to save frame image
duration
optional
Default Value: 0
duration?:
number | undefined | ""
Input how many seconds to play
iteration
optional
Default Value: 0
iteration?:
number | undefined | ""
Input iterationCount of the Scene set by the user himself.
bitrate
optional
Default Value: "4096k"
bitrate?:
string
Bitrate of video (the higher the bit rate, the clearer the video quality)
codec
optional
Default Value: "mp4: libx264, webm:libvpx-vp9"
codec?:
string
Codec to encode video If you don't set it up, it's the default
imageType
optional
Default Value: "png"
imageType?:
"png" | "jpeg"
Image type to record video (png or jpeg)
If png is selected, webm and alpha are available.
alpha
optional
Default Value: false
alpha?:
boolean | number | undefined | ""
If you use the png image type, you can create a video with a transparent background. (The video extension must be webm.)
cpuUsed
optional
Default Value: 8
cpuUsed?:
number
Number of cpus to use for ffmpeg video or audio processing
ffmpegPath
optional
ffmpegPath?:
string
If you want to use native ffmpeg for faster speed, write the path of ffmpeg.
created
optional
created?:
(inst: Recorder) => void
A hook function called when an instance is created
logger
optional
logger?:
(...messages) => void
Messages output from Scene.js Render can be received from the outside through a function.
Type:
- TSInterface