Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st June 2012, 01:52   #1  |  Link
jarod5001
Registered User
 
Join Date: Oct 2001
Posts: 5
Joining multiple files to an MKV file with automated chapters

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.
jarod5001 is offline   Reply With Quote
Old 28th June 2012, 02:57   #2  |  Link
[ReX]
Registered User
 
Join Date: Jul 2007
Posts: 151
A little late, but I have added that for JMkvpropedit v1.0.9.


Last edited by [ReX]; 28th June 2012 at 17:17.
[ReX] is offline   Reply With Quote
Old 5th July 2012, 02:46   #3  |  Link
jarod5001
Registered User
 
Join Date: Oct 2001
Posts: 5
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 :

Quote:
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 :

Quote:
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.
jarod5001 is offline   Reply With Quote
Old 6th July 2012, 13:49   #4  |  Link
[ReX]
Registered User
 
Join Date: Jul 2007
Posts: 151
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...

Anyway, is this what you wanted?
[ReX] is offline   Reply With Quote
Old 7th July 2012, 04:19   #5  |  Link
jarod5001
Registered User
 
Join Date: Oct 2001
Posts: 5
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 :

Code:
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)?

Last edited by jarod5001; 7th July 2012 at 05:49.
jarod5001 is offline   Reply With Quote
Old 7th July 2012, 06:27   #6  |  Link
jarod5001
Registered User
 
Join Date: Oct 2001
Posts: 5
I tried another set of files with the same result.

I created a custom template in Mediainfo to get durations :

Code:
%FileName%
%Duration/String3%\r\n
Which gave me this result :

Code:
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 :

Code:
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 :

Code:
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
jarod5001 is offline   Reply With Quote
Old 7th July 2012, 08:26   #7  |  Link
[ReX]
Registered User
 
Join Date: Jul 2007
Posts: 151
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.
[ReX] is offline   Reply With Quote
Old 8th July 2012, 11:55   #8  |  Link
jarod5001
Registered User
 
Join Date: Oct 2001
Posts: 5
Yeah, it works like a charm. I'm grateful, hope this will be useful for other people.
jarod5001 is offline   Reply With Quote
Old 22nd September 2016, 16:39   #9  |  Link
surlias
Registered User
 
Join Date: Nov 2014
Posts: 1
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'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:



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, 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 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.




Now when you append all the files together using MKVToolNix GUI, it will automatically adjust the timecodes of each component file's chapter marker during the append process.
surlias is offline   Reply With Quote
Old 22nd September 2016, 18:13   #10  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
No need to resurrect old threads. And: Mkvtoolnix 9.0.0 added a feature for this:
sneaker_ger is offline   Reply With Quote
Reply

Tags
chapters, mkv

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:02.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.