Class MPEG12VideoParseBlock
- Namespace
- VisioForge.Core.MediaBlocks.Parsers
- Assembly
- VisioForge.Core.dll
Parses MPEG-1 and MPEG-2 video elementary streams for picture boundary detection and header analysis.
public class MPEG12VideoParseBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Remarks
The MPEG12VideoParseBlock processes MPEG-1 and MPEG-2 video elementary streams, identifying picture start codes, extracting sequence and picture headers, and ensuring proper GOP (Group of Pictures) alignment. These formats are foundational video compression standards used in DVD, digital TV broadcasting, and legacy video systems.
Key features: - Start code detection and validation (picture, sequence, GOP) - Sequence header parsing (resolution, frame rate, aspect ratio) - Picture header analysis (I, P, B frame types) - GOP structure identification and temporal reference - Extension header parsing for MPEG-2 features - Progressive and interlaced content handling - Closed caption data extraction when present
Common use cases: - DVD playback: Processing MPEG-2 video from DVD sources - Broadcasting: Handling MPEG-2 streams from DVB/ATSC systems - Legacy conversion: Transcoding MPEG-1/2 to modern formats - Video analysis: Extracting GOP structure and frame types - Muxing: Preparing elementary streams for program streams or transport streams
The parser supports various MPEG-2 profiles and levels including Main Profile @ Main Level (MP@ML) for SD content and Main Profile @ High Level (MP@HL) for HD content. It handles both MPEG-1 constrained parameters and full MPEG-2 feature sets.
Constructors
MPEG12VideoParseBlock()
Initializes a new instance of the VisioForge.Core.MediaBlocks.Parsers.MPEG12VideoParseBlock class.
public MPEG12VideoParseBlock()Remarks
Creates input and output pads configured for video media type. The parser will automatically detect MPEG-1 or MPEG-2 format based on the stream headers and handle progressive or interlaced content appropriately.
Properties
Input
Gets the primary input pad for receiving MPEG-1/2 video elementary stream data.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads available on this block.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary output pad that provides parsed MPEG video pictures.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block.
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the type of this media block.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the MPEG-1/2 video parser element within the media pipeline.
public override bool Build()Returns
- bool
-
trueif the parser was successfully created and configured;falseif initialization failed or required plugins are missing.
Remarks
This method creates the GStreamer MPEG video parser element, initializes it within the pipeline context, and connects the input/output pads. The parser will begin processing data once the pipeline transitions to the playing state.
CleanUp()
Performs cleanup of the parser resources and resets the build state.
public void CleanUp()Remarks
This method disposes of the GStreamer element and resets internal state. It is called during disposal to ensure proper resource 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 GStreamer element wrapper.
public BaseElement GetCore()Returns
- BaseElement
-
The base element wrapper providing access to common GStreamer functionality.
GetElement()
Gets the underlying native GStreamer element.
public Element GetElement()Returns
- Element
-
The native GStreamer element instance used for MPEG-1/2 video parsing.
IsAvailable()
Determines whether the MPEG-1/2 video parser is available in the current GStreamer installation.
public static bool IsAvailable()Returns
- bool
-
trueif the MPEG video parser plugin is available; otherwise,false. This requires the GStreamer base plugins to be installed.
Remarks
The MPEG-1/2 video parser is provided by the GStreamer base plugins collection. Ensure the appropriate VisioForge SDK redistribution package is included in your project.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the media pipeline context for this block.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The media pipeline that will contain this parser block.