Class LiveVideoCompositor
- Assembly
- VisioForge.Core.dll
Real-time live video and audio compositor: mixes several inputs into one composition and routes it to any number of outputs, with inputs and outputs added and removed while the composition runs. Video mixing runs on the CPU, OpenGL or Direct3D 11 (Windows) depending on VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings.MixerType. Use it for live production, multi-camera switching and streaming.
public class LiveVideoCompositor : IDisposable, IAsyncDisposableInheritance
Implements
Inherited Members
Remarks
This is version 2 of the compositor and the one to use in new code; the V1 type in
VisioForge.Core.LiveVideoCompositor is obsolete. Each input and each output runs in its own
MediaBlocks pipeline, bridged into the main mixing pipeline, so one failing source cannot stall
the composition. The compositor is created from a VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings
describing the composition frame size, frame rate and audio format.
Constructors
LiveVideoCompositor(LiveVideoCompositorSettings)
Initializes a new instance of the VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor class.
public LiveVideoCompositor(LiveVideoCompositorSettings settings)Parameters
settingsLiveVideoCompositorSettings-
The configuration settings for the compositor.
Examples
var settings = new LiveVideoCompositorSettings(1920, 1080, new VideoFrameRate(30, 1))
{
MixerType = LVCMixerType.OpenGL,
AudioEnabled = true
};
var compositor = new LiveVideoCompositor(settings);
Remarks
This constructor creates the main pipeline, video mixer based on the specified mixer type, audio mixer if enabled, and all necessary infrastructure for managing inputs and outputs. The compositor is initialized but not started - call StartAsync() to begin processing.
Properties
Background
Gets or sets the background color of the compositor canvas.
public SKColor Background { get; set; }Property Value
Remarks
This color is visible in areas not covered by any video input. Changes to this property take effect immediately during playback when using transparent mixer background mode.
Settings
Gets the configuration settings for this Live Video Compositor instance.
public LiveVideoCompositorSettings Settings { get; }Property Value
Remarks
These settings are immutable after the compositor is created. To change settings, create a new compositor instance with different settings. The audio settings - VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings.AudioEnabled, the audio format, sample rate and channel count - are captured by the constructor, so changing them on this object afterwards has no effect.
Video_Overlay_Enabled
Gets or sets a value indicating whether the video overlay manager is enabled.
public bool Video_Overlay_Enabled { get; set; }Property Value
Methods
Dispose(bool)
Releases the unmanaged resources used by the VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor and optionally releases the managed resources.
protected virtual void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. This is the public synchronous Dispose method, implementing the IDisposable interface.
public void Dispose()DisposeAsync()
Asynchronously releases the unmanaged and managed resources used by the VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor. This method is part of the IAsyncDisposable pattern, allowing for asynchronous resource cleanup.
public ValueTask DisposeAsync()Returns
DurationAsync()
Gets the current playback position of the compositor.
public Task<TimeSpan> DurationAsync()Returns
- Task<TimeSpan>
-
A Task<TResult> that completes with the current position.
Remarks
For live compositing, this typically represents the elapsed time since the compositor started. The position is determined by the main pipeline's clock.
~LiveVideoCompositor()
Finalizes an instance of the VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor class. This finalizer is called by the .NET runtime to release unmanaged resources if the VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor.Dispose method was not called explicitly.
protected ~LiveVideoCompositor()GetAudioMixer()
Gets the audio mixer component of the compositor.
public AudioMixerBlock GetAudioMixer()Returns
- AudioMixerBlock
-
The VisioForge.Core.MediaBlocks.AudioProcessing.AudioMixerBlock that combines multiple audio inputs, or
nullif audio is disabled or the compositor is stopped.
Remarks
The audio mixer combines all audio inputs into a single output stream. It is only created if AudioEnabled is true in the settings, and only between StartAsync() and StopAsync() — see GetVideoMixer().
GetContext()
Gets the context object for this compositor.
public ContextX GetContext()Returns
- ContextX
-
The VisioForge.Core.GStreamer.ContextX instance used for logging and error handling.
Remarks
The context provides centralized logging and error management functionality for the compositor and all its components.
GetPipeline()
Gets the main processing pipeline of the compositor.
public MediaBlocksPipeline GetPipeline()Returns
- MediaBlocksPipeline
-
The main VisioForge.Core.MediaBlocks.MediaBlocksPipeline that manages the compositor's core processing.
Remarks
This pipeline contains the video mixer, audio mixer, effects processors, and output distribution. It is separate from the individual input and output pipelines.
GetVideoMixer()
Gets the video mixer component of the compositor.
public VideoMixerBlock GetVideoMixer()Returns
- VideoMixerBlock
-
The VisioForge.Core.MediaBlocks.VideoProcessing.VideoMixerBlock that combines multiple video inputs into a single output, or
nullwhile the compositor is stopped.
Remarks
The video mixer is the core component that performs the actual video composition. Its type (CPU, OpenGL, D3D11) is determined by the MixerType setting. It exists only between StartAsync() and StopAsync(): the composition graph is built on start and retired on stop, so the instance can be started again.
Input_AddAsync(LVCVideoInput)
Adds a video-only input to the compositor.
public Task<bool> Input_AddAsync(LVCVideoInput input)Parameters
inputLVCVideoInput-
The video input to add.
Returns
- Task<bool>
-
A Task<TResult> that completes with
trueif the input was added successfully; otherwise,false.
Remarks
On anything but true - a false and a throw alike - the input was not added and
the wrapper is the caller's. Nothing the attempt installed survives: an add that had got
far enough to build or start anything rolls all of it back and stops and disposes the
input on the way out, while one refused before it touched the input at all - a null
argument, a settings check - leaves it as it was. Either way the caller disposes it, and
disposing an already-disposed one is harmless (LVCInput.Dispose is idempotent), so a
caller that owns it through a finally needs no special case. A retry builds a fresh
input rather than re-submitting this one.
An input whose video frame size is unknown - a width or height of 0 in its info - is refused
with false, and the reason is raised through VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor.OnError. So is an input whose
source cannot be connected, such as one with no video output, or is known to send no video through the
output it has: an RTSP source or UniversalSourceBlock whose camera or file info was read, with no
video stream, or a UniversalSourceBlock with video rendering off.
This method can be called before or after the compositor is started. If called after startup, the input is dynamically added to the running pipeline. The input's AutoStart property determines whether it begins processing immediately. Each input is assigned a unique ID for bridge connections.
Exceptions
- InvalidOperationException
-
May occur if the maximum number of inputs is exceeded.
Input_AddAsync(LVCAudioInput)
Adds an audio-only input to the compositor.
public Task<bool> Input_AddAsync(LVCAudioInput input)Parameters
inputLVCAudioInput-
The audio input to add.
Returns
- Task<bool>
-
A Task<TResult> that completes with
trueif the input was added successfully; otherwise,false.
Remarks
On anything but true - a false and a throw alike - the input was not added and
the wrapper is the caller's. Nothing the attempt installed survives: an add that had got
far enough to build or start anything rolls all of it back and stops and disposes the
input on the way out, while one refused before it touched the input at all - a null
argument, a settings check - leaves it as it was. Either way the caller disposes it, and
disposing an already-disposed one is harmless (LVCInput.Dispose is idempotent), so a
caller that owns it through a finally needs no special case. A retry builds a fresh
input rather than re-submitting this one.
An input whose source cannot be connected, such as one with no audio output, is refused with
false, and the reason is raised through VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor.OnError. So is one whose source is known to
send no audio through the output it has: an RTSPSourceBlock or RTSPRAWSourceBlock with AudioEnabled off,
a file or an RTSP camera whose info was read, with no audio stream, or an NDI sender found to have no
audio when it is probed here.
This method requires audio to be enabled in the compositor settings. Like video inputs, audio inputs can be added dynamically during playback. Each input is assigned a unique ID for bridge connections and mixed into the main audio output.
Exceptions
- InvalidOperationException
-
Thrown when audio is disabled in compositor settings.
Input_AddAsync(LVCVideoAudioInput, bool)
Adds a combined video and audio input to the compositor.
public Task<bool> Input_AddAsync(LVCVideoAudioInput input, bool start = false)Parameters
inputLVCVideoAudioInput-
The video/audio input to add.
startbool-
If
true, starts the input after adding; otherwise uses the input's AutoStart property. Default isfalse.
Returns
- Task<bool>
-
A Task<TResult> that completes with
trueif the input was added successfully; otherwise,false.
Remarks
On anything but true - a false and a throw alike - the input was not added and
the wrapper is the caller's. Nothing the attempt installed survives: an add that had got
far enough to build or start anything rolls all of it back and stops and disposes the
input on the way out, while one refused before it touched the input at all - a null
argument, a settings check - leaves it as it was. Either way the caller disposes it, and
disposing an already-disposed one is harmless (LVCInput.Dispose is idempotent), so a
caller that owns it through a finally needs no special case. A retry builds a fresh
input rather than re-submitting this one.
An input that renders video with an unknown frame size - a width or height of 0 in its video
info - is refused with false, and the reason is raised through VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor.OnError. So is
an input whose source cannot be connected, such as one with no output for a leg it has.
This method handles inputs that provide both video and audio streams. The video and audio
components are processed separately but remain synchronized. Special handling is provided
for file sources to ensure proper preloading when added to a running compositor.
Both video and audio IDs are assigned from their respective pools; an input without an audio
leg - no audio info, a UniversalSourceBlock or UniversalSourceBlockV2 with audio rendering off, an
RTSPSourceBlock or RTSPRAWSourceBlock with AudioEnabled off, a file, or an RTSP camera whose info was
read, with no audio stream, or a source with no audio output such as an NDI sender found to have no
audio when it is probed - takes no audio ID and no audio slot. The same holds for video, except that
an NDI source given video info always has a video leg. An NDI source is probed here, before its audio leg is decided.
An input with neither leg is refused with false, and the reason is raised through VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor.OnError.
Input_Count()
Gets the total number of inputs currently added to the compositor.
public int Input_Count()Returns
- int
-
The number of inputs of all types (video, audio, and combined).
Remarks
This count includes all input types regardless of their current state (playing, paused, or stopped).
Input_Get(int)
Gets an input by its index in the input list.
public LVCInput Input_Get(int index)Parameters
indexint-
The zero-based index of the input.
Returns
- LVCInput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCInput at the specified index;
nullif the index is out of range.
Remarks
This method returns the base input type. Cast the result to the specific input type (LVCVideoInput, LVCAudioInput, or LVCVideoAudioInput) as needed.
Input_Get(Guid)
Gets an input by its unique identifier.
public LVCInput Input_Get(Guid id)Parameters
idGuid-
The unique identifier of the input.
Returns
- LVCInput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCInput with the specified ID;
nullif not found.
Remarks
This is the preferred method for retrieving inputs as IDs are guaranteed to be unique and stable throughout the input's lifetime. The returned base type can be cast to the specific input type as needed.
Input_GetID(string)
Gets the unique identifier of an input by its name.
public Guid? Input_GetID(string name)Parameters
namestring-
The name of the input to find.
Returns
Remarks
Input names are not required to be unique, so this method returns the first match found. For reliable identification, use the input's ID directly.
Input_GetName(Guid)
Gets the name of an input by its unique identifier.
public string Input_GetName(Guid id)Parameters
idGuid-
The unique identifier of the input.
Returns
- string
-
The name of the input if found;
nullif no input with the specified ID exists.
Remarks
This method is useful for displaying input information in user interfaces or logs.
Input_RemoveAsync(Guid)
Removes an input from the compositor by its unique ID.
public Task<bool> Input_RemoveAsync(Guid id)Parameters
idGuid-
The unique identifier of the input to remove.
Returns
- Task<bool>
-
A Task<TResult> that completes with
trueif the input was removed successfully; otherwise,false.
Remarks
This method can be called during playback to dynamically remove inputs. It properly:
- Stops the input pipeline
- Blocks and removes mixer pads
- Cleans up bridge connections
- Releases IDs back to the pool for reuse
- Disposes of all resources The removal is performed safely without interrupting other inputs or the main pipeline.
Input_VideoAudio_Get(int)
Gets a video/audio input by its index in the input list.
public LVCVideoAudioInput Input_VideoAudio_Get(int index)Parameters
indexint-
The zero-based index of the input.
Returns
- LVCVideoAudioInput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCVideoAudioInput at the specified index;
nullif the index is out of range or the input is not a video/audio type.
Remarks
This method performs type checking and will return null if the input at the specified index is not a combined video/audio input.
Input_VideoAudio_Get(Guid)
Gets a video/audio input by its unique identifier.
public LVCVideoAudioInput Input_VideoAudio_Get(Guid id)Parameters
idGuid-
The unique identifier of the input.
Returns
- LVCVideoAudioInput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCVideoAudioInput with the specified ID;
nullif not found or the input is not a video/audio type.
Remarks
This is the preferred method for retrieving inputs as IDs are guaranteed to be unique and stable throughout the input's lifetime.
Input_VideoStream_Get(LVCInput)
Gets the video mixer stream configuration for a specific input.
public VideoMixerStream Input_VideoStream_Get(LVCInput input)Parameters
inputLVCInput-
The input to get the stream for.
Returns
- VideoMixerStream
-
The VisioForge.Core.Types.X.VideoEffects.VideoMixerStream containing position, size, and other properties;
nullif the input is not found.
Remarks
Use this method to retrieve the current configuration of a video input stream, which can then be modified and updated using Input_VideoStream_Update().
It answers on a stopped compositor too, and returns the same object a run left behind: the stream survives a stop, so an input can be repositioned between StopAsync() and the next StartAsync(), which picks the change up as it rebuilds the mixer. Mutating the object is enough there — Input_VideoStream_Update() pushes to a live mixer and does nothing while the composition is stopped.
It returns null for an input without a video leg, and otherwise only before the
input's first build. Up to that point the layout is
the input's own Rectangle/ZOrder/ResizePolicy, which seed the stream;
afterwards the stream is the layout and those properties are no longer read.
Input_VideoStream_Update(VideoMixerStream)
Updates the configuration of a video input stream in the mixer.
public void Input_VideoStream_Update(VideoMixerStream stream)Parameters
streamVideoMixerStream-
The stream configuration to update.
Examples
var stream = compositor.Input_VideoStream_Get(input);
if (stream != null)
{
stream.Alpha = 0.5; // Set 50% transparency
stream.Rectangle = new Rect(100, 100, 640, 480); // Reposition
compositor.Input_VideoStream_Update(stream);
}
Remarks
Use this method to dynamically change properties of a video input during playback, such as position, size, opacity, or z-order. The stream object should be obtained from Input_VideoStream_Get() and modified before passing to this method.
It pushes the change to the running mixer, so it does nothing while the composition is stopped — there, mutating the object Input_VideoStream_Get() returned is the whole of it, and the next StartAsync() builds the mixer from it.
Output_AddAsync(LVCVideoOutput, bool)
Adds a video-only output to the compositor.
public Task<bool> Output_AddAsync(LVCVideoOutput output, bool start = false)Parameters
outputLVCVideoOutput-
The video output to add.
startbool-
If
true, starts the output immediately; otherwise, it must be started manually. Default isfalse.
Returns
- Task<bool>
-
A Task<TResult> that completes with
trueif the output was added successfully; otherwise,false.
Remarks
On anything but true - a false and a throw alike - the output was not added and
the wrapper is the caller's. Nothing the attempt installed survives: an add that had got
far enough to build or start anything rolls all of it back and stops and disposes the
output on the way out, while one refused before it touched the output at all - a null
argument, a settings check - leaves it as it was. Either way the caller disposes it, and
disposing an already-disposed one is harmless (LVCOutput.Dispose is idempotent), so a
caller that owns it through a finally needs no special case. A retry builds a fresh
output rather than re-submitting this one.
This method can be called before or after the compositor is started. If called after startup, the output is dynamically added to the running pipeline using a tee element. The start parameter overrides the output's AutoStart property for immediate activation.
Output_AddAsync(LVCAudioOutput, bool)
Adds an audio-only output to the compositor.
public Task<bool> Output_AddAsync(LVCAudioOutput output, bool start = false)Parameters
outputLVCAudioOutput-
The audio output to add.
startbool-
If
true, starts the output immediately; otherwise, it must be started manually. Default isfalse.
Returns
- Task<bool>
-
A Task<TResult> that completes with
trueif the output was added successfully; otherwise,false.
Remarks
On anything but true - a false and a throw alike - the output was not added and
the wrapper is the caller's. Nothing the attempt installed survives: an add that had got
far enough to build or start anything rolls all of it back and stops and disposes the
output on the way out, while one refused before it touched the output at all - a null
argument, a settings check - leaves it as it was. Either way the caller disposes it, and
disposing an already-disposed one is harmless (LVCOutput.Dispose is idempotent), so a
caller that owns it through a finally needs no special case. A retry builds a fresh
output rather than re-submitting this one.
Audio outputs receive the mixed audio from all audio inputs. Multiple audio outputs can be active simultaneously, each receiving the same audio mix. This is useful for recording while streaming or monitoring.
A compositor with VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings.AudioEnabled set to false
has no audio mix, so this method returns false there, before and after start alike.
Output_AddAsync(LVCVideoAudioOutput, bool)
Adds a combined video and audio output to the compositor.
public Task<bool> Output_AddAsync(LVCVideoAudioOutput output, bool start = false)Parameters
outputLVCVideoAudioOutput-
The video/audio output to add.
startbool-
If
true, starts the output immediately; otherwise, it must be started manually. Default isfalse.
Returns
- Task<bool>
-
A Task<TResult> that completes with
trueif the output was added successfully; otherwise,false.
Remarks
On anything but true - a false and a throw alike - the output was not added and
the wrapper is the caller's. Nothing the attempt installed survives: an add that had got
far enough to build or start anything rolls all of it back and stops and disposes the
output on the way out, while one refused before it touched the output at all - a null
argument, a settings check - leaves it as it was. Either way the caller disposes it, and
disposing an already-disposed one is harmless (LVCOutput.Dispose is idempotent), so a
caller that owns it through a finally needs no special case. A retry builds a fresh
output rather than re-submitting this one.
This method creates separate bridge connections for video and audio streams to the output.
Both streams remain synchronized through the output pipeline. Common uses include recording
files with both video and audio or streaming to services that require both components.
With VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositorSettings.AudioEnabled set to false only the video
bridge is created, and the output receives video alone.
Output_Audio_Get(int)
Gets an audio output by its index in the output list.
public LVCAudioOutput Output_Audio_Get(int index)Parameters
indexint-
The zero-based index of the output.
Returns
- LVCAudioOutput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCAudioOutput at the specified index;
nullif the index is out of range or the output is not an audio-only type.
Remarks
This method performs type checking and will return null if the output at the specified index is not an audio-only output.
Output_Audio_Get(Guid)
Gets an audio output by its unique identifier.
public LVCAudioOutput Output_Audio_Get(Guid id)Parameters
idGuid-
The unique identifier of the output.
Returns
- LVCAudioOutput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCAudioOutput with the specified ID;
nullif not found or the output is not an audio-only type.
Remarks
This is the preferred method for retrieving outputs as IDs are guaranteed to be unique and stable throughout the output's lifetime.
Output_Count()
Gets the total number of outputs currently added to the compositor.
public int Output_Count()Returns
- int
-
The number of outputs of all types (video, audio, and combined).
Remarks
This count includes all output types regardless of their current state (active or inactive).
Output_Get(int)
Gets an output by its index in the output list.
public LVCOutput Output_Get(int index)Parameters
indexint-
The zero-based index of the output.
Returns
- LVCOutput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCOutput at the specified index;
nullif the index is out of range.
Remarks
This method returns the base output type. Cast the result to the specific output type (LVCVideoOutput, LVCAudioOutput, or LVCVideoAudioOutput) as needed.
Output_Get(Guid)
Gets an output by its unique identifier.
public LVCOutput Output_Get(Guid id)Parameters
idGuid-
The unique identifier of the output.
Returns
- LVCOutput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCOutput with the specified ID;
nullif not found.
Remarks
This is the preferred method for retrieving outputs as IDs are guaranteed to be unique and stable throughout the output's lifetime. The returned base type can be cast to the specific output type as needed.
Output_Get(string) Deprecated
Use Output_Get(Guid id) instead for better performance and unique identification.
Gets an output by its name.
[Obsolete("Use Output_Get(Guid id) instead for better performance and unique identification.")]
public LVCOutput Output_Get(string name)Parameters
namestring-
The name of the output to find.
Returns
- LVCOutput
-
The first VisioForge.Core.LiveVideoCompositorV2.LVCOutput with the specified name;
nullif no output with the specified name exists.
Remarks
Output names are not required to be unique, so this method returns the first match found. This method is obsolete and may be removed in future versions.
Output_GetID(string)
Gets the unique identifier of an output by its name.
public Guid? Output_GetID(string name)Parameters
namestring-
The name of the output to find.
Returns
Remarks
Output names are not required to be unique, so this method returns the first match found. For reliable identification, use the output's ID directly.
Output_GetName(Guid)
Gets the name of an output by its unique identifier.
public string Output_GetName(Guid id)Parameters
idGuid-
The unique identifier of the output.
Returns
- string
-
The name of the output if found;
nullif no output with the specified ID exists.
Remarks
This method is useful for displaying output information in user interfaces or logs.
Output_RemoveAsync(Guid)
Removes an output from the compositor by its unique ID.
public Task<bool> Output_RemoveAsync(Guid id)Parameters
idGuid-
The unique identifier of the output to remove.
Returns
- Task<bool>
-
A Task<TResult> that completes with
trueif the output was removed successfully; otherwise,false.
Remarks
This method stops the output pipeline gracefully and removes it from the compositor. For file outputs, this ensures proper file finalization. The output is disposed after removal.
Output_VideoAudio_Get(int)
Gets a video/audio output by its index in the output list.
public LVCVideoAudioOutput Output_VideoAudio_Get(int index)Parameters
indexint-
The zero-based index of the output.
Returns
- LVCVideoAudioOutput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCVideoAudioOutput at the specified index;
nullif the index is out of range or the output is not a video/audio type.
Remarks
This method performs type checking and will return null if the output at the specified index is not a combined video/audio output.
Output_VideoAudio_Get(Guid)
Gets a video/audio output by its unique identifier.
public LVCVideoAudioOutput Output_VideoAudio_Get(Guid id)Parameters
idGuid-
The unique identifier of the output.
Returns
- LVCVideoAudioOutput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCVideoAudioOutput with the specified ID;
nullif not found or the output is not a video/audio type.
Remarks
This is the preferred method for retrieving outputs as IDs are guaranteed to be unique and stable throughout the output's lifetime.
Output_Video_Get(int)
Gets a video output by its index in the output list.
public LVCVideoOutput Output_Video_Get(int index)Parameters
indexint-
The zero-based index of the output.
Returns
- LVCVideoOutput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCVideoOutput at the specified index;
nullif the index is out of range or the output is not a video-only type.
Remarks
This method performs type checking and will return null if the output at the specified index is not a video-only output.
Output_Video_Get(Guid)
Gets a video output by its unique identifier.
public LVCVideoOutput Output_Video_Get(Guid id)Parameters
idGuid-
The unique identifier of the output.
Returns
- LVCVideoOutput
-
The VisioForge.Core.LiveVideoCompositorV2.LVCVideoOutput with the specified ID;
nullif not found or the output is not a video-only type.
Remarks
This is the preferred method for retrieving outputs as IDs are guaranteed to be unique and stable throughout the output's lifetime.
SetLicenseCertificateAsync(byte[])
Loads a license certificate into this instance and activates it if the certificate requires activation.
public Task SetLicenseCertificateAsync(byte[] certificateData)Parameters
certificateDatabyte[]-
The bytes of a
.vflicensecertificate file issued by VisioForge.
Returns
- Task
-
A task that completes once the certificate has been loaded and any required activation has run.
Remarks
This is the only public licensing API. The file-path and stream overloads and every license-key method were
removed in 2026.5.2, so an application reads the .vflicense file itself and passes the bytes here.
The certificate belongs to this instance: call it on every instance you create, before starting it --
licensing one instance does not license another. Without a certificate the instance runs in the 30-day trial.
StartAsync()
Starts the compositor and all configured inputs and outputs.
public Task<bool> StartAsync()Returns
- Task<bool>
-
A Task<TResult> that completes with
trueif startup was successful; otherwise,false.
Examples
var compositor = new LiveVideoCompositor(settings);
// Add inputs and outputs...
if (await compositor.StartAsync())
{
Console.WriteLine("Compositor started successfully");
}
Remarks
This method performs the following operations:
- Applies license keys to all pipelines
- Builds the internal pipeline structure
- Preloads all inputs and outputs for synchronized startup
- Configures clock synchronization across all pipelines
- Starts all components in the correct order
Inputs and outputs with AutoStart=true will begin processing immediately. Others must be started manually after the compositor is running.
StopAsync()
Stops the compositor and all active inputs and outputs.
public Task StopAsync()Returns
Remarks
This method stops all components in the reverse order of startup:
- Stops all inputs
- Stops the main pipeline
- Stops all outputs
- Retires the composition graph, so the instance can be started again
File outputs are properly finalized to ensure valid output files.
The compositor can be restarted: call StartAsync() again on the same instance, with the
inputs and outputs it still holds, plus any added or removed while it was stopped. Note
that the composition graph exists only between StartAsync() and StopAsync(), so
GetVideoMixer() and GetAudioMixer() return null on a stopped compositor.
Video_Effects_AddOrUpdateAsync(BaseVideoEffect)
Adds a new video effect or updates an existing one on the composed output.
public Task Video_Effects_AddOrUpdateAsync(BaseVideoEffect effect)Parameters
effectBaseVideoEffect-
The video effect to add or update. If an effect with the same name exists, it will be updated.
Returns
Remarks
This method can be called during playback to dynamically add or modify effects. If the video effect manager is not initialized, this method will return without doing anything. A ResizeVideoEffect, crop effect or box cannot be added or updated through this call while the composition is running with at least one video output: the outputs were built for the frame size that reached them. The call is refused through VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor.OnError, and the effect stays registered, so the next start applies it. Without outputs it applies live, as the renderer follows a frame-size change. Setting a property on an effect object that is already applied is not intercepted and takes effect live.
Video_Effects_AddOrUpdateAsync(BaseVideoEffect, int) Deprecated
The channel parameter has no meaning on V2: effects apply to the composed output. Use Video_Effects_AddOrUpdateAsync(effect). For per-input effects, add a VideoEffectsBlock to LVCVideoInput.ProcessingVideoBlocks.
Adds a new video effect or updates an existing one on the composed output.
[Obsolete("The channel parameter has no meaning on V2: effects apply to the composed output. Use Video_Effects_AddOrUpdateAsync(effect). For per-input effects, add a VideoEffectsBlock to LVCVideoInput.ProcessingVideoBlocks.")]
public Task Video_Effects_AddOrUpdateAsync(BaseVideoEffect effect, int channel)Parameters
effectBaseVideoEffect-
The video effect to add or update.
channelint-
Ignored.
Returns
Video_Effects_Clear()
Removes all video effects from the composed output.
public void Video_Effects_Clear()Remarks
A playing composition is paused for the clear and resumed afterwards. A composition left in Pause is cleared in place and stays paused. A frame-size effect present on a live composition refuses the clear - stop the composition first. A clear that cannot take the pause - the pipeline is already stopping - is reported and skipped. Before the first start, and after the composition has been stopped, the effects are only configuration and are removed without touching the pipeline state.
Video_Effects_Clear(int) Deprecated
The channel parameter has no meaning on V2: effects apply to the composed output. Use Video_Effects_Clear(). For per-input effects, add a VideoEffectsBlock to LVCVideoInput.ProcessingVideoBlocks.
Removes all video effects from the composed output.
[Obsolete("The channel parameter has no meaning on V2: effects apply to the composed output. Use Video_Effects_Clear(). For per-input effects, add a VideoEffectsBlock to LVCVideoInput.ProcessingVideoBlocks.")]
public void Video_Effects_Clear(int channel)Parameters
channelint-
Ignored.
Video_Effects_Get(string)
Retrieves a video effect by its name.
public IBaseVideoEffect Video_Effects_Get(string effectName)Parameters
effectNamestring-
The unique name of the effect to retrieve.
Returns
- IBaseVideoEffect
-
The VisioForge.Core.Types.X.VideoEffects.IBaseVideoEffect instance if found; otherwise,
null.
Remarks
Use this method to retrieve an effect instance for modification or inspection.
If the video effect manager is not initialized, this method will return null.
Video_Effects_Get(string, int) Deprecated
The channel parameter has no meaning on V2: effects apply to the composed output. Use Video_Effects_Get(effectName). For per-input effects, add a VideoEffectsBlock to LVCVideoInput.ProcessingVideoBlocks.
Retrieves a video effect by its name.
[Obsolete("The channel parameter has no meaning on V2: effects apply to the composed output. Use Video_Effects_Get(effectName). For per-input effects, add a VideoEffectsBlock to LVCVideoInput.ProcessingVideoBlocks.")]
public IBaseVideoEffect Video_Effects_Get(string effectName, int channel)Parameters
Returns
- IBaseVideoEffect
-
The VisioForge.Core.Types.X.VideoEffects.IBaseVideoEffect instance if found; otherwise,
null.
Video_Effects_RemoveAsync(BaseVideoEffect)
Removes a video effect from the composed output.
public Task Video_Effects_RemoveAsync(BaseVideoEffect effect)Parameters
effectBaseVideoEffect-
The video effect instance to remove.
Returns
Remarks
This method pauses the pipeline during effect removal to ensure smooth operation. The pipeline will automatically resume after the effect is removed. If the video effect manager or pipeline is not initialized, this method will return without doing anything. Before the first successful start, and after the composition has been stopped, the effect is removed as configuration without changing the pipeline state; the next start builds the composition from the effects that remain.
Video_Effects_RemoveAsync(string)
Removes a video effect from the composed output by its name.
public Task Video_Effects_RemoveAsync(string name)Parameters
namestring-
The unique name of the effect to remove.
Returns
Remarks
This method first looks up the effect by name, then removes it if found. The pipeline is paused during removal and automatically resumed afterwards. If the effect is not found or the video effect manager is not initialized, this method will return without doing anything. Before the first successful start, and after the composition has been stopped, the effect is removed as configuration without changing the pipeline state; the next start builds the composition from the effects that remain.
Video_Effects_RemoveAsync(BaseVideoEffect, int) Deprecated
The channel parameter has no meaning on V2: effects apply to the composed output. Use Video_Effects_RemoveAsync(effect). For per-input effects, add a VideoEffectsBlock to LVCVideoInput.ProcessingVideoBlocks.
Removes a video effect from the composed output.
[Obsolete("The channel parameter has no meaning on V2: effects apply to the composed output. Use Video_Effects_RemoveAsync(effect). For per-input effects, add a VideoEffectsBlock to LVCVideoInput.ProcessingVideoBlocks.")]
public Task Video_Effects_RemoveAsync(BaseVideoEffect effect, int channel)Parameters
effectBaseVideoEffect-
The video effect instance to remove.
channelint-
Ignored.
Returns
Video_Effects_RemoveAsync(string, int) Deprecated
The channel parameter has no meaning on V2: effects apply to the composed output. Use Video_Effects_RemoveAsync(name). For per-input effects, add a VideoEffectsBlock to LVCVideoInput.ProcessingVideoBlocks.
Removes a video effect from the composed output by its name.
[Obsolete("The channel parameter has no meaning on V2: effects apply to the composed output. Use Video_Effects_RemoveAsync(name). For per-input effects, add a VideoEffectsBlock to LVCVideoInput.ProcessingVideoBlocks.")]
public Task Video_Effects_RemoveAsync(string name, int channel)Parameters
Returns
Video_Overlay_Add(IOverlayManagerElement, int)
Adds a new overlay element to the video stream.
public void Video_Overlay_Add(IOverlayManagerElement overlay, int channel = 0)Parameters
overlayIOverlayManagerElement-
The overlay element to add, such as text, image, or shape overlay.
channelint-
The channel number for multi-channel support. Currently not used but reserved for future use. Default is 0.
Remarks
The overlay will be rendered on top of the video according to its position and properties. Multiple overlays can be added and will be rendered in the order they were added.
Video_Overlay_Clear(int)
Removes all overlay elements from the video stream.
public void Video_Overlay_Clear(int channel = 0)Parameters
channelint-
The channel number for multi-channel support. Currently not used but reserved for future use. Default is 0.
Remarks
This method clears all overlays at once, leaving a clean video output without any overlays.
Video_Overlay_Remove(IOverlayManagerElement, int)
Removes a specific overlay element from the video stream.
public void Video_Overlay_Remove(IOverlayManagerElement overlay, int channel = 0)Parameters
overlayIOverlayManagerElement-
The overlay element to remove. Must be the same instance that was previously added.
channelint-
The channel number for multi-channel support. Currently not used but reserved for future use. Default is 0.
Remarks
If the specified overlay is not found in the current overlay list, no action is taken.
Video_Overlay_RemoveAt(int, int)
Removes an overlay element at the specified index from the overlay list.
public void Video_Overlay_RemoveAt(int index, int channel = 0)Parameters
indexint-
The zero-based index of the overlay to remove.
channelint-
The channel number for multi-channel support. Currently not used but reserved for future use. Default is 0.
Exceptions
- ArgumentOutOfRangeException
-
Thrown when the index is out of range of the overlay list.
Video_Overlay_Update(IOverlayManagerElement, int)
Updates an existing overlay element with new properties.
public void Video_Overlay_Update(IOverlayManagerElement overlay, int channel = 0)Parameters
overlayIOverlayManagerElement-
The overlay element with updated properties. Must be the same instance that was previously added.
channelint-
The channel number for multi-channel support. Currently not used but reserved for future use. Default is 0.
Remarks
This method removes the existing overlay and re-adds it with the updated properties. This ensures that any changes to the overlay's properties (position, text, color, etc.) are immediately reflected in the video output.
OnAudioVUMeter
Occurs when new audio VU meter data is available.
public event EventHandler<VUMeterXEventArgs> OnAudioVUMeterEvent Type
OnError
Occurs when an error happens during compositor operation.
public event EventHandler<ErrorsEventArgs> OnErrorEvent Type
Remarks
Subscribe to this event to receive notifications about errors in the compositor, inputs, outputs, or any processing pipelines. The event args contain details about the error source and description.
OnRenderStatistics
Occurs periodically with measured render statistics for the compositor output.
public event EventHandler<RenderStatisticsEventArgs> OnRenderStatisticsEvent Type
Remarks
Fires approximately every 500 ms on a threadpool thread while the compositor is running. Use it to detect when the compositor is falling behind the configured frame rate — a sustained VisioForge.Core.Types.Events.RenderStatisticsEventArgs.ActualFps below VisioForge.Core.Types.Events.RenderStatisticsEventArgs.ConfiguredFps indicates the pipeline cannot keep up with the configured load. Marshal to the UI thread before updating controls.