View Full Version : Joining multiple files to an MKV file with automated chapters
jarod5001
21st June 2012, 01:52
Hi,
I'd like to find a way to get one MKV file with automated chapters from multiple source files.
My problem is that I have about 100 avi files (Holiday_001, Holiday_002, Holiday_003, etc...) and want to join them to one MKV file with chapters named : Holiday_001, Holiday_002, Holiday_003, etc..., matching each source file beginning.
Using mkvmerge GUI, I have to do it manually. I tried to find a way to automatically create a chapter file from a folder (used mediainfo), with no luck.
Any help.
Thanks.
[ReX]
28th June 2012, 02:57
A little late, but I have added that for JMkvpropedit v1.0.9.
http://i.imgur.com/G2EHN.png
jarod5001
5th July 2012, 02:46
Thanks for the answer.
But I'm not sure to understand how it can help me.
I tried to join three files named "01.mkv", "02.mkv" and "03.mkv" and I got this log :
File: D:\Hollidays\2011-06\01.mkv
Command line: "C:\Program Files (x86)\MKVToolNix\mkvpropedit.exe" "D:\Hollidays\2011-06\01.mkv" --chapters "D:\Hollidays\2011-06\01.xml"
Le fichier est analysé.
Erreur*: Impossible d'ouvrir 'D:\Hollidays\2011-06\01.xml' en lecture.
--------------
File: D:\Hollidays\2011-06\02.mkv
Command line: "C:\Program Files (x86)\MKVToolNix\mkvpropedit.exe" "D:\Hollidays\2011-06\02.mkv" --chapters "D:\Hollidays\2011-06\02.xml"
Le fichier est analysé.
Erreur*: Impossible d'ouvrir 'D:\Hollidays\2011-06\02.xml' en lecture.
--------------
File: D:\Hollidays\2011-06\03.mkv
Command line: "C:\Program Files (x86)\MKVToolNix\mkvpropedit.exe" "D:\Hollidays\2011-06\03.mkv" --chapters "D:\Hollidays\2011-06\03.xml"
Le fichier est analysé.
Erreur*: Impossible d'ouvrir 'D:\Hollidays\2011-06\03.xml' en lecture.
It says "Cannot open file .xml".
My purpose is to get one file with 3 chapters from these three files. Can I create a chapter file with corresponding durations of input files to use in mkvmerge with JMKVpropedit?
A simple OGM style for ex :
CHAPTER01=00:00:00.000
CHAPTER01NAME=01
CHAPTER02=00:01:00.000
CHAPTER02NAME=02
CHAPTER03=00:05:30.000
CHAPTER03NAME=03
Where 01.mkv is 1 minute long and 02.mkv is 4min30sec long (I can do it manually for 3 or 4 files, but not for more than 100).
Thanks.
[ReX]
6th July 2012, 13:49
I don't know where I got the idea that you wanted to just join several MKV files with their respective chapters, oh well, it's a good feature to have anyway... :devil:
Anyway, is this (http://rex-stuff.googlecode.com/files/MKVChap.zip) what you wanted?
jarod5001
7th July 2012, 04:19
Yes, thanks a lot, we're close, I'm so happy :).
I tried it with the first 3 files :
01.mkv > Duration : 00:01:16.928
02.mkv > Duration : 00:00:56.747
03.mkv > Duration : 00:01:13.259
(Used Mediainfo 0.7.58 x64 to get Durations).
I got this chapter file with MKVChap :
CHAPTER01=00:00:00.000
CHAPTER01NAME=01
CHAPTER02=00:01:16.928
CHAPTER02NAME=02
CHAPTER03=00:02:30.187
CHAPTER03NAME=03
Chapter 3 should begin at 00:02:13.675.
Another thing, is it possible to set ChapterName=Filename (without extension)?
jarod5001
7th July 2012, 06:27
I tried another set of files with the same result.
I created a custom template in Mediainfo to get durations :
%FileName%
%Duration/String3%\r\n
Which gave me this result :
Weekend at the beach_001
00:06:38.000
Weekend at the beach_003
00:06:49.000
Weekend at the beach_004
00:06:05.600
Weekend at the beach_005
00:06:11.000
Weekend at the beach_006
00:06:12.000
Weekend at the beach_007
00:06:01.600
Weekend at the beach_009
00:06:07.000
MKVChap created this chapter file :
CHAPTER01=00:00:00.000
CHAPTER01NAME=01
CHAPTER02=00:06:38.000
CHAPTER02NAME=02
CHAPTER03=00:12:43.600
CHAPTER03NAME=03
CHAPTER04=00:18:54.600
CHAPTER04NAME=04
CHAPTER05=00:25:06.600
CHAPTER05NAME=05
CHAPTER06=00:31:08.200
CHAPTER06NAME=06
CHAPTER07=00:37:15.200
CHAPTER07NAME=07
I used a spreadsheet application to sum durations and the chapter file should be like this :
CHAPTER01=00:00:00.000
CHAPTER01NAME=Weekend at the beach_001
CHAPTER02=00:06:38.000
CHAPTER02NAME=Weekend at the beach_003
CHAPTER03=00:13:27.000
CHAPTER03NAME=Weekend at the beach_004
CHAPTER04=00:19:32.600
CHAPTER04NAME=Weekend at the beach_005
CHAPTER05=00:25:43.600
CHAPTER05NAME=Weekend at the beach_006
CHAPTER06=00:31:55.600
CHAPTER06NAME=Weekend at the beach_007
CHAPTER07=00:37:57.200
CHAPTER07NAME=Weekend at the beach_009
[ReX]
7th July 2012, 08:26
I was using some dumb logic to store the total value (I really needed to sleep at the time), should be fixed now.
Now it uses the file name as the chapter name.
Download here (http://code.google.com/p/rex-stuff/downloads/list).
jarod5001
8th July 2012, 11:55
Yeah, it works like a charm. I'm grateful, hope this will be useful for other people.
surlias
22nd September 2016, 16:39
I figured out a pretty simple way to do this, without having to do any text editing or duration summing. The only requirement is that all the files must be MKV format. If your source files are in a different container, just run them all through MKVToolNix real quick to convert to MKV.
First, use MKVToolNix (http://www.videohelp.com/software/MKVtoolnix)'s chapter editor to create an xml chapter file with a single entry at 00:00, which is the default anyways. So if you click "Chapter editor" on the menu bar and select "New", you should get a screen like this, with the Chapter 1 entry at 00:00 auto-populated:
http://s25.postimg.org/lffsko1pb/makemkv1.jpg (http://postimg.org/image/nwrjrxlln/)
Then click on "Chapter editor" on the menu bar again and select "Save as XML file" and name it whatever you want.
Next, download JMkvpropedit (http://forum.doom9.org/showthread.php?t=163753), a slick little java applet that allows you to batch edit mkv metadata.
Launch JMkvpropedit, and Drag and drop all the individual mkv files you want to append together into the window. Then click on the "General" tab and put a checkmark in the box for "Chapters" and click the drop down to select "From file:", which will reveal an empty field with a "Browse..." button next to it. Click on Browse and select the chapter xml file you created earlier. Also, while you're on the "General" tab, you'll probably need to point JMkvpropedit to your mkvpropedit.exe in the MKVToolNix (http://www.videohelp.com/software/MKVtoolnix) directory. Then just click the "Process files" button at the bottom and voila, all the mkv files now have a chapter marker written to them.
http://s25.postimg.org/k1o5pd2fz/makemkv2.jpg (http://postimg.org/image/4g6u5eqhn/)
http://s25.postimg.org/v2jauduov/makemkv3.jpg (http://postimg.org/image/eersrvzx7/)
Now when you append all the files together using MKVToolNix (http://www.videohelp.com/software/MKVtoolnix) GUI, it will automatically adjust the timecodes of each component file's chapter marker during the append process.
sneaker_ger
22nd September 2016, 18:13
No need to resurrect old threads. And: Mkvtoolnix (http://www.videohelp.com/software/MKVtoolnix) 9.0.0 added a feature for this:
http://forum.videohelp.com/attachments/38639-1474560839/mmg_gen_chapters_on_append.png
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.