Table of Contents

Class RTMPSourceBlock

Namespace
VisioForge.Core.MediaBlocks.Sources
Assembly
VisioForge.Core.dll

RTMP (Real Time Messaging Protocol) source block for streaming from RTMP servers. Outputs demuxed compressed video and audio streams without decoding, suitable for direct recording, transcoding, or connection to separate decoder blocks. Provides efficient streaming from media servers, CDNs, and live streaming platforms. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class RTMPSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IGetVideoStreamInfo

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

RTMPSourceBlock(RTMPSourceSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.RTMPSourceBlock class with custom RTMP settings. Configures the RTMP source for network streaming, outputting compressed audio/video streams.

public RTMPSourceBlock(RTMPSourceSettings settings)

Parameters

settings RTMPSourceSettings

The RTMP settings controlling URI, connection parameters, and stream selection.

Properties

AudioOutput

Gets the audio output pad that provides compressed RTMP audio stream to downstream blocks.

public MediaBlockPad AudioOutput { get; }

Property Value

MediaBlockPad

Input

Gets the primary input pad (none for source blocks that receive network streams).

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads available on this block (none for source blocks).

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the primary output pad (video output for RTMP).

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads available on this block (dynamic based on stream content).

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the RTMP configuration settings that control connection parameters and streaming options.

public RTMPSourceSettings Settings { get; set; }

Property Value

RTMPSourceSettings

Type

Gets the media block type identifier for RTMP source operations.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

VideoOutput

Gets the video output pad that provides compressed RTMP video stream to downstream blocks.

public MediaBlockPad VideoOutput { get; }

Property Value

MediaBlockPad

Methods

Build()

Builds and initializes the RTMP source within the pipeline context. Establishes network connection, demuxes the stream, and prepares compressed audio/video outputs.

public override bool Build()

Returns

bool

true if the RTMP source was successfully built and configured; otherwise, false.

CleanUp()

Cleans up all resources associated with the RTMP operations, including network connections and decoder resources.

public void CleanUp()

Dispose(bool)

Releases unmanaged and managed resources used by the RTMP source. Properly closes network connections and disposes of GStreamer elements and 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 source blocks with multiple internal elements.

GetElement()

Gets the native GStreamer element for direct GStreamer pipeline integration.

public Element GetElement()

Returns

Element

The RTMP source GStreamer element.

GetVideoStreamInfo()

Gets the detailed video stream information extracted from the RTMP source.

public VideoStreamInfo GetVideoStreamInfo()

Returns

VideoStreamInfo

A VideoStreamInfo object containing codec, resolution, frame rate, and format details of the video stream.

IsAvailable()

Determines whether RTMP support is available on the current system. Requires GStreamer RTMP plugins and codec libraries to be installed.

public static bool IsAvailable()

Returns

bool

true if RTMP support is available; otherwise, false.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context for this RTMP source, providing access to the parent pipeline and logging context.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent MediaBlocks pipeline containing this RTMP source.

See Also