Table of Contents

Class HLSOutput

Namespace
VisioForge.Core.Types.Output
Assembly
VisioForge.Core.dll

Represents configuration settings for HLS (HTTP Live Streaming) output format.

public class HLSOutput : INetworkStreamingOutput

Inheritance

Implements

Inherited Members

Remarks

HLS (HTTP Live Streaming) is Apple's adaptive streaming protocol designed for delivering live and on-demand content over HTTP. This output format breaks video into small segments and creates a playlist file that allows clients to adaptively stream content based on network conditions.

Key features of HLS:

  • Adaptive bitrate streaming for optimal playback quality
  • Wide device compatibility (iOS, Android, web browsers)
  • Standard HTTP infrastructure (CDN-friendly)
  • Support for live and VOD (Video on Demand) streaming
  • Encrypted content delivery support

This class configures HLS output using Media Foundation video encoders and AAC audio compression. The output consists of multiple small video segments (.ts files) and an M3U8 playlist file that describes the stream structure.

Constructors

HLSOutput()

Initializes a new instance of the VisioForge.Core.Types.Output.HLSOutput class with default settings.

public HLSOutput()

Remarks

Default configuration:

  • Audio: AAC at 128 kbps, Low Complexity profile, MPEG-4
  • Video: Default Media Foundation encoder settings
  • HLS: Default segmentation and playlist settings

These defaults provide a good starting point for HLS streaming. Adjust video and audio settings based on your bandwidth and quality requirements.

Properties

Audio

Gets or sets the AAC audio encoder settings for HLS streaming.

public M4AOutput Audio { get; set; }

Property Value

M4AOutput

Remarks

HLS typically uses AAC audio for compatibility across platforms. These settings control the audio bitrate, sample rate, and AAC profile used in the stream.

HLS

Gets or sets the HLS-specific streaming configuration.

public HLSSettings HLS { get; set; }

Property Value

HLSSettings

Remarks

These settings control how the video is segmented, playlist generation, output location, and optional built-in HTTP server configuration for streaming.

Video

Gets or sets the Media Foundation video encoder settings for HLS streaming.

public MFVideoEncoderSettings Video { get; set; }

Property Value

MFVideoEncoderSettings

Remarks

These settings control video codec selection, bitrate, resolution, and other encoding parameters. Media Foundation provides hardware-accelerated encoding on supported systems.

Methods

Load(string)

Deserializes HLS output settings from a JSON string.

public static HLSOutput Load(string json)

Parameters

json string

The JSON string containing the serialized HLS output settings.

Returns

HLSOutput

A new VisioForge.Core.Types.Output.HLSOutput instance with settings restored from the JSON string.

Remarks

This method restores all video encoder, audio encoder, and HLS configuration settings from a previously saved state.

Exceptions

JsonException

Thrown when the JSON string is invalid or cannot be deserialized to an HLSOutput object.

Save()

Serializes the current HLS output settings to a JSON string.

public string Save()

Returns

string

A JSON string representation of all HLS configuration settings.

Remarks

The resulting JSON can be used to restore settings later using the VisioForge.Core.Types.Output.HLSOutput.Load(System.String) method. All video, audio, and HLS-specific settings are included in the serialization.