Show / Hide Table of Contents

Struct ChapterList

Represents the collection of chapters in a FormatContext.

Implements
IEnumerable<AVChapter>
IEnumerable
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: FFmpeg.Formats
Assembly: FFmpeg.dll
Syntax
public readonly struct ChapterList : IEnumerable<AVChapter>, IEnumerable
Remarks

This collection provides access to the chapters stored in a media container. Changes made through this collection directly modify the underlying FFmpeg format context.

Constructors

View Source

ChapterList(FormatContext, bool)

Represents the collection of chapters in a FormatContext.

Declaration
public ChapterList(FormatContext context, bool readOnly)
Parameters
Type Name Description
FormatContext context
bool readOnly
Remarks

This collection provides access to the chapters stored in a media container. Changes made through this collection directly modify the underlying FFmpeg format context.

Properties

View Source

Count

Gets the number of chapters in the collection.

Declaration
public int Count { get; }
Property Value
Type Description
int
View Source

IsReadOnly

Gets a value indicating whether the collection can be modified.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
bool
View Source

this[int]

Gets the chapter at the specified index.

Declaration
public AVChapter this[int index] { get; }
Parameters
Type Name Description
int index

The zero-based index of the chapter.

Property Value
Type Description
AVChapter

The chapter at the specified index.

Exceptions
Type Condition
ArgumentOutOfRangeException

index is outside the bounds of the collection.

Methods

View Source

AddChapter(Rational, long, long, string)

Adds a new chapter using the first available chapter identifier.

Declaration
public void AddChapter(Rational timeBase, long start, long end, string title)
Parameters
Type Name Description
Rational timeBase

The time base used for start and end.

long start

The chapter start timestamp.

long end

The chapter end timestamp.

string title

The chapter title.

Remarks

The chapter identifier is automatically selected so that it does not conflict with an existing chapter.

View Source

GetEnumerator()

Returns an enumerator that iterates through the chapters in the collection.

Declaration
public IEnumerator<AVChapter> GetEnumerator()
Returns
Type Description
IEnumerator<AVChapter>
View Source

Remove(AVChapter)

Removes the specified chapter.

Declaration
public bool Remove(AVChapter chapter)
Parameters
Type Name Description
AVChapter chapter

The chapter to remove.

Returns
Type Description
bool

true if the chapter was removed; otherwise, false.

View Source

RemoveAt(long)

Removes the chapter at the specified index.

Declaration
public void RemoveAt(long index)
Parameters
Type Name Description
long index

The zero-based index of the chapter to remove.

Exceptions
Type Condition
ArgumentOutOfRangeException

index is outside the bounds of the collection.

NotSupportedException

The collection is read-only.

View Source

RemoveById(long)

Removes the chapter with the specified identifier.

Declaration
public bool RemoveById(long id)
Parameters
Type Name Description
long id

The chapter identifier.

Returns
Type Description
bool

true if a chapter was removed; otherwise, false.

View Source

SetChapter(long, Rational, long, long, string)

Adds a new chapter or updates an existing chapter with the specified identifier.

Declaration
public void SetChapter(long id, Rational timeBase, long start, long end, string title)
Parameters
Type Name Description
long id

The unique chapter identifier.

Rational timeBase

The time base used for start and end.

long start

The chapter start timestamp expressed in units of timeBase.

long end

The chapter end timestamp expressed in units of timeBase.

string title

The chapter title.

Exceptions
Type Condition
NotSupportedException

The collection is read-only.

FFmpegException

FFmpeg failed to allocate or add the chapter.

View Source

SetChapter(long, TimeSpan, TimeSpan, string)

Adds a new chapter or updates an existing chapter with the specified identifier.

Declaration
public void SetChapter(long id, TimeSpan start, TimeSpan end, string title)
Parameters
Type Name Description
long id

The unique chapter identifier.

TimeSpan start

The chapter start time.

TimeSpan end

The chapter end time.

string title

The chapter title.

Remarks

A suitable time base is automatically chosen based on the specified start and end times.

Implements

IEnumerable<T>
IEnumerable
  • View Source
In this article
Back to top Generated by DocFX