I have ripped a dual layer DVD that has a concert divided into two separate parts. Everything ended up in one Video TS folder. I then used Handbrake to convert the concert into two separate MKV files, including their chapters. Handbrake identified that there were multiple DVDs in the Video TS folder and allowed me to convert them into MKVs separately.
However, when I try to use MKVToolNix to merge the two MKVs into a single file, the chapters gets screwed up everytime. I add the first MKV and then use the Append button to add the second MKV, which produces a perfectly good single MKV file with the video and audio all in their correct places one after the other. Even so, the chapters from the second MKV simply refuse to act like the video and audio and append themselves to the first MKV file. All I get are the chapters from the first MKV spread over the entire length of the combined MKV, with the second file's chapters lost in action.
What process do I have to follow to get the chapters from the two MKVs to merge in their correct order and then mux into the single combined MKV file?
Please be exacting and walk me through this step by step. I am assuming that MKVToolNix can do this but maybe I am wrong. I am horrible with command line options, so let's do it the good old GUI way!
It seems to me that I used to be able to extract chapter files individually from an MKV using this program but now all I get is errors whenever I try to do it. I load the MKV into the program and then uncheck the video and audio checkboxes, leaving only the chapters with a checkmark but it refuses to do what I want.
I have managed to extract each DVDs chapters using a program called ChapterXtractor but I don't know how to merge them into a single file or keep them in the correct order. I have included them in this post as txt files and I am hoping someone knows how to merge them into a single chapter file that MKVToolNix will recognise and that I can then mux them into my otherwise completed MKV concert file.
Thanks so much for your help guys and gals, too!
I have also uploaded a text file with the chapters combined (as best as I could) in simple time format. Perhaps someone knows how to convert this combined file into something MKVToolNix will recognise (Ogg or XML) and allow me to thereby mux it into my concert .mkv file.
Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or try PlayON and record Netflix, HBO, Hulu, etc! :)
+ Reply to Thread
Results 1 to 13 of 13
Last edited by Todd Sauve; 19th May 2015 at 07:20.
MKVMergeGUI is getting confused, given you have a single text file containing the correct chapters, you should be able to append the two MKVs, de-select the existing chapter tracks, then under the Global tab add the new chapter file in the chapters section. That should work.
You can't extract chapters the way you described, but you can extract chapters from MKVs with MKVcleaver or gMKVExtractGUI. When you extract them as a text or ogg chapters file, they should look like this:
The chapter name can be whatever you like. ie:
The above is a format MKVMergeGUI will understand. It can be a text file, but you need to add it under the Global tab. It shouldn't be too hard to modify your existing chapters file to the above format.
Last edited by hello_hello; 19th May 2015 at 07:57.
I just tried what you suggested and got the following error message:
Error: Simple chapter parser: 'CHAPTER08=01:21:18:680' is not a CHAPTERxx=... line.
So here is the chapter file I just tried to mux into my concert, with the "chapters" checkbox unchecked and the new chapters file added according to your instructions under the Global tab.
To get my new chapters file I used ChapterXtractor to extract them in the OGG format with a .txt ending. Then I just copied and pasted them end for end, making allowance for the new timings. Something is not working right and I've been up all night trying to make this work. Now I can't even think straight and have to go to bed. I must have messed up the new timing code somewhere, as it says Chapter 8 is the culprit.
Can you look over all of my files, including the timing info from my first post, and see if you can find out why I'm getting this error message?
I've done something wrong but am at a loss as to what it is.
Here is what they look like inside the .txt file:
Hopefully it is something simple that someone will recognise right away. Chapter 8 is where the two discs change, with chapter 8 being the first chapter on the second disc.
Thanks so much for your help Hello!
Last edited by Todd Sauve; 19th May 2015 at 08:54.
According to the chapters file I just extracted, the format is
From chapter eight on, you've used a colon instead of a full stop. I assume that's the problem.
Don't feel bad. I sometimes get errors from Avisynth and it usually tells you where to look in the script so I look and I look and I look..... and it's usually something simple like that.
By the way, I think you're missing a chapter. If the first chapter from the second file is at the beginning, it's effectively at the end of the first half, and the first half duration is 59:07.040 (according to the info in the text file), so there should be a chapter at 00:59:07:040. The next one should be 22:12.040 on from there, which I make out to be at 01:21:19.080...... 59 minutes + 22 minutes = 1 hour 21 minutes with another 19 seconds and 80 milliseconds..... but thinking in minutes and seconds hurts my brain so don't take that as gospel......
I think you timed the chapters for the second half according to the last chapter in the first file, the one that was skipped, but it's not quite at the end of the first half, apparently. The timing difference would only be about 1 second anyway. Either way though, you're probably missing a chapter.
Last edited by hello_hello; 19th May 2015 at 09:32.
OK, thanks muchly Hello! I'm so glad your fresh set of eyes noticed my mistakes here! Once I've got a few more hours of sleep under my belt I'll make these changes and see if they work. I'm sure they will!
PS I didn't use a colon, the ChapterXtractor program put them in there instead of the simple period. All I did was copy and paste, so there is a bug in that program, too! Oh the joys of finding bugs in apps!
Last edited by Todd Sauve; 19th May 2015 at 11:02.
Maybe I should have mentioned it before, but if you happen to have MeGUI it has a Chapter Creator under the Tools menu that extracts chapters from DVDs in the correct format for MKVMergeGUI to play with. I've never used it for MKVs before, but it appears it'll also extract chapters from them. There's possibly a standalone version but I've not looked.
You'll still need to adjust the timing for the second half to create one large chapter file. I tried appending two MKVs with chapters and the result was the same, the chapters didn't append properly. MKVMergeGUI does indicate the chapters aren't being appended, because there's no double plus sign next to the chapters track as there are for the rest of the tracks. That seems odd to me. MKVMergeGUI can append MKVs with subtitles without a problem (I'm pretty sure) so I'm not sure why it doesn't append chapters. Maybe I'd just assumed it could, but I tried a few older versions and none of them appended the chapters.
Anyway, chances are the chapters in the individual MKVs are fine (the ones created by Handbrake) and if you extracted them with MKVcleaver or gMKVExtractGUI they'd at least extract in an MKVMergeGUI friendly format.
OK, I fixed the problems you noticed and now everything muxed together properly. Thanks again!
It is very strange that we can mux everything nicely by using the Append button except for the chapters. Like you, I wonder why?
Last edited by Todd Sauve; 19th May 2015 at 22:24.
The penny dropped just as I hit the submit button on this post so I wrote another one. I think the explanation for the lack of chapter appending might be there, but there's still a bit of useful info in this one. If you check my theory and discover anything of interest, please let me know.
I'll was going to ask about the chapters problem in the MKVToolnix thread at doom9 but maybe there's no need now.
I looked at MeGUI's chapter creator yesterday thinking it might do some clever editing, but not so much, and unfortunately it didn't occur to me to remember MKVMergeGUI's chapter editor until I started writing this post as I've never used it. I just had a look at it and it can adjust the timecodes of a chapters file by a specific amount, which would have been handy yesterday for adjusting them all together.
It'll only save chapters file in XML format which contain a lot more information. If you load a text chapter file and save it as XML it goes from looking like the chapters in post 2 to the ones below. Chapters can have sub chapters, they can be enabled and disabled individually (a player is supposed to skip a disabled chapter), the end of a chapter doesn't have to be where the next one begins (I don't think) and you can create ordered chapters where chapters can be in different files completely (as long as those MKVs are linked, I assume). All chapter features I've never used, but I thought maybe MKVMergeGUI would append XML chapters correctly, however no...... still no luck.
There's probably a reason it won't append them and I strongly suspect it's related to ordered chapters in some way.
<!-- <!DOCTYPE Chapters SYSTEM "matroskachapters.dtd"> -->
Last edited by hello_hello; 20th May 2015 at 03:28.
I think the penny dropped just as I submitted my last post.
I'm pretty sure it's do so with the chapters having ChapterUID's. For chapters to "append' correctly those ID's need to be unique and therefore my testing method yesterday was flawed. I took a file with chapters, copied it, and then appended the copy to the original. I'm pretty sure that didn't work as expected as the chapters in each file would have had the same ChapterUID.
So I made a copy of the MKV first this time, remuxed the original and the copy while adding the same text chapter file to each one (MKVMerge should give each chapter a unique ID when muxing if they don't have one), and then I tried appending the remuxed MKVs. Bingo! The appended file had appended chapters. They didn't show as "appending" in the track list along with the rest of the files, but they were effectively appended the same way.
Which begs the question...... why wasn't it working that way for you? I've no idea except that it must relate to the ChapterUID, which is supposed to be unique for each chapter..... hence the name...... and maybe Handbrake is creating MKVs with chapters that don't have unique chapter IDs for some reason. You could try switching to MKVMerge's chapter editor tab, loading one of the MKV's in question via the chapter editor menu and clicking on one of the chapters being shown. Do they appear to have ChapterUIDs? If so, are they actually unique?
Last edited by hello_hello; 20th May 2015 at 03:40.
i know this is a topic that is searched very often, and because this thread is near the top of Google results, I wanted to post even though this thread is old.
If you have two files you want to append, the first with chapters 1-15 and the second with chapters 1-12, you need to put the second file into the Chapter Editor in MKVToolNix and rename the chapters so they are 16-27. Then save.
Now when you append two files, the chapters will combine in the new file.
I have tested this. Changing chapter names does nothing. Only changing chapter UIDs helps, then it will even append with chapters that have the same names.