How to add chapters into mp4/mkv file using ffmpeg?

Alex Zubkov picture Alex Zubkov · Nov 21, 2017 · Viewed 17.3k times · Source

Currently i'm using MKVToolNix for my needs which is fine but i would prefer some CLI also. As far as i know ffmpeg supports chapters management.

Answer

MRousse picture MRousse · Nov 21, 2017

The ffmetadata format allows you to add chapters to a file.

Have a look at https://ffmpeg.org/ffmpeg-formats.html#Metadata-1 for an example.