@videoflow/renderer-server
Render VideoJSON to an MP4 file or buffer from Node using Playwright + ffmpeg.
Classes
ServerRenderer
Methods
constructor
(videoJSON: VideoJSON): ServerRendererParameters
| Name | Type | Description |
|---|---|---|
videoJSON | VideoJSON |
Returns
ServerRenderercleanup
(): Promise<void>Release all resources: browser context, temporary files, and shared browser.
Returns
Promise<void>renderAudio
(): Promise<Buffer<ArrayBufferLike> | null>Render the full audio track and return it as a WAV Buffer. Opens the headless page on first call, then renders all audio layers into a single WAV buffer via the in-page BrowserRenderer.
Returns
Promise<Buffer<ArrayBufferLike> | null>renderFrame
(frame: number): Promise<Buffer<ArrayBufferLike>>Render a single frame and return it as a JPEG screenshot Buffer. Opens the headless page on first call, then renders the requested frame via the in-page BrowserRenderer.
Parameters
| Name | Type | Description |
|---|---|---|
frame | number | The frame number to render. |
Returns
Promise<Buffer<ArrayBufferLike>>render
(videoJSON: VideoJSON, options: RenderOptions): Promise<string | Buffer<ArrayBufferLike>>Render a VideoJSON to a Buffer or file.
Parameters
| Name | Type | Description |
|---|---|---|
videoJSON | VideoJSON | The compiled video JSON. |
options | RenderOptions | Rendering options (outputType, output path, signal). |
Returns
Promise<string | Buffer<ArrayBufferLike>>Functions
closeSharedBrowser
(): Promise<void>Close the shared browser instance. Call this when the server is shutting down to release resources.
Returns
Promise<void>