Skip to main content
Version: 24.38.0

ScreencastOptions 接口

🌐 ScreencastOptions interface

语法

🌐 Signature

export interface ScreencastOptions

属性

🌐 Properties

属性

🌐 Property

修饰符

🌐 Modifiers

类型

🌐 Type

描述

🌐 Description

默认

🌐 Default

colors

optional

number

指定要量化的 调色板 颜色的最大数量,GIF 限制为 256。将调色板限制为仅必要的颜色以减小输出文件大小。

🌐 Specifies the maximum number of palette colors to quantize, with GIF limited to 256. Restrict the palette to only necessary colors to reduce output file size.

256

crop

optional

边界框

指定要裁剪的视口区域。

🌐 Specifies the region of the viewport to crop.

delay

optional

number

指定循环迭代之间的延迟时间,单位为毫秒。-1 是一个特殊值,用于重用先前的延迟。

🌐 Specifies the delay between iterations of a loop, in ms. -1 is a special value to re-use the previous delay.

-1

ffmpegPath

optional

string

ffmpeg 的路径。

🌐 Path to the ffmpeg.

如果 ffmpeg 不在你的 PATH 中,则必需。

🌐 Required if ffmpeg is not in your PATH.

'ffmpeg'

format

optional

视频格式

指定输出文件格式。

🌐 Specifies the output file format.

'webm'

fps

optional

number

指定每秒帧数的帧速率。

🌐 Specifies the frame rate in frames per second.

30(GIF 用 20

loop

optional

number

指定播放循环的次数,从 0Infinity。值为 0undefined 将禁用循环。

🌐 Specifies the number of times to loop playback, from 0 to Infinity. A value of 0 or undefined will disable looping.

undefined

overwrite

optional

boolean

指定是否覆盖输出文件,如果文件已存在则立即退出。

🌐 Specifies whether to overwrite output file, or exit immediately if it already exists.

true

path

optional

`${string}.${VideoFormat}`

保存截屏视频的文件路径。

🌐 File path to save the screencast to.

quality

optional

number

指定录制的质量恒定速率因子,范围在 063 之间。数值越低意味着质量越好。

🌐 Specifies the recording quality Constant Rate Factor between 063. Lower values mean better quality.

30

scale

optional

number

缩放输出视频。

🌐 Scales the output video.

例如,0.5 会将输出视频的宽度和高度缩小一半。2 会将输出视频的宽度和高度加倍。

🌐 For example, 0.5 will shrink the width and height of the output video by half. 2 will double the width and height of the output video.

1

speed

optional

number

指定录制的速度。

🌐 Specifies the speed to record at.

例如,0.5 会将输出视频减慢 50%。2 会将输出视频加速一倍。

🌐 For example, 0.5 will slowdown the output video by 50%. 2 will double the speed of the output video.

1