Table of Contents

Class YouTubeOutputBlock

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

YouTube Live streaming output block for real-time broadcast to YouTube platform with integrated encoding capabilities. Provides professional live streaming functionality with H.264 video and AAC audio encoding optimized for YouTube's RTMP streaming requirements, enabling content creators to broadcast high-quality live video content directly to YouTube audiences with low-latency streaming protocols. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

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

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

YouTubeOutputBlock(YouTubeSinkSettings, IH264EncoderSettings, IAACEncoderSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.YouTubeOutputBlock class with custom encoder settings. Provides full control over video and audio compression parameters for professional YouTube Live streaming.

public YouTubeOutputBlock(YouTubeSinkSettings sinkSettings, IH264EncoderSettings h264settings, IAACEncoderSettings aacSettings)

Parameters

sinkSettings YouTubeSinkSettings

The YouTube Live streaming settings including RTMP URL, stream key, and connection parameters.

h264settings IH264EncoderSettings

The H.264 video encoder settings optimized for YouTube Live streaming quality and bandwidth.

aacSettings IAACEncoderSettings

The AAC audio encoder settings optimized for YouTube Live streaming quality and bandwidth.

Properties

Input

Gets the primary input pad (first in the collection of dynamic inputs).

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads available on this block (dynamic collection for video and audio).

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the primary output pad (none for streaming blocks that broadcast to services).

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads available on this block (none for streaming blocks).

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Type

Gets the media block type identifier for YouTube Live streaming operations.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the YouTube Live streaming block within the pipeline context. Creates the RTMP streaming sink, H.264 and AAC encoders, and establishes all necessary connections for encoding and streaming multimedia content to YouTube Live platform.

public override bool Build()

Returns

bool

true if the YouTube Live streaming block was successfully built and configured; otherwise, false.

CleanUp()

Cleans up all resources associated with the YouTube Live streaming operations, including encoders, sink, and network connections.

public void CleanUp()

CreateNewInput(MediaBlockPadMediaType)

Creates a new input pad for the specified media type, enabling dynamic addition of video and audio streams for live streaming.

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 managed resources used by the YouTube Live streaming block. Properly disposes of GStreamer elements, encoders, and network streaming 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 and monitoring.

public BaseElement GetCore()

Returns

BaseElement

Always null for composite streaming blocks with multiple internal elements.

GetElement()

Gets the native GStreamer element for direct GStreamer pipeline integration.

public Element GetElement()

Returns

Element

Always null for composite streaming blocks with multiple internal elements.

GetInput(MediaBlockPadMediaType)

Retrieves an existing input pad for the specified media type from the current collection.

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(IH264EncoderSettings, IAACEncoderSettings)

Determines whether YouTube Live streaming functionality is available on the current system. Requires GStreamer RTMP streaming plugins and network connectivity for YouTube platform access.

public static bool IsAvailable(IH264EncoderSettings h264settings, IAACEncoderSettings aacSettings)

Parameters

h264settings IH264EncoderSettings

The H.264 video encoder settings to validate for availability.

aacSettings IAACEncoderSettings

The AAC audio encoder settings to validate for availability.

Returns

bool

true if YouTube Live streaming is supported; otherwise, false.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context for this YouTube Live streaming block, providing access to the parent pipeline and logging context.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent MediaBlocks pipeline containing this YouTube Live streaming block.

See Also