Class Subtitle
Represents a collection of subtitle rectangles and manages subtitle display timings. This class wraps an FFmpeg FFmpeg.AutoGen._AVSubtitle structure and provides access to subtitle properties and rectangles.
Implements
Inherited Members
Namespace: FFmpeg.Subtitles
Assembly: FFmpeg.dll
Syntax
public class Subtitle : IReadOnlyList<SubtitleRect>, IReadOnlyCollection<SubtitleRect>, IEnumerable<SubtitleRect>, IEnumerable, IDisposable
Constructors
View SourceSubtitle()
Declaration
public Subtitle()
Properties
View SourceCount
Gets the number of subtitle rectangles contained in this subtitle.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
EndDisplayTime
Gets the time (in milliseconds) when the subtitle should stop being displayed.
Declaration
public uint EndDisplayTime { get; }
Property Value
| Type | Description |
|---|---|
| uint |
this[int]
Gets the SubtitleRect at the specified index.
Declaration
public SubtitleRect this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The index of the subtitle rectangle to retrieve. |
Property Value
| Type | Description |
|---|---|
| SubtitleRect | The SubtitleRect at the specified index. |
Exceptions
| Type | Condition |
|---|---|
| IndexOutOfRangeException | Thrown if the index is less than 0 or greater than or equal to the number of rectangles in the subtitle. |
PresentationTime
Gets or sets the presentation timestamp (PTS) for the subtitle. This indicates the time when the subtitle should be presented.
Declaration
public long PresentationTime { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
StartDisplayTime
Gets the time (in milliseconds) when the subtitle should start being displayed.
Declaration
public uint StartDisplayTime { get; }
Property Value
| Type | Description |
|---|---|
| uint |
Methods
View SourceDispose()
Releases the resources used by the Subtitle instance.
Declaration
public void Dispose()
Dispose(bool)
Releases the resources used by the Subtitle instance.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | Indicates whether the method was called from the Dispose() method (true) or from a finalizer (false). |
Free()
Releases the resources used by the Subtitle instance.
Declaration
public void Free()
GetEnumerator()
Returns an enumerator that iterates through the subtitle rectangles.
Declaration
public IEnumerator<SubtitleRect> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<SubtitleRect> | An enumerator for the collection of subtitle rectangles. |