Table of Contents

Class RTSPServerBlock

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

RTSP (Real-Time Streaming Protocol) server sink block that streams audio/video content over a network. This block creates an RTSP server endpoint that clients can connect to for receiving live or recorded media streams. It supports H.264/H.265 video and various audio codecs, providing standard-compliant RTSP streaming with RTP/RTCP transport protocols. The server handles multiple client connections simultaneously, supports RTSP authentication, and provides low-latency streaming suitable for security cameras, live broadcasting, and media distribution. Features include configurable port binding, custom mount points, multicast support, bandwidth management, and client session tracking. Compatible with standard RTSP clients including VLC, FFmpeg, GStreamer, and IP camera viewers. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class RTSPServerBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

RTSPServerBlock(RTSPServerSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.RTSPServerBlock class. Creates an RTSP server that will listen on the specified port and serve streams at the configured mount point. The server starts accepting connections once the pipeline is playing.

public RTSPServerBlock(RTSPServerSettings settings)

Parameters

settings RTSPServerSettings

The RTSP server configuration including port, mount point, authentication settings, and streaming parameters.

Properties

AudioInput

Gets the audio input pad for connecting audio encoders. This pad accepts pre-encoded audio streams (AAC, MP3, Opus) for RTSP distribution.

public MediaBlockPad AudioInput { get; }

Property Value

MediaBlockPad

Input

Gets the primary input pad (video input) for the RTSP server.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads (video and audio) for the RTSP server.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the output pad. RTSP server is a sink block with no output pads.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads. RTSP server has no outputs as it streams over network.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the RTSP server configuration settings. Contains server port, mount point, authentication credentials, multicast settings, and streaming parameters that control server behavior and client access.

public RTSPServerSettings Settings { get; set; }

Property Value

RTSPServerSettings

Type

Gets the block type identifier for the RTSP server.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

VideoInput

Gets the video input pad for connecting video encoders. This pad accepts pre-encoded video streams (H.264, H.265) for RTSP distribution.

public MediaBlockPad VideoInput { get; }

Property Value

MediaBlockPad

Methods

Build()

Builds and initializes the RTSP server block. Creates the server instance, binds to the specified port, configures the mount point, sets up authentication if required, and prepares input pads for media streams. The server begins accepting client connections once the pipeline starts playing.

public override bool Build()

Returns

bool

true if the server was successfully initialized and bound to the port; false if initialization failed due to port conflicts or configuration errors.

CleanUp()

Performs cleanup of RTSP server resources and resets to uninitialized state. Stops the server, closes all client connections, releases the network port, and disposes of all server-related resources. Essential for proper shutdown and allowing the port to be reused.

public void CleanUp()

Dispose(bool)

Releases unmanaged and - optionally - managed resources. Stops the RTSP server, disconnects all clients, releases network ports, and cleans up server 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 RTSP server element wrapper. Provides access to the underlying server for advanced configuration of RTSP-specific features and session management.

public BaseElement GetCore()

Returns

BaseElement

The base element wrapping the RTSP server instance.

GetElement()

Gets the raw GStreamer element for the RTSP server. This provides direct access to the GStreamer RTSP server element for advanced configuration of server properties.

public Element GetElement()

Returns

Element

The GStreamer element implementing RTSP server functionality.

GetFilenameOrURL()

Gets the RTSP server URL that clients can connect to. Returns the full RTSP URL including protocol, server address, port, and mount point (e.g., "rtsp://localhost:8554/stream").

public string GetFilenameOrURL()

Returns

string

The complete RTSP URL for client connections.

IsAvailable()

Determines whether RTSP server functionality is available on the current system. Checks for required GStreamer RTSP server plugins and network capabilities.

public static bool IsAvailable()

Returns

bool

true if RTSP server is supported with required plugins installed; false if missing GStreamer RTSP server components or network restrictions.

SetFilenameOrURL(string)

Sets the filename or URL. Not supported for RTSP server. RTSP server configuration should be done through the Settings property.

public void SetFilenameOrURL(string value)

Parameters

value string

The value (ignored for RTSP server).

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Associates this RTSP server block with a pipeline and initializes its internal context. This method is called internally when the block is added to a pipeline.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The MediaBlocksPipeline instance that will manage this block.

See Also