Interface RecorderSettings

Settings that apply to the whole recording session.

interface RecorderSettings {
    allowFrameReordering?: boolean;
    updatesUserPreferred?: boolean;
    audioSegmentDuration?: number;
    videoSegmentDuration?: number;
    keyframeIntervalDuration?: number;
    insufficientDiskSpaceThreshold?: number;
    lowDiskSpaceThreshold?: number;
    noAudioDuration?: number;
}

Properties

allowFrameReordering?: boolean

Specifies if RecordKit is allowed to do frame reordering in video files. Defaults to true.

When enabled, to achieve the best compression some video encoders can reorder frames and generate B-frames.

updatesUserPreferred?: boolean

Whether a successful recording updates the user's preferred devices for the sources it used. Defaults to true.

When enabled, starting a recording sets the devices in the schema as the user's preferred devices (for the device types that support this).

audioSegmentDuration?: number

Target duration, in whole seconds, of each audio segment when using segmented output. Defaults to 6. Fractional values are not supported.

videoSegmentDuration?: number

Target duration, in whole seconds, of each video segment when using segmented output. Defaults to 2. Fractional values are not supported.

keyframeIntervalDuration?: number

Maximum interval, in seconds, between keyframes in the video stream. Defaults to no forced interval.

When set, the encoder places a keyframe at least every this many seconds. The frame-count based maximum keyframe interval is computed automatically from the video frame rate. When omitted, the encoder uses its default keyframe-placement heuristic.

insufficientDiskSpaceThreshold?: number

Free disk space, in bytes, below which a running recording raises an insufficientDiskSpace Signal. Defaults to 104857600 (100 MB).

While recording, RecordKit periodically checks the actual available capacity of the volume the recording is written to (purgeable/opportunistic space is not counted). Shortly after the available capacity drops below this threshold the signal is raised, on which the recording is aborted with an insufficientDiskSpace error by default. Keep it high enough to absorb whatever is still written between two checks and to leave room to finalize the recording. Set to 0 to never raise the signal (record until the disk is full), which may result in a corrupt recording. A lowDiskSpaceThreshold keeps being reported either way.

See

RecorderSettings.lowDiskSpaceThreshold, the higher threshold that warns.

lowDiskSpaceThreshold?: number

Free disk space, in bytes, below which a recording raises a lowDiskSpace Signal. Defaults to 157286400 (150 MB).

Checked periodically while recording. The signal by default doesn't interrupt anything, so your app can warn the user, and clears again once enough space is freed up. Also checked once during prepare(), which fails with an insufficientDiskSpace error when the volume is already below it: a recording isn't started when it would warn right away.

Set this higher than insufficientDiskSpaceThreshold so there is room to warn before the recording is aborted at that lower threshold. Set to 0 to disable both the prepare-time check and the signal.

noAudioDuration?: number

How long, in seconds, a microphone or system audio item has to deliver no audio while recording before a noAudio Signal is raised for it. Defaults to 10.

No audio means only digital silence, or no audio at all. Only recording time counts, so time before the recording starts and while it is paused doesn't, and neither does time a microphone is muted or disconnected or a recorded application is closed. The signal clears as soon as audio arrives again. Set to 0 to never raise the signal.

Generated using TypeDoc