Class AVIOutputBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sinks
- Assembly
- VisioForge.Core.dll
AVI multimedia container output block for creating AVI video files with integrated encoding and file writing capabilities. Provides comprehensive AVI file creation with configurable video and audio encoders, supporting H.264/AAC and H.264/MP3 combinations for professional video production, archival storage, and multimedia content creation with industry-standard AVI container format. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class AVIOutputBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IMediaBlockDynamicInputsInheritance
Implements
Inherited Members
Extension Methods
Constructors
AVIOutputBlock(string)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.AVIOutputBlock class with default H.264 and AAC encoders. Creates an AVI output block configured for high-quality video production with industry-standard codecs.
public AVIOutputBlock(string filename)Parameters
filenamestring-
The output AVI file path where the encoded multimedia content will be written.
AVIOutputBlock(AVISinkSettings, IH264EncoderSettings, IAACEncoderSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.AVIOutputBlock class with custom H.264 and AAC encoder settings. Provides full control over video and audio compression parameters for professional AVI file creation.
public AVIOutputBlock(AVISinkSettings sinkSettings, IH264EncoderSettings h264settings, IAACEncoderSettings aacSettings)Parameters
sinkSettingsAVISinkSettings-
The AVI container sink settings defining output file configuration.
h264settingsIH264EncoderSettings-
The H.264 video encoder settings controlling video compression quality and parameters.
aacSettingsIAACEncoderSettings-
The AAC audio encoder settings controlling audio compression quality and parameters.
AVIOutputBlock(AVISinkSettings, IH264EncoderSettings, MP3EncoderSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.AVIOutputBlock class with H.264 video and MP3 audio encoders. Provides widely compatible AVI output with H.264 video compression and MP3 audio for broad device support.
public AVIOutputBlock(AVISinkSettings sinkSettings, IH264EncoderSettings h264settings, MP3EncoderSettings mp3Settings)Parameters
sinkSettingsAVISinkSettings-
The AVI container sink settings defining output file configuration.
h264settingsIH264EncoderSettings-
The H.264 video encoder settings controlling video compression quality and parameters.
mp3SettingsMP3EncoderSettings-
The MP3 audio encoder settings controlling audio compression quality and parameters.
Properties
Input
Gets the primary input pad (first in the collection of dynamic inputs).
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads available on this block (dynamic collection for video and audio).
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary output pad (none for output blocks that write to files).
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (none for output blocks).
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the media block type identifier for AVI output operations.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the AVI output block within the pipeline context. Creates the AVI sink, video and audio encoders, and establishes all necessary connections for encoding and writing multimedia content to the AVI file.
public override bool Build()Returns
- bool
-
trueif the AVI output block was successfully built and configured; otherwise,false.
CleanUp()
Cleans up all resources associated with the AVI output operations, including encoders, sink, and file handles.
public void CleanUp()CreateNewInput(MediaBlockPadMediaType)
Creates a new input pad for the specified media type, enabling dynamic addition of video and audio streams.
public MediaBlockPad CreateNewInput(MediaBlockPadMediaType mediaType)Parameters
mediaTypeMediaBlockPadMediaType-
The type of media (Video, Audio, or Subtitle) for the new input pad.
Returns
- MediaBlockPad
-
A new MediaBlockPad configured for the specified media type.
Dispose(bool)
Releases unmanaged and managed resources used by the AVI output block. Properly disposes of GStreamer elements, encoders, and file writing resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
GetCore()
Gets the core GStreamer element wrapper for advanced configuration and monitoring.
public BaseElement GetCore()Returns
- BaseElement
-
Always null for composite output blocks with multiple internal elements.
GetElement()
Gets the native GStreamer element for direct GStreamer pipeline integration.
public Element GetElement()Returns
- Element
-
Always null for composite output blocks with multiple internal elements.
GetFilenameOrURL()
Gets the current output filename or URL where the AVI content is being written.
public string GetFilenameOrURL()Returns
- string
-
The file path or URL string for the AVI output destination.
GetInput(MediaBlockPadMediaType)
Retrieves an existing input pad for the specified media type from the current collection.
public MediaBlockPad GetInput(MediaBlockPadMediaType mediaType)Parameters
mediaTypeMediaBlockPadMediaType-
The type of media (Video, Audio, or Subtitle) to search for.
Returns
- MediaBlockPad
-
The first matching MediaBlockPad for the specified media type, or null if not found.
IsAvailable(IH264EncoderSettings, IAACEncoderSettings)
Determines whether AVI output functionality is available on the current system with the specified encoder settings. Requires GStreamer AVI muxer and the specified video and audio encoder plugins to be installed and functional.
public static bool IsAvailable(IH264EncoderSettings h264settings, IAACEncoderSettings aacSettings)Parameters
h264settingsIH264EncoderSettings-
The H.264 video encoder settings to validate for availability.
aacSettingsIAACEncoderSettings-
The AAC audio encoder settings to validate for availability.
Returns
- bool
-
trueif AVI output with the specified encoders is supported; otherwise,false.
SetFilenameOrURL(string)
Updates the output filename or URL for the AVI file destination, allowing dynamic output redirection.
public void SetFilenameOrURL(string value)Parameters
valuestring-
The new file path or URL where AVI content should be written.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this AVI output block, providing access to the parent pipeline and logging context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocks pipeline containing this AVI output block.