Chapter Marker Generator
Turn your timeline data into real YouTube chapters in one pass
- chapters_json
- ffmetadata_text
- chapter_count
- summary
If you're publishing AI-generated edits, chapters are the difference between a video people scrub through and a video people can navigate. MKRChapterMarkerGenerator takes whatever timing data you've already produced - scene ranges, beat markers, silence ranges - and fuses it into a clean chapter list, then hands you the exact ffmetadata text that makes ffmpeg write those chapters into the file. It's the "finishing" step in the pack's timeline lane, and it slots neatly next to MKRBeatSyncRetimer and MKRBlackFrameDetector.
Part of MKRShift_Nodes by criskb. Install: ComfyUI Manager → search "MKRShift_Nodes", or git clone https://github.com/criskb/MKRShift_Nodes into custom_nodes/, restart. Nothing else to install for this one.
How it works
The node collects candidate chapter points from three sources:
- scene_ranges_json - it grabs the
start_time(orstart_sec) of each scene range, - beat_markers_json - beat timestamps from a beat-sync pass,
- silence_ranges_json - silence start points from an audio analysis.
It sorts all candidates, drops any that land within min_chapter_sec of a chapter already placed, and emits a numbered sequence. You get chapters_json (structured data, for other nodes) and ffmetadata_text - the ready-to-mux text with [CHAPTER] blocks containing START/END timestamps and titles like "Chapter 1". chapter_count and a summary round it out.
The few inputs you'll actually set
duration_sec- the total video length; needed to cap the last chapter.min_chapter_sec(default 8) - the shortest allowed chapter. This is your clutter control; too low and you get a chapter every two seconds.title_prefix(default "Chapter") - the label stem.
The three JSON inputs all default to [], so the node is fine with only one source wired up. Feed it just your beat markers if that's all you have.
Using the ffmetadata
Classic ffmpeg move, and the one this node exists to feed:
ffmpeg -i video.mp4 -i chapters.txt -map_metadata 1 -c copy -y out.mp4
Paste ffmetadata_text into chapters.txt and run that. Because it's a stream copy, it's fast. If your player ignores the chapters, check that you're not transcoding with a container that drops metadata. Nothing here calls any API and nothing needs a key - it's pure text generation, which makes it a nice, boring, dependable node in a pack that isn't always boring.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| duration_sec | FLOAT | 60.000–86400 | — |
| scene_ranges_json | STRING | [] | — |
| beat_markers_json | STRING | [] | — |
| silence_ranges_json | STRING | [] | — |
| min_chapter_sec | FLOAT | 8.01–600 | — |
| title_prefix | STRING | Chapter | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| chapters_json | STRING | — |
| ffmetadata_text | STRING | — |
| chapter_count | INT | — |
| summary | STRING | — |