Table of Contents

Class TheoraEncoderBlock

Namespace
VisioForge.Core.MediaBlocks.VideoEncoders
Assembly
VisioForge.Core.dll

Theora encoder block for open-source video compression designed for web streaming and multimedia applications. This block provides Theora video encoding capabilities, part of the Xiph.Org Foundation's patent-free multimedia suite. Theora offers competitive compression efficiency with royalty-free licensing, making it ideal for open-source projects, educational content, and applications requiring unrestricted codec usage.

Key features:

  • Patent-free and royalty-free compression
  • Variable bitrate (VBR) and constant bitrate (CBR) modes
  • Temporal and spatial scalability
  • Alpha channel support for transparency
  • Adaptive quantization for optimal quality
  • Two-pass encoding for efficiency
  • Web-friendly streaming capabilities

Common use cases:

  • Open-source video platforms and applications
  • Educational and academic content distribution
  • Web-based video streaming (OGV format)
  • Embedded systems with licensing constraints
  • Non-commercial video applications
  • HTML5 video with OGG container
  • Cross-platform multimedia solutions

While newer codecs like VP8/VP9 and AV1 have largely superseded Theora for new applications, it remains valuable for legacy compatibility and environments where patent-free codecs are required. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class TheoraEncoderBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

TheoraEncoderBlock(TheoraEncoderSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.VideoEncoders.TheoraEncoderBlock class. Creates a Theora encoder configured for open-source video compression with specified quality settings.

public TheoraEncoderBlock(TheoraEncoderSettings settings)

Parameters

settings TheoraEncoderSettings

The Theora encoder settings defining compression quality, bitrate, and optimization parameters.

Properties

Input

Gets the primary input pad for receiving raw video frames.

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 primary output pad for Theora-encoded video stream.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads available on this block.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the Theora encoder settings controlling compression quality and bitrate.

public TheoraEncoderSettings Settings { get; set; }

Property Value

TheoraEncoderSettings

Type

Gets the block type identifier for the Theora encoder.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the Theora encoder pipeline. Creates the encoder with patent-free compression settings and prepares it for open-source video encoding with specified quality parameters.

public override bool Build()

Returns

bool

true if the encoder was successfully built; false if initialization failed.

CleanUp()

Performs cleanup of all resources associated with the Theora encoder. Disposes the encoder element and releases compression resources.

public void CleanUp()

Dispose(bool)

Releases unmanaged and - optionally - managed 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 wrapper for advanced configuration.

public BaseElement GetCore()

Returns

BaseElement

The BaseElement wrapper for the Theora encoder.

GetElement()

Gets the underlying GStreamer Theora encoder element.

public Element GetElement()

Returns

Element

The native GStreamer element performing Theora encoding.

IsAvailable()

Determines whether Theora encoding functionality is available on the current system. Requires the GStreamer Theora encoder plugin to be installed.

public static bool IsAvailable()

Returns

bool

true if Theora encoding is supported; otherwise, false.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the media pipeline context for this Theora encoder block.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent media pipeline containing this block.

See Also