Table of Contents

Class LiveVideoCompositorSettings

Namespace
VisioForge.Core.LiveVideoCompositorV2
Assembly
VisioForge.Core.dll

Contains configuration settings for the Live Video Compositor. This class defines all the parameters needed to initialize and configure a live video compositing session, including video dimensions, frame rate, audio settings, and output destinations.

public class LiveVideoCompositorSettings

Inheritance

Inherited Members

Remarks

The settings control both video and audio parameters for the compositor, as well as specify the mixer type and output targets. Video parameters are immutable once set through the constructor. The audio settings are read once, when the VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor is constructed; changing them afterwards has no effect. Output destinations can be modified after initialization.

Constructors

LiveVideoCompositorSettings(int, int, VideoFrameRate)

Initializes a new instance of the VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings class with the specified video dimensions and frame rate.

public LiveVideoCompositorSettings(int width, int height, VideoFrameRate frameRate)

Parameters

width int

The width of the output video in pixels.

height int

The height of the output video in pixels.

frameRate VideoFrameRate

The frame rate for the output video.

Remarks

The constructor sets the video parameters which are immutable after initialization. The mixer type is automatically set to OpenGL for cross-platform compatibility. Audio settings are initialized to default values and can be changed until this object is passed to the VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor constructor.

Fields

MaxInputFrameHoldTimeout

Maximum safe value for VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings.InputFrameHoldTimeout — 100 days. The underlying intervideosrc timeout is stored as a UInt64 nanosecond count, so the theoretical overflow point is ulong.MaxValue ns ≈ 584 years. The 100-day cap is an intentional sanity limit, not an overflow guard — no realistic compositor scenario needs a hold longer than that.

public static readonly TimeSpan MaxInputFrameHoldTimeout

Field Value

TimeSpan

Properties

AudioChannels

Gets or sets the number of audio channels.

public int AudioChannels { get; set; }

Property Value

int

AudioEnabled

Gets or sets a value indicating whether audio stream processing is enabled in the compositor.

public bool AudioEnabled { get; set; }

Property Value

bool

AudioFormat

Gets or sets the audio sample format for the compositor's audio output.

public AudioFormatX AudioFormat { get; set; }

Property Value

AudioFormatX

AudioOutput

Gets or sets the audio renderer block for audio playback.

public AudioRendererBlock AudioOutput { get; set; }

Property Value

AudioRendererBlock

Remarks

The block stays yours across a stop: the compositor wires it into the composition on start and takes it back out on stop without disposing it, so dispose it yourself - including the instance you replace when you assign a different renderer between two starts, which is a supported thing to do.

The one exception is disposing a compositor that is still running. The block is then still in the pipeline's own collection - the stop that would have taken it out never happened - and the pipeline disposes what it holds. Stop the compositor before disposing it if you mean to keep the renderer.

AudioSampleRate

Gets or sets the audio sample rate in Hz.

public int AudioSampleRate { get; set; }

Property Value

int

InputFrameHoldTimeout

Gets or sets the timeout after which an input's bridge switches from repeating its last received frame to producing black frames when no new buffers arrive.

public TimeSpan InputFrameHoldTimeout { get; set; }

Property Value

TimeSpan

Remarks

Applied to the intervideosrc element in each input's bridge. While the input pipeline is paused, intervideosrc continues to output the last received buffer at the configured framerate until this timeout elapses, after which it begins emitting black frames.

This timeout is not pause-aware. The underlying intervideosrc timeout fires on ANY absence of incoming buffers for longer than the configured value — a network stall on an RTSP input, a crashed decoder, a slow source, or a file EOS will all trigger the same "frozen last frame until timeout, then black" behavior as an explicit pause. Large values therefore mask genuine source failures as a frozen picture instead of a visible black transition.

If the input pauses or stalls before the first frame has reached the bridge (for example a slow source that hasn't negotiated caps yet), intervideosrc has no cached frame to hold and emits black frames regardless of this timeout — the hold behavior requires at least one frame to have been received on the bridge.

The value is captured when each input's bridge is built (during VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor.StartAsync / input registration). Changes made after the compositor has started do not retroactively affect bridges that were already built — they only apply to bridges constructed afterwards.

This property is not thread-safe. Configure it before VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor.StartAsync; concurrent reads and writes against a TimeSpan (8 bytes) are not guaranteed atomic on 32-bit runtimes.

The setter throws ArgumentOutOfRangeException for zero / negative values and for values greater than VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings.MaxInputFrameHoldTimeout. Zero is rejected because its behavior is implementation-defined across GStreamer versions (some treat it as "disabled", others emit black frames on every boundary); use VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings.MaxInputFrameHoldTimeout if you want an effectively-infinite hold.

MaxAudioInputsCount

Gets or sets the maximum number of audio input sources that can be connected to the compositor.

public int MaxAudioInputsCount { get; set; }

Property Value

int

Remarks

Enforced the same way as VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings.MaxVideoInputsCount. A video/audio input counts against each limit whose leg it has, so with both the smaller of the two decides. It has no audio leg without audio info, or when its VisioForge.Core.MediaBlocks.Sources.UniversalSourceBlock, VisioForge.Core.MediaBlocks.Sources.DemuxerSourceBlock, BluRaySourceBlock or VisioForge.Core.MediaBlocks.Sources.UniversalSourceBlockV2 renders no audio or plays a file without it; no video leg on the same terms for video.

MaxAudioOutputsCount

Gets or sets the maximum number of audio output destinations that can receive the mixed audio.

public int MaxAudioOutputsCount { get; set; }

Property Value

int

Remarks

Enforced the same way as VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings.MaxVideoInputsCount. A video/audio output counts against both this and the video limit, so the smaller of the two decides.

MaxVideoInputsCount

Gets or sets the maximum number of video input sources that can be connected to the compositor.

public int MaxVideoInputsCount { get; set; }

Property Value

int

Remarks

An Input_AddAsync that would take the compositor past this count is refused with false and nothing is added. Set it before the first add: the limit is read on each add, so lowering it below the number of inputs already present refuses further adds but removes none. Higher values allow more simultaneous video sources but require more memory and processing power - typically 2-4 for basic mixing, 8-16 for complex productions. The default of 10 is deliberately above v1's 4: v2 enforced no limit at all before, so a lower one would have refused compositions that used to work.

MaxVideoOutputsCount

Gets or sets the maximum number of video output destinations that can receive the composed video.

public int MaxVideoOutputsCount { get; set; }

Property Value

int

Remarks

Enforced the same way as VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings.MaxVideoInputsCount. Multiple outputs allow simultaneous streaming, recording and preview: 1 for simple recording, 2-3 for streaming plus recording, 4 or more for multi-destination broadcasting.

MixerType

Gets or sets the type of video mixer to use for compositing.

public LVCMixerType MixerType { get; set; }

Property Value

LVCMixerType

VideoFrameRate

Gets the frame rate for the output video.

public VideoFrameRate VideoFrameRate { get; }

Property Value

VideoFrameRate

VideoHeight

Gets the height of the output video in pixels.

public int VideoHeight { get; }

Property Value

int

VideoView

Gets or sets the video view control for direct rendering output.

public IVideoView VideoView { get; set; }

Property Value

IVideoView

VideoWidth

Gets the width of the output video in pixels.

public int VideoWidth { get; }

Property Value

int