StreamSwitchHardSettings interface

Settings for the Hard Stream Switch see: NorskControl.streamSwitchHard()

Signature:

export interface StreamSwitchHardSettings<Pins extends string> extends ProcessorNodeSettings<StreamSwitchHardNode<Pins>>

Properties

Property Type Description

activeSource

Pins

The currently active source to display on the output

bufferDelayMs?

number

(Optional) Optionally delay all streams by a fixed (wallclock) duration. This option is provided to allow decisions on switching to be made with the benefit of a buffer’s worth of foresight, specifically if a stream should disappear, actioning the switch to a backup stream can be made early enough that the switch can occur on a keyframe

maxQueueMs?

number

(Optional) Maximum duration to hold any stream in the case that one or more are running behind. In the case the late stream is delayed rather than having a large gap, this will result in discarded input frames.

onInboundContextChange?

(allStreams: Map<Pins, StreamMetadata[]>) ⇒ Promise<void>

(Optional) Callback to be called when inbound context changes on some input; presence of an input means that media has arrived and is ready to switch immediately

Note that in combination with StreamSwitchHardSettings.bufferDelayMs this event represents the delayed media context (i.e. still ready to switch immediately according to this context, but any observation of early changes must happen upstream).

onSwitchComplete?

(source?: string) ⇒ void

(Optional) Callback which will be called if a switch request has been effectuated - that is, after a source switch is requested and has been accepted (is not an error), the desired source is now active on the output. For video sources, this means that a keyframe (IDR/IRAP/etc) has arrived on (at least one video stream), for audio-only sources this will be any frame.

onSwitchError?

(message: string, inputPin?: Pins) ⇒ void

(Optional) Callback which will be called if a switch request cannot be fulfilled

outputSource

string

the source name to give the output of this switch operation

stableOutputContext?

boolean

(Optional) When true, suppress transient/partial output contexts during source transitions. The output context only changes when the new context is either fully empty (carries teardown semantics) or contains at least the streams of the previously-emitted one; identical-to-previous contexts are deduped. Pairs naturally with stripVolatileMetadata when downstream is sensitive to context churn. Defaults to false.

startAncillaryStreamId?

number

(Optional) Starting stream ID for the output ancillary stream (default 513)

startAudioStreamId?

number

(Optional) Starting stream ID for the output audio stream (default 2)

startSubtitleStreamId?

number

(Optional) Starting stream ID for the output subtitle stream (default 257)

startVideoStreamId?

number

(Optional) Starting stream ID for the output video stream (default 1)

stripVolatileMetadata?

boolean

(Optional) When true, strip volatile metadata fields (currently bitrate on compressed audio/video) from the output context. Useful when downstream consumers are sensitive to context churn caused by the active source’s instantaneous bitrate fluctuating. Defaults to false.