Table of Contents

Class SubtitleStreamInfo

Namespace
VisioForge.Core.Types.MediaInfo
Assembly
VisioForge.Core.dll

Represents detailed information about a subtitle stream within a media file. This class provides properties such as offset, track name, codec, and language.

public class SubtitleStreamInfo

Inheritance

Inherited Members

Examples

// Assume mediaInfo is an instance of MediaFileInfo containing stream information.
foreach (var subtitleStream in mediaInfo.SubtitleStreams)
{
    Console.WriteLine($"Subtitle Stream Found:");
    Console.WriteLine($"  Name: {subtitleStream.Name}");
    Console.WriteLine($"  Codec: {subtitleStream.Codec}");
    Console.WriteLine($"  Language: {subtitleStream.Language}");
    Console.WriteLine($"  Offset: {subtitleStream.Offset}");

    if (subtitleStream.Tags != null && subtitleStream.Tags.Any())
    {
        Console.WriteLine("  Tags:");
        foreach (var tag in subtitleStream.Tags)
        {
            Console.WriteLine($"    {tag.Name}: {tag.Value}");
        }
    }
}

Remarks

This information is typically retrieved by a media information parser and is useful for displaying subtitle properties to the user, or for selecting specific subtitle tracks for rendering. Subtitle streams provide text overlays synchronized with video content for translation, accessibility, or additional information. Name property provides a human-readable track title (e.g., "English", "Director's Commentary", "SDH"). Codec identifies the subtitle format: text-based (SRT, SSA, ASS, WebVTT) or image-based (VobSub, PGS, DVB). Language typically uses ISO 639-1 two-letter codes (en, es, fr) or ISO 639-2 three-letter codes for less common languages. Offset property may indicate timing offset or stream position, with interpretation depending on container format. ID provides unique stream identification within the file for precise track selection. Tags collection contains stream-specific metadata like title, language name, or forced/default flags. Text-based subtitles support styling, positioning, and effects (SSA/ASS), while image-based subtitles provide pixel-perfect rendering. Applications use this information for subtitle track selection, language filtering, and subtitle rendering configuration. Accessibility considerations include supporting SDH (Subtitles for Deaf and Hard of hearing) and closed captions.

Constructors

SubtitleStreamInfo()

Initializes a new instance of the VisioForge.Core.Types.MediaInfo.SubtitleStreamInfo class. All string properties are initialized to Empty, and VisioForge.Core.Types.MediaInfo.SubtitleStreamInfo.Tags as an empty list.

public SubtitleStreamInfo()

Properties

Codec

Gets or sets the name of the subtitle codec or format (e.g., "SRT", "ASS", "VobSub").

public string Codec { get; set; }

Property Value

string

ID

Gets or sets a unique identifier for the subtitle stream within the media file.

public string ID { get; set; }

Property Value

string

Language

Gets or sets the language of the subtitle stream, typically represented by a two-letter ISO 639-1 code (e.g., "en", "fr").

public string Language { get; set; }

Property Value

string

Name

Gets or sets the name of the subtitle track, if available (e.g., "English Subtitles", "For the hearing impaired").

public string Name { get; set; }

Property Value

string

Offset

Gets or sets the offset of the subtitle stream within the media file. The meaning of this offset can vary depending on the subtitle format.

public uint Offset { get; set; }

Property Value

uint

Tags

Gets a list of VisioForge.Core.Types.MediaInfo.MediaInfoTag objects associated with this subtitle stream. These tags can include metadata specific to the subtitle track.

public List<MediaInfoTag> Tags { get; }

Property Value

List<MediaInfoTag>