Class KLVFileSinkBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sinks
- Assembly
- VisioForge.Core.dll
Implements a sink block for writing KLV (Key-Length-Value) metadata to files. Supports MISB standards for metadata encoding used in surveillance and aerospace applications.
public class KLVFileSinkBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Remarks
The KLVFileSinkBlock specializes in handling KLV-encoded metadata streams, which are widely used in defense, surveillance, and aerospace industries. Key features: - MISB (Motion Imagery Standards Board) compliant metadata handling - STANAG 4609 compatible encoding - Synchronous metadata storage with video streams - Support for various KLV data types and structures
KLV metadata typically includes: - GPS coordinates and altitude - Camera orientation (pan, tilt, roll) - Platform information (aircraft, drone, vehicle) - Timestamp and synchronization data - Target tracking information - Environmental data (weather, visibility)
Common use cases: - UAV/Drone video metadata recording - Surveillance system metadata storage - Military and defense applications - Geospatial video indexing - Compliance with government standards
The sink writes raw KLV data that can be multiplexed with video or stored separately for later synchronization.
Constructors
KLVFileSinkBlock(string)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.KLVFileSinkBlock class.
public KLVFileSinkBlock(string filename)Parameters
filenamestring-
The full path to the output file for KLV metadata storage.
Remarks
The output file will contain MISB-compliant KLV metadata packets. Ensure the directory exists and is writable before starting the pipeline.
Exceptions
- ArgumentNullException
-
Thrown when
filenameisnullor empty.
Properties
Filename
Gets or sets the output filename for KLV metadata storage.
public string Filename { get; set; }Property Value
Remarks
The file will contain raw KLV packets that can be parsed by KLV-aware applications or multiplexed with corresponding video streams.
Input
Gets the first 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
Type
Gets the type.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds this instance.
public override bool Build()Returns
- bool
-
trueif successfull,falseotherwise.
CleanUp()
Performs cleanup of resources used by the KLV file sink.
public void CleanUp()Remarks
This method ensures all KLV packets are written to disk, closes the file, and releases the underlying GStreamer element.
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 core.
public BaseElement GetCore()Returns
- BaseElement
-
VisioForge.Core.GStreamer.Base.BaseElement.
GetElement()
Gets the element.
public Element GetElement()Returns
- Element
-
Gst.Element.
GetFilenameOrURL()
Gets the output filename for KLV metadata storage.
public string GetFilenameOrURL()Returns
- string
-
The full path to the KLV output file.
IsAvailable()
Determines whether KLV file sink functionality is available on the current platform.
public static bool IsAvailable()Returns
- bool
-
trueif KLV sink is available; otherwise,false. Requires specialized KLV handling plugins.
Remarks
KLV support requires specific GStreamer plugins that may not be available in standard distributions. Professional or specialized builds may be required.
SetFilenameOrURL(string)
Sets the output filename for KLV metadata storage.
public void SetFilenameOrURL(string value)Parameters
valuestring-
The full path where the KLV file should be written.
Remarks
Changing the filename after the pipeline has started may not take effect until the pipeline is restarted.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The pipeline.