Skip to content

Add support for parsing chapters from MKV files#3144

Open
tymmesyde wants to merge 16 commits intoandroidx:mainfrom
tymmesyde:feat/mkv-chapters
Open

Add support for parsing chapters from MKV files#3144
tymmesyde wants to merge 16 commits intoandroidx:mainfrom
tymmesyde:feat/mkv-chapters

Conversation

@tymmesyde
Copy link
Copy Markdown

Hi,
this include changes to support parsing MKV chapters using the recent changes to introduce metadata Chapter interface
This is already implemented for MP4: Nero & QuickTime
Used this doc as reference: https://www.matroska.org/technical/elements.html

Added sample_with_chapters.mkv for mkvSample_withChapters test
Generated with:

;FFMETADATA1
[CHAPTER]
TIMEBASE=1/1000
START=0
END=1999
title=Chapter 1

[CHAPTER]
TIMEBASE=1/1000
START=2000
END=4999
title=Chapter 2
ffmpeg \                                                                                       
  -f lavfi -i testsrc=duration=5:size=320x240:rate=30 \
  -f lavfi -i sine=frequency=440:duration=5 \
  -i chapters.txt \
  -map 0:v -map 1:a -map_chapters 2 \
  -c:v libx264 -c:a aac \
  sample_with_chapters.mkv

Copy link
Copy Markdown
Collaborator

@icbaker icbaker left a comment

Choose a reason for hiding this comment

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

I can't work out how to delete the stale comment made against an old copy of the code, sorry for the duplication.

Copy link
Copy Markdown

@srgsf srgsf left a comment

Choose a reason for hiding this comment

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

I'm not sure how to resolve threads, everything is correct now.

@icbaker icbaker force-pushed the feat/mkv-chapters branch from ffed640 to 938fa38 Compare March 30, 2026 13:59
@icbaker icbaker force-pushed the feat/mkv-chapters branch from 9b1c258 to c11d749 Compare March 30, 2026 14:04
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.

3 participants