I am using VirtualDubMod to create H264 .MKV videos with, muxing the AC3 from a DVD. But Id like to add chapters. And I dont know how they are built.
From what I am reading, it is an XML file. Does the filename matter?
Is the below a proper formatted XML for an MKV chapter list?
Id like to write a quickie VB6 proggie that I can tell it the length of a movie I am encoding, and how many chapters to insert, and have it gen me an XML file to IMPORT into VDubMod.Code:<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Chapters SYSTEM "matroskachapters.dtd"> <Chapters> <EditionEntry> <ChapterAtom> <ChapterTimeStart>00:00:00.000</ChapterTimeStart> <ChapterTimeEnd>00:00:09.999</ChapterTimeEnd> <ChapterDisplay> <ChapterString>Chapter 1</ChapterString> <ChapterLanguage>und</ChapterLanguage> </ChapterDisplay> </ChapterAtom> <ChapterAtom> <ChapterTimeStart>00:00:10.000</ChapterTimeStart> <ChapterTimeEnd>00:00:19.999</ChapterTimeEnd> <ChapterDisplay> <ChapterString>Chapter 2</ChapterString> <ChapterLanguage>und</ChapterLanguage> </ChapterDisplay> </ChapterAtom> <ChapterAtom> <ChapterTimeStart>00:00:20.000</ChapterTimeStart> <ChapterTimeEnd>00:00:20.999</ChapterTimeEnd> <ChapterDisplay> <ChapterString>Chapter 3</ChapterString> <ChapterLanguage>und</ChapterLanguage> </ChapterDisplay> </ChapterAtom> </EditionEntry> </Chapters>
One last thing, the time...
The format "00:00:20.999" doesnt make sense to me.
Is this "Hours:Minutes:Seconds:Miliseconds" ??
Thanks,
Andrew
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 23 of 23
Thread
-
-
First you would have to extract the chapter using ChapterXtractor from the DVD, then use MKVtoolnix to remux it all together. Or you can use AnyDVD with Handbrake to encode to MKV yielding all all the steps.
-
Thanks for the prompt response, but your off track of what I want to do. I hope a more advanced digital video user can offer assistance.
Thanks,
Andrew -
Originally Posted by RogerTango
One last thing, the time...
The format "00:00:20.999" doesnt make sense to me.
Is this "Hours:Minutes:Seconds:Miliseconds" ??
===================
Actually, Jjmon's advice is not too far off. Handbrake is a great tool for getting the chapters from the DVD without having to go through all the script writing. It seems like you're trying to re-invent the wheel. No need to get so condescending. -
I use AutoMKV which imports the chapters automatically into the final MKV file.
--dES"You can observe a lot by watching." - Yogi Bera
http://www.areturningadultstudent.com -
Can someone tell me if this would be a valid chapter list??
Code:<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Chapters SYSTEM "matroskachapters.dtd"> <Chapters> <EditionEntry> <ChapterAtom> <ChapterTimeStart>00:00:00.000</ChapterTimeStart> <ChapterDisplay> <ChapterString>Chapter 1</ChapterString> <ChapterLanguage>eng</ChapterLanguage> </ChapterDisplay> </ChapterAtom> <ChapterAtom> <ChapterTimeStart>00:10:00.000</ChapterTimeStart> <ChapterDisplay> <ChapterString>Chapter 2</ChapterString> <ChapterLanguage>eng</ChapterLanguage> </ChapterDisplay> </ChapterAtom> </EditionEntry> </Chapters>
I am fiddling with the VB code now..
Thanks,
Andrew -
For more information, follow this thread:
https://forum.videohelp.com/topic363433.html
Here is a download link to the stand alone version for all Win32 and 64 flavors:
http://rogertango.com/download/rtmkvcm-standalone.zip
Just unpack the ZIP, and run the executable (.EXE).
Andrew -
Andrew,
Thanks so much for this -- this was *exactly* what I needed for my BR rips (I don't really care about the chapters on the disc so much as I just want "stops" I can go to with my WDTV).
I'm not so sure why my MKV files come out slightly smaller when I mux chapters into them (using MKVMERGE) but I don't really care. Thanks again for this utility which now has a place on my desktop."Like a knife, he cuts through life, like every day's his last" -- Mr. Kiss Kiss Bang Bang -
There is also a simpler chapter format which mkvmerge understands and which looks like this:
CHAPTER01=00:00:00,000
CHAPTER01NAME=Auto chapter 1
CHAPTER02=00:14:48,000
CHAPTER02NAME=Auto chapter 2
Code:#!/usr/bin/perl ## Make chapters file for MKV use strict; my $VERSION=0.01; my $file = shift; my $parts = shift || 10; unless (-e $file) { die "Usage: $0 FILENAME [number_of_chapters]\n"; } my ($h, $m, $s) = (0,0,0); # Find length using either mediainfo or ffmpeg if (my $info = `mediainfo "$file" 2>/dev/null`) { ($h, $m) = $info =~ /^Duration \s+ : \s* (\d+)h \s* (\d+)m /mx; unless ($h || $m) { die "*** Error: Could not get duration from mediainfo output.\n"; } } elsif (my $info = `ffmpeg -i "$file" 2>&1`) { warn "FFmpeg: ", $info, "\n"; ($h, $m, $s) = $info =~ /^ \s* Duration: \s* (\d+):(\d+):(\d+)/mx; unless ($h || $m) { die "*** Error: Could not get duration from ffmpeg output.\n"; } } else { die "No mediainfo or ffmpeg program found\n"; } my $seconds = $h*3600 + $m*60 + $s; my $step = int($seconds/$parts); my $chapter = 1; for (my $i=0; $i < $step*($parts-1); $i+=$step) { my $c = sprintf "%02d", $chapter; print "CHAPTER$c=", seconds2tc($i) . ",000", "\n", "CHAPTER${c}NAME=Auto chapter $chapter\n"; $chapter++; } sub seconds2tc { my $s = shift; my $h = sprintf "%02d", int( $s / 3600 ); $s %= 3600; my $min = sprintf "%02d", int( $s / 60 ); $s %= 60; $s = sprintf "%02d", $s; return ( wantarray ? ($h, $min, $s) : join(":", $h, $min, $s) ); }
-
This Perl script is quite close to my needs, but I'm noob for programming. Maybe someone can help me and write something similar. Actually, I need a script or app that will create simple MKV chapter file based on duration of input MKV files that I want to join latter. For example, I want to join my home videos made by digital camera. All scenes are recorded in separate files, that's the way how my camera works. Now, from these recordings I want to create a single movie of one event, but I also want to put chapter mark at the beginning of each recording.
Does anybody know how can I do this? -
mihvel
You should be able to do everthing you have asked using mkvmerge GUI.
For example imagine I had three separate files
file1, length=2m 43s 560ms
file2, length=2m 06s 120ms
file3, length=2m 44s 880ms
the following will join them together and add chapters.
Load mkvmerge GUI
File - New
Click Input tab:
Add (open file1)
Append (open file2)
Append (open file3)
Chapter Editor - New Chapters
Click Chapter Editor tab:
Highlight (new chapter file)
Add Chapter
Highlight EditionEntry1
Add Chapter
Add Chapter
Highlight first chapter
Start: 00:00:00.000
End: 00:02:43.560
Name: Video1
Highlight second chapter
Start: 00:02:43.560
End: 00:04:49.680
Name: video2
Highlight third chapter
Start: 00:04:49.680
End: 00:07:34.440
Name: video3
Click Set Values
Set language to: eng (English)
Set country to: uk
Chapter Editor - Save
my_chapters.xml
Click Global Tab
Chapters file: (Browse and open my_chapters.xml)
Start Muxing
Note: You could also add sub chapters if you wish so you could play a particular start and end point within a chapter.
Hope it helps.Last edited by Martin894; 20th Aug 2010 at 18:46.
-
Martin894, thanks for reply, but that's not exactly what I mean. I'm aware that I can do it manually, using mkvmerge GUI, but I want to do this automatically, using some script capable to read length of the input files and to create a chapter file.
Anyway, thank you for the try. -
Does anyone know where to get a copy of Roger Tango's MKV chapter tool? His links on his site are not working and neither is his page for contacting him.
-
I have 1st gen WD HDTV player. If you hit FF button, then Next button, it will jump ahead 10 minutes.. or to the next 10 minute interval.. not sure. Trouble with that thing is soft subs easily go out of sync if you do more than Pause/Play. I usually burn them in for that reason.
I'm looking to go the other way. Extract a chapter file from an .mkv then convert it to HH:MM:SS that DvdAuthorGui uses.
At this point I have a small AutoIt3 script but I have to preprocess the xml with Opera and save as text to get the xml elements on separate lines. Just easier to pick out the chapter start times that way.
I have files for 5 minute, 8 minute and 10 minute intervals for use in DvdAuthorGui but I thought it would be cool to go to the chapters set in the original, when outputting to DVD. There are tools like BD Rebuilder that do it all for me, but I'm messing around with using HCgui manually to encode to DVD.
Seems to be tough to find general-purpose xml parsers.
Just thought I'd chime in since it's related.
I'll download your tool for my video toolbox.
If I get my AutoIt3 script so that it works stand-alone without passing the xml through Opera then I'll post it for everyone to access.
edit: I tried the compiled script on a couple of .mkv chapter files produced by MkvExtractGui-2 and it worked fine. If anyone would like to use it you can download from my site using this link:
http://www.favessoft.com/HmsTimes.zipLast edited by MilesAhead; 26th Nov 2010 at 19:21.
http://milesaheadsoftware.org/
Fully enabled freeware for Windows PCs. -
mihvel: just in case you are still monitoring this forum, I had a very similar requirement to yours so created a program called MKVChapterCreater. You can download it here:
http://code.google.com/p/mkv-chapter-creater/downloads/list
It requires ffmpeg to be present.Last edited by bobn; 5th Jun 2012 at 08:58.
-
-
I am indeed using ffmpeg to determine duration having pinched the idea from the earlier perl script. It's written in VB Net. I'll upload the source code shortly. (I should also have acknowledged the fact that I have used SSDiver2112's gListView control available here: http://www.codeproject.com/Articles/34676/gListView-ListView-Control-with-Visual-Drag-and-Dr.)
-
I have updated my original post with a link to the download directory rather rather to the file itself which is more useful in case I ever update the program (which I have just done so to include a readme file). For convenience here is the link:
http://code.google.com/p/mkv-chapter-creater/downloads/list -
Thanks for the wonderful little program, it works like a charm for me
-
Okay for a follow up, the video length that were detected for all my video have had ending like this: 4:12.0xxx, where the first digit after the decimal were always 0, which is definitely wrong
Similar Threads
-
MKV XML chapter file creator
By perdigueiro in forum LinuxReplies: 3Last Post: 30th Jan 2012, 08:44 -
mkv chapter file problem
By Bully9 in forum EditingReplies: 12Last Post: 22nd Mar 2010, 18:06 -
MKV chapter file extraction problems
By ikarishinji41 in forum EditingReplies: 1Last Post: 22nd Mar 2010, 11:03 -
How to create chaptering in MKV or Xvid video file ?
By c1steady in forum Newbie / General discussionsReplies: 1Last Post: 7th Jan 2010, 11:38 -
Any way to create streaming video with chapter points or menu navigation?
By Persistence in forum Video Streaming DownloadingReplies: 3Last Post: 5th Jun 2009, 20:24