Class MediaContainerInfo
- Namespace
- VisioForge.Core.Types.MediaInfo
- Assembly
- VisioForge.Core.dll
Represents detailed information about the media container format of a file. This includes the overall duration of the media and any associated tags.
public class MediaContainerInfoInheritance
Inherited Members
Examples
// Assume mediaInfo is an instance of MediaFileInfo containing container information.
MediaContainerInfo containerInfo = mediaInfo.ContainerInfo;
if (containerInfo != null)
{
Console.WriteLine($"Media Container Info:");
Console.WriteLine($" Format: {containerInfo.Format}");
Console.WriteLine($" Duration: {containerInfo.Duration}");
if (containerInfo.Tags != null && containerInfo.Tags.Any())
{
Console.WriteLine(" Container Tags:");
foreach (var tag in containerInfo.Tags)
{
Console.WriteLine($" {tag.Name}: {tag.Value}");
}
}
}
Remarks
This class is typically populated by a media information parser and provides high-level details about the media file itself, rather than individual streams within it. Container formats (MP4, MKV, AVI, MOV, WebM, FLV) encapsulate multiple elementary streams (video, audio, subtitles) with synchronization information. Duration property indicates the total playback time of the longest stream in the container. Format property identifies the container type, which determines supported features and codec compatibility. Tags collection contains file-level metadata like title, artist, album, creation date, encoder, and copyright information. Container-level tags differ from stream-specific tags and apply to the entire file. Some containers support chapters, attachments (fonts, cover art), and complex metadata structures. Understanding container format is essential for compatibility checking, transcoding decisions, and metadata management. The ToString method provides a summary of container information for logging and debugging. Container information is fundamental for media library management, file inspection tools, and transcoding workflows.
Constructors
MediaContainerInfo()
Initializes a new instance of the VisioForge.Core.Types.MediaInfo.MediaContainerInfo class. The VisioForge.Core.Types.MediaInfo.MediaContainerInfo.Tags list is initialized as an empty list.
public MediaContainerInfo()Properties
Duration
Gets or sets the total duration of the media contained within this container.
public TimeSpan Duration { get; set; }Property Value
Format
Gets or sets the name of the media container format (e.g., "AVI", "MP4", "MKV").
public string Format { get; set; }Property Value
Tags
Gets a list of VisioForge.Core.Types.MediaInfo.MediaInfoTag objects associated with the media container. These tags can include general metadata about the file, such as title, artist, or genre.
public List<MediaInfoTag> Tags { get; }Property Value
Methods
ToString()
Returns a string that represents the current VisioForge.Core.Types.MediaInfo.MediaContainerInfo instance. The string includes the container format and its duration.
public override string ToString()