Mkvtoolnix

From The World according to Vissie
Jump to navigation Jump to search

mkvtoolnix

Matroska is a new multimedia container format, based on EBML (Extensible Binary Meta Language), which is a kind of binary XML. These tools allow to manipulate Matroska files.

* mkvmerge is a tool to create Matroska files from other formats
* mkvinfo allows one to get information about the tracks in a Matroska file
* mkvextract can extract tracks from Matroska files to other formats

Nice site explaining how to do this.

https://www.chrissearle.org/2011/10/02/Splitting_MKV_files_on_chapter_marks/

As pointed out in the comments below - mkvmerge --split now has a chapters option

mkvmerge -o output.mkv --split chapters:1,3,5 testfile.mkv

I have no idea how long that option has been there - but it certainly makes life a lot easier. Thanks to the commmenter for the update.

mkvinfo testfile.mkv  | grep ChapterTimeStart
   |   + ChapterTimeStart: 00:00:00.000000000
   |   + ChapterTimeStart: 00:08:45.000000000
   |   + ChapterTimeStart: 00:14:47.856000000
   |   + ChapterTimeStart: 00:19:03.576000000
   |   + ChapterTimeStart: 00:27:23.656000000
   |   + ChapterTimeStart: 00:36:08.496000000
   |   + ChapterTimeStart: 00:41:30.776000000
   |   + ChapterTimeStart: 00:45:42.896000000
   |   + ChapterTimeStart: 00:51:40.256000000
   |   + ChapterTimeStart: 01:03:57.336000000
   |   + ChapterTimeStart: 01:16:19.296000000
   |   + ChapterTimeStart: 01:26:53.456000000

Let's say we want to split off the first chapter:

mkvmerge -o output.mkv --split "timecodes:00:08:45.00" testfile.mkv

timecodes has hh:mm:ss.ss (hours, mins, secs in decimal) as format and can take comma sep list for splitting at several points.