Chapters¶
By default Yukine will not mux chapters into the output file. You can set chapters by providing the Optional Option OptionsSource.chapters option to the Source object. This accepts a muxtools.Chapters object. You can use muxtools.Chapters.from_mkv to load chapters from a MKV file. muxtools provides ways to load, or create chapters manually. Please refer to the muxtools chapters documentation for more information.Chapters Example
chapters=(
Chapters.from_mkv(input_file, _print=False)
if has_chapters(input_file) # (1)!
else None
),
muxtools.Chapters.from_mkv()
will raise an exception if the file does not have chapters.
We use has_chapters
to check if the source file has chapters.
This way we can add chapters to the muxed video only if the source file has chapters.