MP4v2
Classes | Macros | Typedefs | Enumerations | Functions
MP4v2 Chapter

Classes

struct  MP4Chapter_s
 Chapter item. More...
 

Macros

#define MP4V2_CHAPTER_TITLE_MAX   1023
 The maximum length of a QuickTime chapter title (in 8-bit chars)
 

Typedefs

typedef struct MP4Chapter_s MP4Chapter_t
 Chapter item. More...
 

Enumerations

enum  MP4ChapterType {
  MP4ChapterTypeNone = 0, MP4ChapterTypeAny = 1, MP4ChapterTypeQt = 2,
  MP4ChapterTypeNero = 4
}
 Known chapter types. More...
 

Functions

void MP4AddChapter (MP4FileHandle hFile, MP4TrackId chapterTrackId, MP4Duration chapterDuration, const char *chapterTitle=0)
 Add a QuickTime chapter. More...
 
MP4TrackId MP4AddChapterTextTrack (MP4FileHandle hFile, MP4TrackId refTrackId, uint32_t timescale=0)
 Add a QuickTime chapter track. More...
 
void MP4AddNeroChapter (MP4FileHandle hFile, MP4Timestamp chapterStart, const char *chapterTitle=0)
 Add a Nero chapter. More...
 
MP4ChapterType MP4ConvertChapters (MP4FileHandle hFile, MP4ChapterType toChapterType=MP4ChapterTypeQt)
 Convert chapters to another type. More...
 
MP4ChapterType MP4DeleteChapters (MP4FileHandle hFile, MP4ChapterType chapterType=MP4ChapterTypeQt, MP4TrackId chapterTrackId=MP4_INVALID_TRACK_ID)
 Delete chapters. More...
 
MP4ChapterType MP4GetChapters (MP4FileHandle hFile, MP4Chapter_t **chapterList, uint32_t *chapterCount, MP4ChapterType chapterType=MP4ChapterTypeQt)
 Get list of chapters. More...
 
MP4ChapterType MP4SetChapters (MP4FileHandle hFile, MP4Chapter_t *chapterList, uint32_t chapterCount, MP4ChapterType chapterType=MP4ChapterTypeQt)
 Set list of chapters OKOK. More...
 

Detailed Description

Typedef Documentation

◆ MP4Chapter_t

typedef struct MP4Chapter_s MP4Chapter_t

Chapter item.

This item defines various attributes for a chapter.

Enumeration Type Documentation

◆ MP4ChapterType

Known chapter types.

Enumerator
MP4ChapterTypeNone 

no chapters found return value

MP4ChapterTypeAny 

any or all known chapter types

MP4ChapterTypeQt 

QuickTime chapter type.

MP4ChapterTypeNero 

Nero chapter type.

Function Documentation

◆ MP4AddChapter()

void MP4AddChapter ( MP4FileHandle  hFile,
MP4TrackId  chapterTrackId,
MP4Duration  chapterDuration,
const char *  chapterTitle = 0 
)

Add a QuickTime chapter.

This function adds a QuickTime chapter to file hFile.

Parameters
hFilehandle of file to add chapter.
chapterTrackIdID of chapter track or MP4_INVALID_TRACK_ID if unknown.
chapterDurationduration (in the timescale of the chapter track).
chapterTitletitle text for the chapter or NULL to use default title format ("Chapter %03d", n) where n is the chapter number.

◆ MP4AddChapterTextTrack()

MP4TrackId MP4AddChapterTextTrack ( MP4FileHandle  hFile,
MP4TrackId  refTrackId,
uint32_t  timescale = 0 
)

Add a QuickTime chapter track.

This function adds a chapter (text) track to file hFile. The optional parameter timescale may be supplied to give the new chapter a specific timescale. Otherwise the chapter track will have the same timescale as the reference track defined in parameter refTrackId.

Parameters
hFilehandle of file to add chapter track.
refTrackIdID of the track that will reference the chapter track.
timescalethe timescale of the chapter track or 0 to use the timescale of track specified by refTrackId.
Returns
ID of the created chapter track.

◆ MP4AddNeroChapter()

void MP4AddNeroChapter ( MP4FileHandle  hFile,
MP4Timestamp  chapterStart,
const char *  chapterTitle = 0 
)

Add a Nero chapter.

This function adds a Nero chapter to file hFile.

Parameters
hFilehandle of file to add chapter.
chapterStartthe start time of the chapter in 100 nanosecond units
chapterTitletitle text for the chapter or NULL to use default title format ("Chapter %03d", n) where n is the chapter number.

◆ MP4ConvertChapters()

MP4ChapterType MP4ConvertChapters ( MP4FileHandle  hFile,
MP4ChapterType  toChapterType = MP4ChapterTypeQt 
)

Convert chapters to another type.

This function converts existing chapters in file hFile from one type to another type. Conversion from Nero to QuickTime or QuickTime to Nero is supported.

Parameters
hFilehandle of file to convert.
toChapterTypethe chapter type to convert to:
Returns
the chapter type before conversion or MP4ChapterTypeNone if the source chapters do not exist or invalid toChapterType was specified.

◆ MP4DeleteChapters()

MP4ChapterType MP4DeleteChapters ( MP4FileHandle  hFile,
MP4ChapterType  chapterType = MP4ChapterTypeQt,
MP4TrackId  chapterTrackId = MP4_INVALID_TRACK_ID 
)

Delete chapters.

This function deletes existing chapters in file hFile.

Parameters
hFilehandle of file to delete chapters.
chapterTypethe type of chapters to delete:
chapterTrackIdID of the chapter track if known, or MP4_INVALID_TRACK_ID. Only applies when chapterType=MP4ChapterTypeQt.
Returns
the type of deleted chapters

◆ MP4GetChapters()

MP4ChapterType MP4GetChapters ( MP4FileHandle  hFile,
MP4Chapter_t **  chapterList,
uint32_t *  chapterCount,
MP4ChapterType  chapterType = MP4ChapterTypeQt 
)

Get list of chapters.

This function gets a chpter list from file hFile.

Parameters
hFilehandle of file to read.
chapterListaddress receiving array of chapter items. If a non-NULL is received the caller is responsible for freeing the memory with MP4Free().
chapterCountaddress receiving count of items in array.
chapterTypethe type of chapters to read:
Returns
the first type of chapters found.

◆ MP4SetChapters()

MP4ChapterType MP4SetChapters ( MP4FileHandle  hFile,
MP4Chapter_t chapterList,
uint32_t  chapterCount,
MP4ChapterType  chapterType = MP4ChapterTypeQt 
)

Set list of chapters OKOK.

This functions sets the complete chapter list in file hFile. If any chapters of the same type already exist they will first be deleted.

Parameters
hFilehandle of file to modify.
chapterListarray of chapters items.
chapterCountcount of items in array.
chapterTypetype of chapters to write:
Returns
the type of chapters written.