Skip to content

Add authored chapter markers - #4931

Closed
mvanhorn wants to merge 1 commit into
heygen-com:mainfrom
mvanhorn:fix/authored-chapter-markers
Closed

mvanhorn wants to merge 1 commit into
heygen-com:mainfrom
mvanhorn:fix/authored-chapter-markers

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

demo

A timed clip can set data-chapter to a section title. Those titles become player scrubber ticks, a current-chapter chip, Studio ruler ticks, a hyperframes chapters listing, and MP4/MOV chapter metadata on render. A composition with no data-chapter is unchanged. data-chapter is a navigational title, not the inspector label.

What changed

  • data-chapter on a timed clip marks a section start at that clip's resolved data-start. The chapter runs until the next chapter or the end of the composition.
  • hyperframes chapters lists index, start, title, and element id. hyperframes compositions --json and hyperframes inspect --json include the same chapters.
  • Render writes chapter metadata into MP4 and MOV when any exist. --no-chapters skips that write. GIF, WebM, and png sequences ignore chapters and still render.
  • The player shows ticks and a title chip, and [ / ] seek to the previous or next chapter. chapters="off" hides the rail. Studio draws read-only ruler ticks.
  • Lint reports an empty title, a chapter with no resolvable start, or two chapters at the same start.

Tests

Parser, lint, player, Studio ruler, CLI, and chapter-metadata tests passed on this branch.

Timed clips can declare section starts with data-chapter. Those markers
list from the CLI, appear in the player and Studio ruler, and mux into
MP4/MOV as ffmetadata chapters.
@miguel-heygen

Copy link
Copy Markdown
Collaborator

looking

@miguel-heygen miguel-heygen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, and for the demo. Chapter markers would be a nice addition, and nothing like it exists on main today. I read the ffmetadata writer and the encoder wiring closely and skimmed the rest; I did not do a full line-by-line read because the branch can't merge as it stands.

Where it stands:

  • It conflicts with main in 23 files. Most are content conflicts across the CLI, engine, lint, parsers, player, producer and Studio. Three are files main has since deleted: skills/hyperframes-core/SKILL.md and its data-attributes.md and tracks-and-clips.md references. That skill was folded into skills/hyperframes/ and its references, so the doc lines need a new home there.
  • This adds a lot of new public surface: a data-chapter attribute, a hyperframes chapters command, --no-chapters on render, [ and ] keys and a chapters attribute on the player, new lint checks and a Studio ruler layer. Before you spend time on the rebase, it is worth getting a maintainer's go-ahead on that shape. Splitting it into smaller PRs (for example the attribute, parser and lint first, then render metadata, then player and Studio) would also make it much easier to review and land.

From the parts I read:

  • ffmetadataChapters.ts escapes the right characters and writes sensible START/END values in a 1/1000 timebase.
  • -map_metadata N makes the chapter file the source of global metadata, so global tags ffmpeg would normally carry over from the first input are dropped. Provenance survives because it is added later with -metadata, but a test that checks a chaptered MP4 still has its provenance tags would pin that.

Housekeeping for the next push: the title needs the conventional-commit form (for example feat: add authored chapter markers) for the PR title check, and the commit needs signing, since main requires signed commits. CI has not run on this fork branch yet, so there is no CI signal to go on.

Verdict: COMMENT
Reasoning: The branch conflicts with main in 23 files and adds a large public API that needs a maintainer decision first; the parts I read look sound.

@mvanhorn

Copy link
Copy Markdown
Contributor Author

Thanks @miguel-heygen. Happy to split it. Would you like the first PR to be the data-chapter attribute, parser and lint, with render metadata and then player/Studio support as follow-ups? I'll hold off on the rebase until you confirm the shape.

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Thanks for putting this together. Authored chapter markers aren't on our roadmap right now, so I'm closing this as not planned. If that changes we'll reopen it or reach out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants