Table of Contents

Class WMVOutputBlock

Namespace
VisioForge.Core.MediaBlocks.Sinks
Assembly
VisioForge.Core.dll

WMV output block for creating Windows Media Video files with integrated WMV video and WMA audio encoding. This block provides comprehensive Windows Media Format support, combining Microsoft's proprietary video and audio codecs in an ASF container. WMV offers excellent compression efficiency and is widely supported on Windows platforms, making it ideal for Windows-centric workflows, corporate environments, and legacy system compatibility.

Key features:

  • WMV video compression (VC-1 codec) with multiple profiles
  • WMA audio compression with various quality levels
  • ASF container with rich metadata support
  • DRM (Digital Rights Management) capability
  • Variable bitrate (VBR) and constant bitrate (CBR) encoding
  • Multiple video profiles (Simple, Main, Advanced)
  • Support for HD content up to 1080p

Common use cases:

  • Windows Media Player content distribution
  • Corporate video presentations and training
  • Silverlight streaming applications
  • Xbox and Windows device playback
  • Legacy Windows media workflows
  • Protected content distribution with DRM

While newer formats like H.264/MP4 have largely superseded WMV, it remains valuable for Windows-specific applications and legacy system compatibility where Windows Media support is guaranteed. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class WMVOutputBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IMediaBlockDynamicInputs

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

WMVOutputBlock(string)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.WMVOutputBlock class with default settings. Creates a WMV output configured with standard quality settings suitable for general-purpose Windows Media content creation.

public WMVOutputBlock(string filename)

Parameters

filename string

The output file path for the WMV file.

WMVOutputBlock(string, MediaFileTags)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.WMVOutputBlock class with default settings and metadata tags. Creates a WMV output configured with standard quality settings suitable for general-purpose Windows Media content creation with tag support.

public WMVOutputBlock(string filename, MediaFileTags tags)

Parameters

filename string

The output file path for the WMV file.

tags MediaFileTags

The metadata tags to be written to the WMV file, including title, artist, album, and other information.

WMVOutputBlock(ASFSinkSettings, WMVEncoderSettings, WMAEncoderSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.WMVOutputBlock class with custom encoder settings. Provides full control over video and audio compression parameters for professional Windows Media content creation.

public WMVOutputBlock(ASFSinkSettings sinkSettings, WMVEncoderSettings videoSettings, WMAEncoderSettings audioSettings)

Parameters

sinkSettings ASFSinkSettings

The ASF container settings including output file path and metadata.

videoSettings WMVEncoderSettings

The WMV video encoder settings defining quality and compression parameters.

audioSettings WMAEncoderSettings

The WMA audio encoder settings controlling audio compression.

WMVOutputBlock(ASFSinkSettings, WMVEncoderSettings, WMAEncoderSettings, MediaFileTags)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.WMVOutputBlock class with custom encoder settings and metadata tags. Provides full control over video and audio compression parameters for professional Windows Media content creation with tag support.

public WMVOutputBlock(ASFSinkSettings sinkSettings, WMVEncoderSettings videoSettings, WMAEncoderSettings audioSettings, MediaFileTags tags)

Parameters

sinkSettings ASFSinkSettings

The ASF container settings including output file path and metadata.

videoSettings WMVEncoderSettings

The WMV video encoder settings defining quality and compression parameters.

audioSettings WMAEncoderSettings

The WMA audio encoder settings controlling audio compression.

tags MediaFileTags

The metadata tags to be written to the WMV file, including title, artist, album, and other information.

Properties

Input

Gets the primary input pad for receiving media streams.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads available on this block.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the output pad. Always null for file output blocks.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads. Empty for file output blocks.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Tags

Gets or sets the metadata tags to be written to the WMV/ASF file. These tags include information such as title, artist, album, year, and other media metadata. Tags can be set before building the pipeline and will be applied during the encoding process.

public MediaFileTags Tags { get; set; }

Property Value

MediaFileTags

Type

Gets the block type identifier for the WMV output.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the WMV output pipeline. Creates the ASF sink, WMV video encoder, and WMA audio encoder, then connects them to form a complete Windows Media encoding pipeline with metadata tags.

public override bool Build()

Returns

bool

true if the output pipeline was successfully built; false if initialization failed.

CleanUp()

Performs cleanup of all resources associated with the WMV output. Disposes the ASF sink, video encoder, and audio encoder.

public void CleanUp()

CreateNewInput(MediaBlockPadMediaType)

Creates a new input pad for the specified media type. Enables dynamic addition of video and audio streams to the WMV output.

public MediaBlockPad CreateNewInput(MediaBlockPadMediaType mediaType)

Parameters

mediaType MediaBlockPadMediaType

The type of media (Video or Audio) for the new input pad.

Returns

MediaBlockPad

A new MediaBlockPad configured for the specified media type.

Dispose(bool)

Releases unmanaged and - optionally - managed resources. Ensures proper cleanup of encoders, muxer, and file resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetCore()

Gets the core GStreamer element. Not applicable for composite blocks.

public BaseElement GetCore()

Returns

BaseElement

Always null for composite output blocks with multiple elements.

GetElement()

Gets the underlying GStreamer element. Not applicable for composite blocks.

public Element GetElement()

Returns

Element

Always null for composite output blocks with multiple elements.

GetFilenameOrURL()

Gets the current output filename where the WMV content is being written.

public string GetFilenameOrURL()

Returns

string

The file path for the WMV output.

GetInput(MediaBlockPadMediaType)

Gets an existing input pad for the specified media type.

public MediaBlockPad GetInput(MediaBlockPadMediaType mediaType)

Parameters

mediaType MediaBlockPadMediaType

The type of media (Video or Audio) to search for.

Returns

MediaBlockPad

The first matching MediaBlockPad for the specified media type, or null if not found.

IsAvailable()

Determines whether WMV output functionality is available on the current system. Requires the GStreamer ASF muxer and Windows Media encoders to be installed.

public static bool IsAvailable()

Returns

bool

true if WMV encoding is supported; otherwise, false.

SetFilenameOrURL(string)

Sets a new output filename for the WMV file. Allows changing the output destination during pipeline operation.

public void SetFilenameOrURL(string value)

Parameters

value string

The new file path for WMV output.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the media pipeline context for this output block.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent media pipeline containing this block.

See Also