Class VPXEncoderBlock
- Assembly
- VisioForge.Core.dll
VPX encoder block for VP8/VP9 open-source video compression optimized for web streaming. This block provides comprehensive VP8 and VP9 encoding capabilities using Google's WebM codec family. VP9 offers significantly improved compression efficiency over VP8 and comparable quality to H.265 while remaining royalty-free. Features adaptive bitrate control, temporal layering, and optimized encoding for web delivery. Essential for YouTube, WebRTC, streaming platforms, and applications requiring high-quality, royalty-free video compression for web distribution. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class VPXEncoderBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
VPXEncoderBlock(IVPXEncoderSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.VideoEncoders.VPXEncoderBlock class with specified VPX encoder settings.
public VPXEncoderBlock(IVPXEncoderSettings settings)Parameters
settingsIVPXEncoderSettings-
The VPX encoder configuration settings.
Properties
Input
Gets the input.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets the inputs.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets the outputs.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the VPX encoder settings. Contains comprehensive configuration parameters for VP8/VP9 encoding including codec selection, quality control, rate control, and web optimization settings.
public IVPXEncoderSettings Settings { get; set; }Property Value
Type
Gets the type.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Constructs and initializes the VPX encoder and its associated GStreamer elements. This method creates the encoder with the specified settings, establishes input and output pads, and prepares the block for royalty-free video compression optimized for web streaming.
public override bool Build()Returns
- bool
-
trueif the encoder was successfully built and configured;falseif initialization failed.
CleanUp()
Releases all resources and performs cleanup operations for this VPX encoder block. This method disposes of the GStreamer elements and resets the build state.
public void CleanUp()Dispose(bool)
Releases unmanaged and - optionally - managed 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 BaseElement wrapper that provides additional functionality around the GStreamer VPX encoder element.
public BaseElement GetCore()Returns
- BaseElement
-
The BaseElement wrapper instance that encapsulates the GStreamer VPX encoder.
GetElement()
Gets the underlying GStreamer element that performs the VP8/VP9 video encoding.
public Element GetElement()Returns
- Element
-
The GStreamer Element instance representing the VPX encoder.
IsAvailable(IVPXEncoderSettings)
Determines whether VPX encoding is available with the specified settings. Checks for required VP8/VP9 codec libraries and validates codec selection.
public static bool IsAvailable(IVPXEncoderSettings settings)Parameters
settingsIVPXEncoderSettings-
The VPX encoder settings to validate.
Returns
- bool
-
trueif VPX encoding is available; otherwise,false.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Associates this VPX encoder block with a pipeline and initializes its internal context. This method is called internally when the block is added to a pipeline.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The MediaBlocksPipeline instance that will manage this block.