Class VideoCaptureCoreX
- Namespace
- VisioForge.Core.VideoCaptureX
- Assembly
- VisioForge.Core.dll
VideoCaptureX audio effects processing implementation. This partial class provides comprehensive audio effects management for captured audio including real-time equalizers, filters, dynamic range control, noise reduction, and audio enhancement during video capture operations. Supports both live preview and recording with audio effects applied. Uses a cross-platform media processing architecture to handle audio effects in real-time.
public class VideoCaptureCoreX : IDisposable, IAsyncDisposableInheritance
Implements
Inherited Members
Remarks
Logging capabilities include:
- Structured logging with Serilog for comprehensive event tracking
- Real-time error event forwarding to application handlers
- File-based logging with rotation and size limits for debug mode
- Sentry integration for telemetry and crash reporting
- Context-aware logging with media framework integration
- Observable logging patterns for real-time monitoring
- Environment and system information collection for diagnostics
- Configurable logging levels (Debug, Error, Warning) based on operation mode Essential for debugging video capture issues and providing support diagnostics.
Constructors
VideoCaptureCoreX()
Initializes a new instance of the VisioForge.Core.VideoCaptureX.VideoCaptureCoreX class with default settings. Configures logging, initializes the cross-platform media framework, sets up platform-specific redistributables, and prepares core capture components.
public VideoCaptureCoreX()VideoCaptureCoreX(IVideoView)
Initializes a new instance of the VisioForge.Core.VideoCaptureX.VideoCaptureCoreX class with a specified video view for live preview. The video view is automatically added to the preview collection for real-time capture display. Configures logging, initializes the cross-platform media framework, sets up platform-specific redistributables, and prepares core capture components.
public VideoCaptureCoreX(IVideoView videoView)Parameters
videoViewIVideoView-
The video view control for displaying live capture preview. Pass null to capture without preview.
Properties
Audio_OutputDevice
Gets or sets the audio output device settings for audio playback. Configure this property to specify which audio device should be used for playback.
public IAudioRendererSettings Audio_OutputDevice { get; set; }Property Value
Audio_OutputDevice_Mute
Gets or sets a value indicating whether the audio output device is muted. When true, audio playback is muted regardless of the volume setting.
public bool Audio_OutputDevice_Mute { get; set; }Property Value
Audio_OutputDevice_Volume
Gets or sets the audio output device volume level. Valid range is 0.0 (mute) to 1.0 (maximum volume).
public double Audio_OutputDevice_Volume { get; set; }Property Value
Audio_Play
Gets or sets a value indicating whether audio playback is enabled during capture. When true, captured audio will be played through the configured audio output device.
public bool Audio_Play { get; set; }Property Value
Audio_Record
Gets or sets a value indicating whether audio recording is enabled for output files. When true, audio will be included in recorded files and streams.
public bool Audio_Record { get; set; }Property Value
Audio_Renderer_IsSync
Gets or sets a value indicating whether the audio renderer synchronizes to the pipeline clock. When false (default), audio buffers are rendered immediately for minimal latency. When true, the renderer waits for the pipeline clock for precise synchronization.
public bool Audio_Renderer_IsSync { get; set; }Property Value
Audio_Source
Gets or sets the audio source configuration for capture. This can be a microphone, system audio, or other audio input device.
public IVideoCaptureBaseAudioSourceSettings Audio_Source { get; set; }Property Value
Audio_VU_Meter_Enabled
Gets or sets a value indicating whether audio VU meter calculation is enabled. When true, OnAudioVUMeter events will be raised with audio level data.
public bool Audio_VU_Meter_Enabled { get; set; }Property Value
Barcode_Reader_Enabled
Gets or sets a value indicating whether barcode and QR code detection is enabled. When true, the video stream will be analyzed for barcodes and OnBarcodeDetected events will be raised.
public bool Barcode_Reader_Enabled { get; set; }Property Value
Debug_Dir
Gets or sets the directory where debug logs and pipeline graphs will be saved. Changing this property reconfigures the logger to use the new directory.
public string Debug_Dir { get; set; }Property Value
Debug_DisableMessageDialogs
Gets or sets a value indicating whether error message dialogs should be suppressed. When true, errors will not show dialog boxes even if OnError event is not handled.
public bool Debug_DisableMessageDialogs { get; set; }Property Value
Debug_Mode
Gets or sets a value indicating whether debug mode is enabled. When true, detailed logging, pipeline graphs, and diagnostic information will be generated.
public bool Debug_Mode { get; set; }Property Value
Debug_Telemetry
Gets or sets a value indicating whether anonymous telemetry is enabled during debugging. Telemetry helps improve the SDK by collecting anonymous usage and error data. Only active when debugging in Visual Studio.
public bool Debug_Telemetry { get; set; }Property Value
Remarks
Only anonymous data will be sent. No personal or sensitive information is collected.
Face_Detector
Gets or sets the face detector implementation for facial recognition in video frames. Configure this property with a face detector instance to enable face detection.
public IFaceDetector Face_Detector { get; set; }Property Value
Fonts
Gets a collection of available system fonts that can be used for text overlays. The collection is populated from the system's installed fonts.
public ObservableCollection<FontDescriptionX> Fonts { get; }Property Value
Motion_Detection
Gets or sets the motion detection settings for video analysis. Configure this property to enable and customize motion detection in the video stream.
public MotionDetectionExSettings Motion_Detection { get; set; }Property Value
PreEventRecording_Count
Gets the number of configured pre-event recording outputs.
public int PreEventRecording_Count { get; }Property Value
SDK_BuildDate
Gets the build date of the current SDK assembly. Useful for version tracking and support purposes.
public static DateTime SDK_BuildDate { get; }Property Value
SDK_Version
Gets the version number of the current SDK assembly. Use this to verify SDK compatibility and for support requests.
public static Version SDK_Version { get; }Property Value
Snapshot_Grabber_Enabled
Gets or sets a value indicating whether the snapshot grabber is enabled. Must be set to true before calling Start/StartAsync to enable snapshot functionality. When enabled, allows capturing still images from the video stream.
public bool Snapshot_Grabber_Enabled { get; set; }Property Value
State
Gets or sets the current playback state of the video capture engine. Indicates whether capture is playing, paused, stopped, or in other states.
public PlaybackState State { get; set; }Property Value
Subtitles_Enabled
Gets or sets a value indicating whether subtitle rendering is enabled. When true, subtitles from embedded streams or external files will be displayed.
public bool Subtitles_Enabled { get; set; }Property Value
Subtitles_ExternalFile
Gets or sets the URI of an external subtitle file to load. Supports common subtitle formats like SRT, SSA, and WebVTT.
public Uri Subtitles_ExternalFile { get; set; }Property Value
Subtitles_Settings
Gets or sets the subtitle overlay settings including font, color, and position. Configure this property to customize how subtitles are displayed on the video.
public SubtitleOverlaySettings Subtitles_Settings { get; set; }Property Value
Video_Composition_Enabled
Gets or sets a value indicating whether video composition features are enabled. When true, allows compositing multiple video sources or adding overlay elements.
public bool Video_Composition_Enabled { get; set; }Property Value
Video_Overlay_Enabled
Gets or sets a value indicating whether the video overlay manager is enabled. Must be set to true before calling Start/StartAsync methods to enable overlay functionality. When enabled, allows adding text, image, and shape overlays to the video stream.
public bool Video_Overlay_Enabled { get; set; }Property Value
Video_Play
Gets or sets a value indicating whether video preview/playback is enabled during capture. When true, captured video will be displayed in the configured video views.
public bool Video_Play { get; set; }Property Value
Video_Processors
Gets the list of custom video processors that will be applied to each video frame. Add custom IVideoProcessor implementations to perform frame-by-frame video analysis or modification.
public List<IVideoProcessor> Video_Processors { get; }Property Value
Video_Renderer_IsSync
Gets or sets a value indicating whether the video renderer synchronizes to the pipeline clock. When false (default), frames are rendered immediately for minimal latency — ideal for live camera preview. When true, the renderer waits for the pipeline clock, which adds latency but ensures precise A/V sync.
public bool Video_Renderer_IsSync { get; set; }Property Value
Video_Source
Gets or sets the video source configuration for capture. This can be a camera device, screen capture, IP camera, or other video source types.
public IVideoCaptureBaseVideoSourceSettings Video_Source { get; set; }Property Value
Video_Views
Gets the list of video view controls where captured video will be displayed. Add IVideoView implementations (UI controls) to enable video preview during capture.
public List<IVideoView> Video_Views { get; }Property Value
Methods
AudioOutputMuteSet(bool)
Sets the mute state of the audio output renderer without changing the volume level. When muted, audio playback is silenced while preserving the current volume setting for when unmuted.
public void AudioOutputMuteSet(bool value)Parameters
valuebool-
trueto mute audio playback;falseto unmute and restore audio at the current volume level.
Audio_Effects_AddOrUpdate(BaseAudioEffect)
Adds a new audio effect or updates an existing one in the audio processing chain by name. Effects are applied in real-time to the audio stream during capture. If an effect with the same name exists, it will be updated with the new settings. Otherwise, a new effect is added to the chain.
public void Audio_Effects_AddOrUpdate(BaseAudioEffect effect)Parameters
effectBaseAudioEffect-
The audio effect to add or update in the processing pipeline.
Audio_Effects_Clear()
Removes all audio effects from the audio processing chain, restoring unprocessed audio. Use this to reset audio processing to default state without individual effect removal.
public void Audio_Effects_Clear()Audio_Effects_Get(string)
Gets an audio effect by its name identifier from the audio effects chain. Use this to retrieve effect instances for inspection or modification of effect parameters.
public BaseAudioEffect Audio_Effects_Get(string effectName)Parameters
effectNamestring-
The name of the effect to retrieve from the processing chain.
Returns
- BaseAudioEffect
-
The audio effect instance if found by name; otherwise, null if no effect with that name exists.
Audio_Effects_Remove(BaseAudioEffect)
Removes a specific audio effect from the audio processing chain by instance reference. The capture is temporarily paused during removal to ensure smooth operation and prevent audio glitches. After removal, capture automatically resumes.
public void Audio_Effects_Remove(BaseAudioEffect effect)Parameters
effectBaseAudioEffect-
The audio effect instance to remove from the processing chain.
Audio_Effects_Remove(string)
Removes an audio effect by its name identifier from the audio processing chain. The capture is temporarily paused during removal to ensure smooth operation and prevent audio glitches. After removal, capture automatically resumes. If no effect with the specified name exists, no action is taken.
public void Audio_Effects_Remove(string name)Parameters
namestring-
The name of the audio effect to remove from the processing chain.
Audio_OutputsAsync(AudioOutputDeviceAPI?)
Asynchronously enumerates available audio output devices on the system for live audio monitoring. Includes speakers, headphones, HDMI audio, and other audio playback hardware. Can filter by specific audio API if multiple APIs are available on the platform.
public Task<AudioOutputDeviceInfo[]> Audio_OutputsAsync(AudioOutputDeviceAPI? api = null)Parameters
apiAudioOutputDeviceAPI?-
Optional: Specific audio API to enumerate devices from (DirectSound, WASAPI, CoreAudio, ALSA, etc.). Pass null to use the default system API.
Returns
- Task<AudioOutputDeviceInfo[]>
-
A task containing an array of VisioForge.Core.Types.X.Output.AudioOutputDeviceInfo for all available audio playback devices on the system.
Audio_Source_GetInfo(out int, out int, out AudioFormatX)
Gets detailed audio format information from the current audio source. Queries the audio source output pad for current audio capabilities including sample rate, channels, and format.
public bool Audio_Source_GetInfo(out int sampleRate, out int channels, out AudioFormatX format)Parameters
sampleRateint-
When this method returns, contains the audio sample rate in Hz, or 0 if unavailable.
channelsint-
When this method returns, contains the number of audio channels, or 0 if unavailable.
formatAudioFormatX-
When this method returns, contains the audio sample format, or VisioForge.Core.Types.X.AudioFormatX.Unknown if unavailable.
Returns
- bool
-
trueif audio information was successfully retrieved;falseif no audio source is active or information is unavailable.
Audio_SourcesAsync(AudioCaptureDeviceAPI?)
Asynchronously enumerates available audio capture devices on the system. Includes microphones, line-in devices, and other audio input hardware.
public Task<AudioCaptureDeviceInfo[]> Audio_SourcesAsync(AudioCaptureDeviceAPI? api = null)Parameters
apiAudioCaptureDeviceAPI?-
Optional: Specific audio API to enumerate devices from (DirectSound, WASAPI, etc.). Pass null to use default API.
Returns
- Task<AudioCaptureDeviceInfo[]>
-
A task containing an array of VisioForge.Core.Types.X.Sources.AudioCaptureDeviceInfo for all available audio input devices.
Debug_SavePipeline(string)
Saves the current media processing pipeline graph to a DOT file for debugging visualization. The DOT file can be converted to an image using Graphviz tools to inspect the pipeline structure. Only functional when VisioForge.Core.VideoCaptureX.VideoCaptureCoreX.Debug_Mode is enabled.
public void Debug_SavePipeline(string name)Parameters
namestring-
The name for the output DOT file (without extension).
Dispose(bool)
Releases unmanaged and optionally managed resources. Stops capture if active, closes pipeline resources, and disposes core components.
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. Call this method when done using the VisioForge.Core.VideoCaptureX.VideoCaptureCoreX instance to ensure proper cleanup.
public void Dispose()DisposeAsync()
Asynchronously releases resources used by the video capture engine. Implements the IAsyncDisposable pattern for async cleanup operations. Stops capture if active and properly releases all async resources.
public ValueTask DisposeAsync()Returns
Duration()
Gets the current capture duration since start. Returns the elapsed time of the current capture session.
public TimeSpan Duration()Returns
DurationAsync()
Asynchronously gets the current capture duration since start. Returns the elapsed time of the current capture session.
public Task<TimeSpan> DurationAsync()Returns
ExtendPreEventRecording(int)
Extends the post-event timer for a pre-event output. Call this when the trigger condition is still active (e.g., motion continues).
public void ExtendPreEventRecording(int preEventIndex)Parameters
preEventIndexint-
The zero-based index of the pre-event output.
~VideoCaptureCoreX()
Finalizer for the VisioForge.Core.VideoCaptureX.VideoCaptureCoreX class. Ensures resources are released if Dispose was not called explicitly.
protected ~VideoCaptureCoreX()GetContext()
Gets the current logging and media context.
public ContextX GetContext()Returns
- ContextX
-
The ContextX instance containing logger and media configuration.
GetDiagramAsImage(PipelineDiagramOptions)
Renders the current capture pipeline diagram as a raster image. When output pipelines are active, they are included below the main pipeline in a single vertically-stacked image with section headers.
In VisioForge.Core.MediaBlocks.Diagram.PipelineDiagramMode.HighLevel mode, only the logical
media block nodes and their connections are shown. This works at any time
after blocks have been added (even before StartAsync).
In VisioForge.Core.MediaBlocks.Diagram.PipelineDiagramMode.Detailed mode, every pad is labelled with its media type and, when available, the underlying GStreamer pad name.
public SKImage GetDiagramAsImage(PipelineDiagramOptions options = null)Parameters
optionsPipelineDiagramOptions-
Rendering options controlling mode, scale, spacing, colors, and orientation. Pass
nullto use defaults (HighLevel, scale 1.0, left-to-right).
Returns
- SKImage
-
An SkiaSharp.SKImage containing the rendered diagram, or
nullif no pipeline is active. The caller owns the image and must dispose it.
GetDiagramAsSvg(PipelineDiagramOptions)
Renders the current capture pipeline diagram as an SVG string. When output pipelines are active, they are included below the main pipeline in a single vertically-stacked SVG with section headers.
In VisioForge.Core.MediaBlocks.Diagram.PipelineDiagramMode.HighLevel mode, only the logical media block nodes and their connections are shown.
In VisioForge.Core.MediaBlocks.Diagram.PipelineDiagramMode.Detailed mode, every pad is labelled with its media type and GStreamer pad name when available.
public string GetDiagramAsSvg(PipelineDiagramOptions options = null)Parameters
optionsPipelineDiagramOptions-
Rendering options controlling mode, scale, spacing, colors, and orientation. Pass
nullto use defaults.
Returns
- string
-
A complete SVG document as a string, or
nullif no pipeline is active.
GetLogger()
Gets the current Serilog logger instance for this capture context.
public ILogger GetLogger()Returns
- ILogger
-
The ILogger instance used for logging.
GetMediaBlocksPipeline()
Gets the underlying MediaBlocksPipeline instance used by this capture session. Provides low-level access to the internal media pipeline for advanced customization and debugging.
public MediaBlocksPipeline GetMediaBlocksPipeline()Returns
- MediaBlocksPipeline
-
The current VisioForge.Core.MediaBlocks.MediaBlocksPipeline instance, or null if no capture session is active.
GetPreEventRecordingState(int)
Gets the current state of a pre-event output.
public PreEventRecordingState GetPreEventRecordingState(int preEventIndex)Parameters
preEventIndexint-
The zero-based index of the pre-event output.
Returns
- PreEventRecordingState
-
The current pre-event recording state.
GetSourceMixerControl()
Gets the video mixer control interface when using a VideoMixerSourceSettings as the video source. Allows dynamic control of video mixing parameters during capture.
public IVideoMixerControl GetSourceMixerControl()Returns
- IVideoMixerControl
-
The IVideoMixerControl interface if the source is a video mixer; otherwise, null.
IsCapturePaused(int)
Checks whether a specific output is currently paused. Use this to verify output state before attempting resume operations.
public bool IsCapturePaused(int index)Parameters
indexint-
The zero-based index of the output to check from the outputs collection.
Returns
- bool
-
trueif the output is in paused state;falseif playing, stopped, or index is invalid.
IsCaptureStarted(int)
Checks whether a specific output is currently recording or streaming (in playing state). Use this to monitor output status before attempting to pause, resume, or stop operations.
public bool IsCaptureStarted(int index)Parameters
indexint-
The zero-based index of the output to check from the outputs collection.
Returns
- bool
-
trueif the output is actively capturing (in playing state);falseif stopped, paused, or index is invalid.
IsPreEventRecording(int)
Checks if a pre-event output is currently recording.
public bool IsPreEventRecording(int preEventIndex)Parameters
preEventIndexint-
The zero-based index of the pre-event output.
Returns
- bool
-
trueif currently recording; otherwise,false.
MouseHighlight_AddClickEvent(int, int)
Manually adds a click event at the specified screen coordinates for the mouse highlight overlay. Use this method on platforms where global mouse hooks are not available, or to simulate click highlights programmatically. Requires VisioForge.Core.Types.X.Sources.IScreenCaptureSourceSettings.MouseHighlight to be set in the video source settings before starting.
public void MouseHighlight_AddClickEvent(int screenX, int screenY)Parameters
MouseHighlight_IsSubscribed()
Returns whether the mouse highlight hook is currently active and capturing mouse events.
public bool MouseHighlight_IsSubscribed()Returns
- bool
-
trueif subscribed to mouse events; otherwise,false.
MouseHighlight_Subscribe()
Subscribes to global mouse events for the mouse click highlight overlay. On Windows, this installs a global mouse hook that captures all mouse clicks. On other platforms, use VisioForge.Core.VideoCaptureX.VideoCaptureCoreX.MouseHighlight_AddClickEvent(System.Int32,System.Int32) to feed click events manually. Requires VisioForge.Core.Types.X.Sources.IScreenCaptureSourceSettings.MouseHighlight to be set in the video source settings before starting.
public void MouseHighlight_Subscribe()MouseHighlight_Unsubscribe()
Unsubscribes from global mouse events and disposes the mouse hook.
public void MouseHighlight_Unsubscribe()MouseHighlight_UpdateSettings()
Updates the mouse highlight settings on the underlying filter in real-time. Call this after modifying VisioForge.Core.Types.X.Sources.IScreenCaptureSourceSettings.MouseHighlight on the video source settings while the pipeline is running.
public void MouseHighlight_UpdateSettings()Outputs_Add(IVideoCaptureXBaseOutput, bool)
Adds a new output configuration to the capture engine for recording or streaming to a destination. Multiple outputs can be added to simultaneously record or stream to different destinations with independent settings. Each output operates in a separate pipeline branch with its own encoding and processing configuration.
public void Outputs_Add(IVideoCaptureXBaseOutput output, bool autostart = true)Parameters
outputIVideoCaptureXBaseOutput-
The output configuration defining the destination and encoding (file format, streaming destination, etc.).
autostartbool-
If set to
true, the output will start automatically when capture begins; iffalse, use StartCapture to manually start the output later.
Outputs_Clear()
Removes all output configurations from the collection. All outputs must be stopped before clearing. Use this to reset output configuration between capture sessions.
public void Outputs_Clear()Outputs_Count()
Gets the total number of configured outputs in the collection. This includes both active and inactive outputs.
public int Outputs_Count()Returns
- int
-
The count of outputs configured for this capture session.
Outputs_Get(int)
Gets the output configuration at the specified index in the collection. Use this to inspect or modify output settings before starting capture.
public IVideoCaptureXBaseOutput Outputs_Get(int index)Parameters
indexint-
The zero-based index of the output to retrieve from the collection.
Returns
- IVideoCaptureXBaseOutput
-
The output configuration at the specified index.
Outputs_GetDuration(int)
Gets the current recording or streaming duration for a specific output. Returns the time elapsed since the output started. For paused outputs, this returns the duration at the pause point.
public TimeSpan Outputs_GetDuration(int index)Parameters
indexint-
The zero-based index of the output to query from the outputs collection.
Returns
- TimeSpan
-
The current recording/streaming duration as TimeSpan, or Zero if unavailable, stopped, or index is invalid.
Outputs_Remove(IVideoCaptureXBaseOutput)
Removes the first occurrence of a specific output configuration from the collection. The output must be stopped before removal. If the output is not found, no action is taken.
public void Outputs_Remove(IVideoCaptureXBaseOutput output)Parameters
outputIVideoCaptureXBaseOutput-
The output configuration instance to remove from the collection.
Outputs_RemoveAt(int)
Removes an output configuration at the specified index from the outputs collection. The output must be stopped before removal. This does not affect other running outputs.
public void Outputs_RemoveAt(int index)Parameters
indexint-
The zero-based index of the output to remove from the collection.
Pause()
Pauses video capture while maintaining the pipeline state. Video/audio playback and recording are suspended but the pipeline remains ready to resume.
public bool Pause()Returns
- bool
-
trueif capture was paused successfully;falseif pause failed or pipeline is not active.
PauseAsync()
Asynchronously pauses video capture while maintaining the pipeline state. Video/audio playback and recording are suspended but the pipeline remains ready to resume.
public Task<bool> PauseAsync()Returns
PauseCapture(int)
Pauses recording or streaming for a specific output without closing the file or connection. The output can be resumed later without losing data continuity. Not all output types support pause (e.g., live streaming may not support pause).
public bool PauseCapture(int index)Parameters
indexint-
The zero-based index of the output to pause from the outputs collection.
Returns
- bool
-
trueif the capture was paused successfully;falseif pause is not supported, failed, or index is invalid.
PauseCaptureAsync(int)
Asynchronously pauses recording or streaming for a specific output without closing the file or connection. The output can be resumed later without losing data continuity. Not all output types support pause (e.g., live streaming may not support pause).
public Task<bool> PauseCaptureAsync(int index)Parameters
indexint-
The zero-based index of the output to pause from the outputs collection.
Returns
- Task<bool>
-
A task that returns true if the capture was paused successfully; otherwise, false if pause is not supported or failed.
Resume()
Resumes video capture after being paused. Restarts video/audio playback and recording from the paused state.
public bool Resume()Returns
- bool
-
trueif capture was resumed successfully;falseif resume failed or pipeline is not paused.
ResumeAsync()
Asynchronously resumes video capture after being paused. Restarts video/audio playback and recording from the paused state.
public Task<bool> ResumeAsync()Returns
ResumeCapture(int)
Resumes recording or streaming for a previously paused output. Continues the output from where it was paused, maintaining data continuity.
public bool ResumeCapture(int index)Parameters
indexint-
The zero-based index of the output to resume from the outputs collection.
Returns
- bool
-
trueif the capture was resumed successfully;falseif the output was not paused, resume failed, or index is invalid.
ResumeCaptureAsync(int)
Asynchronously resumes recording or streaming for a previously paused output. Continues the output from where it was paused, maintaining data continuity.
public Task<bool> ResumeCaptureAsync(int index)Parameters
indexint-
The zero-based index of the output to resume from the outputs collection.
Returns
- Task<bool>
-
A task that returns true if the capture was resumed successfully; otherwise, false if the output was not paused or resume failed.
SetCustomErrorHandler(IMediaBlocksPipelineCustomErrorHandler)
Sets a custom error handler for the MediaBlocks pipeline to provide specialized error handling logic. The custom handler will be called for specific pipeline errors that require specialized handling beyond the default error processing. Pass null to remove custom error handling and revert to default behavior.
public void SetCustomErrorHandler(IMediaBlocksPipelineCustomErrorHandler errorHandler)Parameters
errorHandlerIMediaBlocksPipelineCustomErrorHandler-
The custom error handler implementation, or null to remove custom handling and use default error processing.
SetLicenseCertificateAsync(byte[])
Sets the license certificate from raw byte data and performs activation if required.
public Task SetLicenseCertificateAsync(byte[] certificateData)Parameters
certificateDatabyte[]
Returns
Settings_Load(string)
Loads SDK settings from a JSON configuration file. Currently not implemented. Reserved for future functionality.
public bool Settings_Load(string jsonFilename)Parameters
jsonFilenamestring-
The path to the JSON settings file.
Returns
- bool
-
Always returns false in the current implementation.
Settings_Save(string, string)
Saves current SDK settings to JSON and info files. Creates or overwrites the specified files with SDK version and configuration information.
public bool Settings_Save(string jsonFilename, string infoFilename)Parameters
jsonFilenamestring-
The path for the JSON settings file.
infoFilenamestring-
The path for the SDK information text file. Pass null or empty string to skip info file creation.
Returns
- bool
-
trueif files were saved successfully;falseif save operation failed.
Snapshot_Get()
Captures a snapshot from the current video frame. Requires VisioForge.Core.VideoCaptureX.VideoCaptureCoreX.Snapshot_Grabber_Enabled to be true before starting capture. The caller is responsible for calling Free() on the returned VideoFrameX to release resources.
public VideoFrameX Snapshot_Get()Returns
- VideoFrameX
-
The captured frame as VisioForge.Core.Types.X.VideoFrameX, or null if snapshot grabber is not enabled.
Snapshot_GetAsync()
Asynchronously captures a snapshot from the current video frame. Requires VisioForge.Core.VideoCaptureX.VideoCaptureCoreX.Snapshot_Grabber_Enabled to be true before starting capture.
public Task<VideoFrameX> Snapshot_GetAsync()Returns
- Task<VideoFrameX>
-
A task containing the captured frame as VisioForge.Core.Types.X.VideoFrameX, or null if snapshot grabber is not enabled.
Snapshot_GetSK()
Captures a snapshot from the current video frame as a SkiaSharp bitmap. Requires VisioForge.Core.VideoCaptureX.VideoCaptureCoreX.Snapshot_Grabber_Enabled to be true before starting capture.
public SKBitmap Snapshot_GetSK()Returns
- SKBitmap
-
The captured frame as SkiaSharp.SKBitmap, or null if snapshot grabber is not enabled or format is unsupported. Caller must dispose the bitmap.
Snapshot_GetSKAsync()
Asynchronously captures a snapshot from the current video frame as a SkiaSharp bitmap. Requires VisioForge.Core.VideoCaptureX.VideoCaptureCoreX.Snapshot_Grabber_Enabled to be true before starting capture.
public Task<SKBitmap> Snapshot_GetSKAsync()Returns
- Task<SKBitmap>
-
A task containing the captured frame as SkiaSharp.SKBitmap, or null if snapshot grabber is not enabled. Caller must dispose the bitmap.
Snapshot_Save(string, SKEncodedImageFormat, int)
Captures and saves a snapshot from the current video frame to a file. Requires VisioForge.Core.VideoCaptureX.VideoCaptureCoreX.Snapshot_Grabber_Enabled to be true before starting capture.
public bool Snapshot_Save(string filename, SKEncodedImageFormat format, int quality = 85)Parameters
filenamestring-
The output file path for the snapshot image.
formatSKEncodedImageFormat-
The image format (JPEG, PNG, WebP, etc.).
qualityint-
The image quality from 0 (lowest) to 100 (highest). Default is 85.
Returns
- bool
-
trueif the snapshot was saved successfully;falseif save failed or snapshot grabber is not enabled.
Snapshot_SaveAsync(string, SKEncodedImageFormat, int)
Asynchronously captures and saves a snapshot from the current video frame to a file. Requires VisioForge.Core.VideoCaptureX.VideoCaptureCoreX.Snapshot_Grabber_Enabled to be true before starting capture.
public Task<bool> Snapshot_SaveAsync(string filename, SKEncodedImageFormat format, int quality = 85)Parameters
filenamestring-
The output file path for the snapshot image.
formatSKEncodedImageFormat-
The image format (JPEG, PNG, WebP, etc.).
qualityint-
The image quality from 0 (lowest) to 100 (highest). Default is 85.
Returns
Start()
Starts video capture with configured sources and outputs. Builds the media processing pipeline, initializes hardware devices, validates license, and begins capturing video/audio. This is a blocking call that waits for pipeline initialization. Use VisioForge.Core.VideoCaptureX.VideoCaptureCoreX.StartAsync for non-blocking operation.
public bool Start()Returns
- bool
-
trueif capture started successfully;falseif startup failed.
StartAsync()
Asynchronously starts video capture with configured sources and outputs. Builds the media processing pipeline, initializes hardware devices, validates license, and begins capturing video/audio.
public Task<bool> StartAsync()Returns
StartCapture(int, string)
Starts recording or streaming for a specific output with optional filename override. The output pipeline is started independently, allowing multiple outputs to start and stop at different times. Creates the output file or establishes the streaming connection.
public bool StartCapture(int index, string filename)Parameters
indexint-
The zero-based index of the output to start from the outputs collection.
filenamestring-
Optional: Override the configured filename or URL for this specific capture session. Pass null to use the configured value.
Returns
- bool
-
trueif the capture started successfully and the pipeline reached playing state;falseif start failed or index is invalid.
StartCaptureAsync(int, string)
Asynchronously starts recording or streaming for a specific output with optional filename override. The output pipeline is started independently, allowing multiple outputs to start and stop at different times.
public Task<bool> StartCaptureAsync(int index, string filename)Parameters
indexint-
The zero-based index of the output to start from the outputs collection.
filenamestring-
Optional: Override the configured filename or URL for this specific capture session. Pass null to use the configured value.
Returns
- Task<bool>
-
A task that returns true if the capture started successfully and the pipeline reached playing state; otherwise, false.
Stop()
Stops video capture, finalizes recordings, and releases all resources. Stops all active outputs, closes video/audio devices, and clears the pipeline. This is a blocking call. Use VisioForge.Core.VideoCaptureX.VideoCaptureCoreX.StopAsync for non-blocking operation.
public void Stop()StopAsync()
Asynchronously stops video capture, finalizes recordings, and releases all resources. Stops all active outputs, closes video/audio devices, and clears the pipeline.
public Task StopAsync()Returns
- Task
-
A task representing the asynchronous stop operation.
StopCapture(int)
Stops recording or streaming for a specific output, finalizing the file or closing the connection. For file outputs, this writes any buffered data, finalizes headers, and closes the file. For streaming outputs, this gracefully closes the connection.
public bool StopCapture(int index)Parameters
indexint-
The zero-based index of the output to stop from the outputs collection.
Returns
- bool
-
trueif the capture was stopped successfully and resources were released;falseif stop failed or index is invalid.
StopCaptureAsync(int)
Asynchronously stops recording or streaming for a specific output, finalizing the file or closing the connection. For file outputs, this writes any buffered data, finalizes headers, and closes the file. For streaming outputs, this gracefully closes the connection.
public Task<bool> StopCaptureAsync(int index)Parameters
indexint-
The zero-based index of the output to stop from the outputs collection.
Returns
- Task<bool>
-
A task that returns true if the capture was stopped successfully and resources were released; otherwise, false.
StopPreEventRecording(int)
Manually stops a pre-event recording and returns to buffering mode.
public void StopPreEventRecording(int preEventIndex)Parameters
preEventIndexint-
The zero-based index of the pre-event output.
Subtitles_Settings_Update()
Updates subtitle overlay settings for the video renderer. Call this method after modifying the VisioForge.Core.VideoCaptureX.VideoCaptureCoreX.Subtitles_Settings property to apply changes to the active renderer.
public void Subtitles_Settings_Update()TriggerPreEventRecording(int, string)
Triggers recording on a pre-event output. Flushes the pre-event buffer to the specified file and continues recording for the configured post-event duration.
public void TriggerPreEventRecording(int preEventIndex, string filename)Parameters
preEventIndexint-
The zero-based index of the pre-event output.
filenamestring-
The output filename for this recording.
TriggerPreEventRecordingAsync(int, string)
Asynchronously triggers recording on a pre-event output.
public Task TriggerPreEventRecordingAsync(int preEventIndex, string filename)Parameters
preEventIndexint-
The zero-based index of the pre-event output.
filenamestring-
The output filename for this recording.
Returns
- Task
-
A task representing the async operation.
VideoRenderer_GetVideoInfo()
Gets detailed video stream information from the active video renderer. Retrieves current video resolution, frame rate, pixel format, and other stream properties.
public VideoStreamInfo VideoRenderer_GetVideoInfo()Returns
- VideoStreamInfo
-
The VisioForge.Core.Types.MediaInfo.VideoStreamInfo for the first video renderer, or null if no renderer is active.
Video_Composition_Add(VideoCompositionElement)
Adds a video composition element to the video stream for overlay or composition effects. Elements can be images, videos, or other visual components that are composited onto the main video. Windows-specific feature that requires media buffer conversion from image data to GStreamer buffer format. Elements are rendered at specified positions with configurable alpha blending and z-order.
public void Video_Composition_Add(VideoCompositionElement element)Parameters
elementVideoCompositionElement-
The video composition element to add with position, size, and visual properties configured.
Video_Composition_Clear()
Removes all video composition elements from the video stream and releases all associated resources. Ensures proper disposal of all element resources by calling Video_Composition_Remove for each element. Use this to reset video composition to a clean state without individual element removal.
public void Video_Composition_Clear()Video_Composition_Remove(VideoCompositionElement)
Removes a video composition element from the video stream and releases associated resources. Properly disposes of the associated GStreamer media buffer to prevent memory leaks. The element is removed from the composition manager's collection.
public void Video_Composition_Remove(VideoCompositionElement element)Parameters
elementVideoCompositionElement-
The video composition element instance to remove from the stream.
Video_Effects_AddOrUpdateAsync(IBaseVideoEffect)
Asynchronously adds a new video effect or updates an existing one in the video processing chain. Effects are applied in real-time to the video stream during capture. If an effect with the same name exists, it will be updated with the new settings. Otherwise, a new effect is added to the processing pipeline.
public Task Video_Effects_AddOrUpdateAsync(IBaseVideoEffect effect)Parameters
effectIBaseVideoEffect-
The video effect to add or update in the processing pipeline.
Returns
- Task
-
A Task representing the asynchronous add/update operation.
Video_Effects_Clear()
Removes all video effects from the video processing chain, restoring unprocessed video. Note: If ResizeVideoEffect is present and the pipeline is running, the clear operation will be blocked to prevent resolution mismatch issues. Stop the pipeline first before clearing effects if resize effects are in use. Use this to reset video processing to default state without individual effect removal.
public void Video_Effects_Clear()Video_Effects_Get(string)
Gets a video effect by its name identifier from the video effects chain. Use this to retrieve effect instances for inspection or modification of effect parameters.
public IBaseVideoEffect Video_Effects_Get(string effectName)Parameters
effectNamestring-
The name of the effect to retrieve from the processing chain.
Returns
- IBaseVideoEffect
-
The video effect instance if found by name; otherwise, null if no effect with that name exists.
Video_Effects_Remove(IBaseVideoEffect)
Removes a specific video effect from the video processing chain by instance reference. The capture is temporarily paused during removal to ensure smooth operation and prevent visual glitches. After removal, capture automatically resumes. Note: ResizeVideoEffect cannot be removed when pipeline is started as it affects the bridge configuration. Remove it before starting or after stopping the pipeline to prevent resolution mismatch issues.
public void Video_Effects_Remove(IBaseVideoEffect effect)Parameters
effectIBaseVideoEffect-
The video effect instance to remove from the processing chain.
Video_Effects_Remove(string)
Removes a video effect by its name identifier from the video processing chain. The capture is temporarily paused during removal to ensure smooth operation and prevent visual glitches. After removal, capture automatically resumes. If no effect with the specified name exists, no action is taken. Note: ResizeVideoEffect cannot be removed when pipeline is started as it affects the bridge configuration. Remove it before starting or after stopping the pipeline to prevent resolution mismatch issues.
public void Video_Effects_Remove(string name)Parameters
namestring-
The name of the video effect to remove from the processing chain.
Video_Overlay_Add(IOverlayManagerElement)
Adds a new overlay element to the video stream for on-screen graphics and information display. The overlay will be rendered on top of the video according to its position, z-order, and properties. Supports text overlays (with custom fonts and colors), image overlays, and shape overlays.
public void Video_Overlay_Add(IOverlayManagerElement overlay)Parameters
overlayIOverlayManagerElement-
The overlay element to add (text, image, or shape) with position and appearance configured.
Video_Overlay_Clear()
Removes all overlay elements from the video stream, restoring clean video without overlays. Use this to reset overlay rendering to a clean state without individual overlay removal.
public void Video_Overlay_Clear()Video_Overlay_Remove(IOverlayManagerElement)
Removes a specific overlay element from the video stream by instance reference. The overlay will no longer be rendered on the video after removal.
public void Video_Overlay_Remove(IOverlayManagerElement overlay)Parameters
overlayIOverlayManagerElement-
The overlay element instance to remove from the video stream.
Video_Overlay_RemoveAt(int)
Removes an overlay element at the specified index in the overlay collection. The overlay will no longer be rendered on the video after removal.
public void Video_Overlay_RemoveAt(int index)Parameters
indexint-
The zero-based index of the overlay to remove from the collection.
Video_Overlay_Update(IOverlayManagerElement)
Updates an existing overlay element by removing and re-adding it with modified properties. Use this method after modifying overlay properties (position, text, color, etc.) to apply changes to the rendered output. This ensures the overlay rendering reflects the updated configuration.
public void Video_Overlay_Update(IOverlayManagerElement overlay)Parameters
overlayIOverlayManagerElement-
The overlay element with updated properties to re-render on the video stream.
Video_Source_GetResolutionAndFrameRate(out VideoFrameRate)
Gets the current video resolution and frame rate from the active video source. Queries the video source output pad for current video format capabilities.
public Size Video_Source_GetResolutionAndFrameRate(out VideoFrameRate frameRate)Parameters
frameRateVideoFrameRate-
When this method returns, contains the video frame rate in fps, or VisioForge.Core.Types.VideoFrameRate.Empty if unavailable.
Returns
- Size
-
The video resolution as a VisioForge.Core.Types.Size structure, or VisioForge.Core.Types.Size.Empty if unavailable or no video source is active.
Video_SourcesAsync()
Asynchronously enumerates available video capture devices on the system. Includes webcams, capture cards, virtual cameras, and other video input hardware.
public Task<VideoCaptureDeviceInfo[]> Video_SourcesAsync()Returns
- Task<VideoCaptureDeviceInfo[]>
-
A task containing an array of VisioForge.Core.Types.X.Sources.VideoCaptureDeviceInfo for all available video input devices.
WaitForStartAsync()
Asynchronously waits for the capture pipeline to reach the playing state. Polls the pipeline state until playing is reached or the pipeline becomes null.
public Task WaitForStartAsync()Returns
- Task
-
A task that completes when the pipeline is playing or stopped.
OnAudioFrameBuffer
Occurs whenever a new audio frame is received from the audio capture source. This event provides raw audio data for custom processing or analysis.
public event EventHandler<AudioFrameBufferEventArgs> OnAudioFrameBufferEvent Type
OnAudioVUMeter
Occurs whenever new audio VU meter data is received, providing audio level information. This event is useful for displaying audio level indicators in the user interface.
public event EventHandler<VUMeterXEventArgs> OnAudioVUMeterEvent Type
OnBarcodeDetected
Occurs when a barcode or QR code is detected in the video stream. Event args contain the decoded barcode data and barcode type information.
public event EventHandler<BarcodeDetectorEventArgs> OnBarcodeDetectedEvent Type
OnError
Occurs whenever an error happens during video capture operations. Subscribe to this event to handle and log capture-related errors.
public event EventHandler<ErrorsEventArgs> OnErrorEvent Type
OnFaceDetected
Occurs whenever faces are detected in a video frame during capture. This event provides face detection results including face locations and attributes.
public event EventHandler<AFFaceDetectionEventArgs> OnFaceDetectedEvent Type
OnLicenseRequired
Occurs when a license is required for using specific features or when the trial period expires. Handle this event to provide license information or notify users about licensing requirements.
public event EventHandler<LicenseEventArgs> OnLicenseRequiredEvent Type
OnMotionDetection
Occurs when motion is detected in the video stream based on configured motion detection settings. Event args contain detailed motion data including affected regions and motion levels.
public event EventHandler<MotionDetectionExEventArgs> OnMotionDetectionEvent Type
OnMouseClick
Occurs when a mouse button is clicked while the mouse highlight overlay is active. Provides screen coordinates of the click. Fires automatically when VisioForge.Core.Types.X.Sources.IScreenCaptureSourceSettings.MouseHighlight is configured, as the mouse hook is auto-subscribed on start.
public event EventHandler<MouseClickEventArgs> OnMouseClickEvent Type
OnOutputPaused
Occurs when a capture output (recording or streaming) is paused. The event argument contains the index of the output that was paused.
public event EventHandler<int> OnOutputPausedEvent Type
OnOutputResumed
Occurs when a capture output (recording or streaming) resumes after being paused. The event argument contains the index of the output that resumed.
public event EventHandler<int> OnOutputResumedEvent Type
OnOutputStarted
Occurs when a capture output (recording or streaming) starts successfully. The event argument contains the index of the output that started.
public event EventHandler<int> OnOutputStartedEvent Type
OnOutputStopped
Occurs when a capture output (recording or streaming) stops. The event argument contains the index of the output that stopped.
public event EventHandler<int> OnOutputStoppedEvent Type
OnPause
Occurs when video capture or playback is paused. Use this event to update UI state when capture is temporarily suspended.
public event EventHandler<EventArgs> OnPauseEvent Type
OnPreEventRecordingStarted
Occurs when a pre-event recording starts (buffer flushed to file).
public event EventHandler<PreEventRecordingEventArgs> OnPreEventRecordingStartedEvent Type
OnPreEventRecordingStopped
Occurs when a pre-event recording stops (post-event timer expired or manual stop).
public event EventHandler<PreEventRecordingEventArgs> OnPreEventRecordingStoppedEvent Type
OnResume
Occurs when video capture or playback resumes after being paused. Use this event to restore UI state when capture continues.
public event EventHandler<EventArgs> OnResumeEvent Type
OnStart
Occurs when video capture or playback starts successfully. Use this event to update UI or perform initialization after capture begins.
public event EventHandler<EventArgs> OnStartEvent Type
OnStop
Occurs when video capture or playback stops completely. This event provides the final position and allows for cleanup operations.
public event EventHandler<StopEventArgs> OnStopEvent Type
OnVideoFrameBuffer
Occurs whenever a new video frame is received in RGBA format from the video capture source. This event provides raw video frame data for custom processing or analysis.
public event EventHandler<VideoFrameXBufferEventArgs> OnVideoFrameBufferEvent Type
OnVideoFrameSKBitmap
Occurs whenever a new video frame is received and converted to SkiaSharp SKBitmap format. This event is useful for cross-platform image processing using SkiaSharp.
public event EventHandler<VideoFrameSKBitmapEventArgs> OnVideoFrameSKBitmap