textmode.export.js / TextmodeExportAPI / saveVideo
Method: saveVideo()
ts
saveVideo(options?): Promise<void>;Captures a video and saves it to disk ('mp4' by default).
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | VideoExportOptions | Export options. |
Returns
Promise<void>
Examples
ts
// Mediabunny's qualitative quality levels produce content-dependent file sizes.
await t.saveVideo({
format: 'webm',
quality: 'very-high',
frameCount: 240,
frameRate: 60,
filename: 'high-quality-capture',
});
// Request a target bitrate and rate-control mode.
await t.saveVideo({
quality: { bitrate: 8_000_000, bitrateMode: 'variable' },
frameCount: 240,
frameRate: 60,
filename: 'target-bitrate-capture',
});
// Stream directly to a user-selected file when the browser supports it.
await t.saveVideo({
destination: 'file-system',
quality: 'high',
frameCount: 240,
frameRate: 60,
});