taglib-ts
    Preparing search index...

    Reads, writes, and removes Nero-style chapter markers (chpl atom at moov/udta/chpl) from MP4 files.

    Implements the lazy-read / dirty-write pattern via Mp4ChapterHolder.

    const holder = new NeroChapters();
    const chapters = await holder.getChapters(stream);
    holder.setChapters([{ title: "Intro", startTime: 0 }]);
    await holder.saveIfModified(stream);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _chapters: Mp4Chapter[] = []

    The currently-held chapter list (may not yet be loaded from disk).

    _loaded: boolean = false

    Whether chapters have been loaded from disk at least once.

    _modified: boolean = false

    Whether the in-memory chapter list differs from what is on disk.

    Accessors

    • get isModified(): boolean

      Returns true if the in-memory chapter list has been modified.

      Returns boolean

    Methods

    • Removes the chpl atom from the file (if present).

      Parameters

      Returns Promise<boolean>

      true on success (including when no chpl atom exists).

    • Writes Nero chapters to the moov/udta/chpl atom, creating or replacing it. Writing an empty list removes the chpl atom.

      Parameters

      Returns Promise<boolean>

      true on success.