C.W.K.
Stream
Lesson 06 of 07 · published

Metadata & Chapters

~10 min · metadata, chapters, title

Level 0Viewer
0 XP0/73 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

Container-level metadata

MP4/MKV/MOV all support metadata tags — title, artist, comment, year. Set them with -metadata key=value. Existing metadata can be inspected with ffprobe -show_format.

Chapters

Chapter markers split a long video into named sections. YouTube reads chapters from the video metadata for the timeline scrubber. To add chapters via FFmpeg, use the metadata-file pattern: read existing metadata, edit the chapter section, write back.

Code

Set metadata tags·bash
# Title + comment + year
ffmpeg -i in.mp4 \
  -c copy \
  -metadata title="Pippa Quest Boot Camp" \
  -metadata comment="Recorded 2026-05-04" \
  -metadata year="2026" \
  out.mp4

# Inspect what's there
ffprobe -v error -show_entries format_tags out.mp4
Add chapter markers·bash
# 1) Dump existing metadata to a file
ffmpeg -i in.mp4 -f ffmetadata metadata.txt

# 2) Edit metadata.txt — append [CHAPTER] sections
cat >> metadata.txt <<'EOF'
[CHAPTER]
TIMEBASE=1/1000
START=0
END=120000
title=Intro
[CHAPTER]
TIMEBASE=1/1000
START=120000
END=420000
title=Main Content
[CHAPTER]
TIMEBASE=1/1000
START=420000
END=600000
title=Outro
EOF

# 3) Apply the metadata file back
ffmpeg -i in.mp4 -i metadata.txt -map_metadata 1 \
  -c copy out_chaptered.mp4

# Verify
ffprobe -v error -show_chapters out_chaptered.mp4

External links

Exercise

Take a 10-minute video. Add 3 chapters using the metadata-file pattern: 'Intro' (0–60s), 'Main' (60–540s), 'Outro' (540–600s). Verify with ffprobe -show_chapters. Upload as YouTube Unlisted and check whether the timeline scrubber shows the chapter labels.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.