Skip to content

Implemented set_chapters method#2004

Merged
WyattBlue merged 4 commits intoPyAV-Org:mainfrom
DE-AI:set-chapters
Sep 4, 2025
Merged

Implemented set_chapters method#2004
WyattBlue merged 4 commits intoPyAV-Org:mainfrom
DE-AI:set-chapters

Conversation

@DE-AI
Copy link
Contributor

@DE-AI DE-AI commented Sep 2, 2025

This is a follow up of #1997 and implements the set chapter method.

Example usage:

chapters = [
        {
            "id": 1,
            "start": 0,
            "end": 5000,
            "time_base": Fraction(1, 1000),
            "metadata": {"title": "start"},
        }
    ]

path = "path/to/video"
with av.open(path) as container:
    container.set_chapters(chapters)
    assert container.chapters() == chapters

Related issue: #1710

@WyattBlue WyattBlue merged commit 4d603ec into PyAV-Org:main Sep 4, 2025
6 checks passed
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