Render

Render

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:
input optional
Default Value: "./index.html"
input?: string
File URL to Rendering
fps optional
Default Value: 60
fps?: number
fps
output optional
Default Value: "output.mp4"
output?: string
Output file name
startTime optional
Default Value: 0
startTime?: number
Input for start time
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
multi optional
Default Value: 1
multi?: number
Number of browsers to be used for capturing
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
width optional
width?: number
page width
height optional
height?: number
page height
name optional
name?: string
scene's name in window
media optional
media?: string
scene's media name in window
path optional
path?: string
file path or url
scale optional
scale?: number
page scale
referer optional
referer?: string
browser's referer
ffmpegPath optional
ffmpegPath?: string
If you want to use native ffmpeg for faster speed, write the path of ffmpeg.
ffmpegLog optional
Default Value: false
ffmpegLog?: boolean
Whether to show ffmpeg's logs
noLog optional
Default Value: true
noLog?: boolean
Whether to show Scene.js's Render logs
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