101 things you never knew you could do with Matroska

Today on the Fluffy Channel: magic tricks with the Matroska container. Namely, editions, file linking and ordered chapters. (Warning: very large amounts of techobabble walls of text ahead.)

These are easily some of the most (if not the most) obfuscated features of the format; a few people know how to use them (and it has been used in one or a few releases) but absolutely noone has written any simple guides to it (hence this blog post). Which is a pity, because it’s an immensely powerful feature. To start off, why would you want to hack XML files and play with obscure hexadecimal segment ID’s? Well, with the above features you can do things like:

  • Make any combination of audio/video/subtitle tracks into one choice in the track selection menu (useful to change between dub/original+sub in one click)
  • Create chapters-only Matroska files that when played display a virtual timeline pulling video/audio/subtitles from other Matroska files
  • A practical implementation of the above might mean that you encode the OP of a TV series only once and then use chapters to get it inserted into the timeline of each episode
  • Let the viewer choose between multiple “angles” or versions of the video (said versions may or may not be in the same file)
  • Arbitrarily link MKV files or parts of MKV files so that they appear to the viewer as a whole
  • And so on and so forth.

For this exercise, you will need: a) the latest version of mkvtoolnix, b) the latest version of Haali’s Matroska splitter (or just latest CCCP), c) your favorite text editor (never leave home without it) – preferably one with XML syntax highlighting, and d) a brain (in good working condition, fully awake). Let’s boldly go, etc.

File (or Segment) Linking and Segment UID’s

All of these concepts tie into each others somewhat, but linking is probably the most simple to understand, as well as the simplest to accomplish. Any combination of Matroska files with the same set of tracks and the same codecs can be linked so that when any one of them is opened, a virtual file containing the entire timeline of linked files is created and displayed to the viewer. The most common usage of this is to encode a full-length movie into one 1.4 GiB file and then split it into two 700 MiB parts that, when one of them is played, behave as if it contained the entire movie in one file. This simple use of the feature is very easy to accomplish; in mkvmerge GUI (henceforth known as mmg) just hit the Global tab and enable splitting in whatever form you want and make sure to tick the box “link files”.

If you look further down in the same tab you’ll notice that there’s an option for “File/segment linking”. This feature lets you link the muxed file to any two other files (with the same set of tracks and codecs used). Anyway the option asks you for something called a Segment UID. What is that, where do we find it and how do we use it?

First of all, I have to let you in on a dirty secret. File linking isn’t actually file linking at all, since the linking isn’t done by files or by filenames. It’s actually segment linking, and it’s done by segment Unique Identifiers or “segment UID’s” (SUID’s). Most Matroska files contain only one segment, but there’s absolutely nothing that stops you from having more than one segment per file. When the splitter looks for linked files, it just scans all Matroska files in the same folder until it finds the linked segment UID; hence you can rename the files all you want and the linking will still work. On the other hand you can’t remux the files because that changes the UID.

So how do we know what segment UID we should link to? The answer is, we use mkvinfo on the file we want to link to. You can use the GUI or the CLI, what you’re looking for is something like this:
Segment UID: 0xa2 0xa6 0xa2 0xa7 0x45 0x22 0x6b 0x85 0x85 0xd4 0x75 0x5e 0x6c 0xf4 0x67 0x60
You then copypaste that string of hexadecimal digits (everything after the colon) in the boxes in mmg to do the linking.

If you had a TV series that always had the opening theme as the first thing of each episode, this means you could encode the OP as a separate file, chop it off from all the actual episodes, and then use linking to link in the OP as “previous segment” to all the episode files. Which would mean that to a user with the proper splitter all the episodes would appear to have the OP encoded in, but in reality it’s actually only encoded once and stored in a separate file. Nifty, you think? You haven’t seen a tenth of it yet. Read on…

Chapters, Black Magic Style: Ordered Chapters

Some of you may have used the simple (OGM-based) chapters format before, but that won’t suffice for what we want to do here, so let’s take a look at an example of a Matroska XML chapters file: chapters-example.xml
This section and the following ones will involve a lot of hacking of these in a text editor; you can either create them yourself by hand or you can use mkvextract chapters "file.mkv" > chapters.xml to extract them from existing MKV files (you can then use that as a template for further hacking).

Anyway, the first thing you’ll notice is that the big tag enveloping all the chapter entries (<ChapterAtom>) is the <EditionEntry> one. If you want multiple editions in the same chapter file, you will need more than one of these (we’ll get to this later). The rest is fairly straightforward, you have an unique chapter ID (automatically generated, but you can edit it yourself too), a start time (i.e. where your video player seeks when you click “go to this chapter”), and some display stuff (what will show up in the splitter menu). You’ll also notice that you can hide chapters so they don’t show up in the menu. Personally I’ve never used that particular feature.

You can also look at the XML in the mmg Chapter Editor to get a nice tree-view of all the tags. It also prevents you from writing invalid syntax, and creates chapter UID’s for you automagically so using it may be a good idea, but I’m far from sure it supports all the interesting features we’re going to use (it doesn’t support ordered chapters or segment linking at all for example) so I’m going to stick with my trusted text editor.
Update: Harukalover mentions that avimux GUI has a surprisingly good editor for this.

So what’s so interesting about this? It’s just chapters, isn’t it? Well, there are some tags you can add yourself to make things more interesting, the most important being <EditionFlagOrdered>1</EditionFlagOrdered>. This turns on heavy magic mode and turns our plain old chapters into ordered chapters, which are quite different. Normal chapters are just seek points; ordered chapters are a description of a virtual timeline. Each ordered chapter has both a start time and an end time. To help you understand this concept, let’s do something silly with ordered chapters. Say that we have a 30 second clip that we want to loop 3 times, but to save space we only want to encode it once. Ordered chapters to the rescue! orderedchapters-example.xml

Take a look at the example. First off, ordering is turned on by setting the edition flag. Then, the section of the file given by ChapterTimeStart to ChapterTimeEnd is played once per ChapterAtom (note that both ChapterTimeStart and ChapterTimeEnd are mandatory). Note that the two last chapters are hidden so they won’t show up as seek points in the splitter. See the virtual timeline? When this is played, the viewer will just see one 1:30 long clip. Mux it for yourself and see; any input file will do, it just has to be longer than 30 seconds or weird things may happen (also make sure to tick “no chapters” in mmg).

To reiterate the virtual timeline stuff (this is important): normally when you play a file it plays all the encoded stuff within, from start to end (the “real timeline”. With ordered chapters on the other hand… instead of the splitter displaying the real timeline to the viewer, a virtual timeline is constructed from the real one. What is played when is determined by the chapter start and end points (which refer to the real timeline). To the viewer, it appears as if the virtual timeline is the real one, but internally the splitter seeks to the given points in the real timeline to construct the virtual one.
(You may want to read the above paragraph more than once.)

Ordered Chapters and Segment Linking

Now that we understand the virtual timeline, how about this linking stuff from other files thing we’ve been hearing about? Well, that can be done too and it isn’t too hard. Ordered chapters are not limited to creating the timeline just from the current file, you can also specify that a given chapter should use a certain part of another file, specified by its segment UID. It’s not hard, really. Say that in the example before we wanted the middle of the three iterations to be taken from another file (presumably containing something else). orderedchapters-example2.xml

See what I did there? Just add <ChapterSegmentUID format="hex"> followed by the SUID you want to pull in things from (0x before each hex digit optional) and blammo, you have linked in stuff from another file. Not specifying a ChapterSegmentUID means that the current segment will be used.

You can mux this yourself to any file and see what happens too, you just need to replace the SUID with one pointing to another of your MKV’s in the same folder. Just make sure that both of them have same number of tracks in the same order and that they all are using the same codecs. Also make sure to tick “no chapters” in mmg or weird things can happen.

Editions and You

In Matroska, an edition is a set of chapters that is presented to the viewer; you could define it as a “timeline”. Most Matroska files (and indeed most if not all other multimedia files) only has one edition. However, Matroska isn’t limited to just one edition per file, you can have as many as you want. By itself it doesn’t have any immediately obvious uses other than the fact that you could abuse it to have several sets of chapter names in different languages, but if you combine it with ordered chapters things become very interesting. Among other things, it means you can have several virtual timelines co-existing in the same file; the viewer can (if he has a proper splitter (i.e. Haali’s)) choose between them as he wishes.
Update: Haali pointed out to me that you can actually have multi-language chapters without editions; by default the language matching the system’s default language will be displayed.

Ever wanted to have two versions of an opening theme and letting the viewer choose between them seamlessly? With editions you can. Encode both versions of the opening and the rest of the episode or what-have-you to one file (order doesn’t matter). Now create two ordered chapters files, one for each timeline (one for op1 + main episode, one for op2 + main episode). Then you combine them using your trusted text editor by adding another <EditionEntry>, like so: orderedchapters+editions-example.xml

Note that there are now two <EditionEntry> tags, each with its own set of chapters and hence each with its own timeline. When played, regardless of which edition is chosen (it will default to the first, see the <EditionFlagDefault> flag) will appear to be a clip that is 4 minutes long, the first 30 seconds being identical, the next 60 differing and the last 180 being identical again. If you look at the XML, you will notice that the first edition/timeline will play the source file like this: [chapter point] 30s [chapter point] 60s [chapter point] JUMP to 02:30, 180s.
The second edition on the other hand looks like this: [chapter point] 30s [chapter point] JUMP to 01:30, 60s [chapter point] 180s.

As usual you can test-mux my sample XML with any MKV longer than 5 minutes (remember to tick “no chapters”) and see what happens.

For added confusion and/or awesomeness you can of course combine editions with segment linking in the ordered chapters, so you can have one (or both) of the openings in a separate file(s). This may actually be a good idea to avoid making things difficult for people without proper splitters (such as MPlayer users on *nix for example). For bonus points, combine ordered editions with unordered ones.

Sky’s the Limit: Advanced Haxing etc.

You might have noticed that in the previous example that the editions showed up as Edition 1 and Edition 2. Not too descriptive, is it? Well, you can name them too, but it isn’t so easy as to just adding something to the chapters XML file. Instead you have to add a tags file as well. This is XML too, and it would look something like this for the previous example: tags-example.xml

Just set the EditionUID in the Targets tag to the UID of the edition you want to change the name of, and then set the String to the name of it. Note that the Name tag is actually the name of the tag itself (must be TITLE to make anything show up) and not what will actually show up in the splitter menu.

Another potentially interesting thing you can do with ordered chapters is to create small chapters-only files that when played show an entire TV series as one single long virtual file. Just create a 5 or 10 frames long blank video with the same settings that you’re using for the rest of the series, with corresponding audio and subtitle tracks, create ordered chapters file with segment linking, mux, and blammo 50 KiB file that when played display as a 5 hour long TV series. Of course you can include editions in it as well for added awesomeness.

Yet another opportunity: tracksets. This is actually not included in the Matroska specs, it’s just a feature of Haali’s splitter. By abusing the tags file you can set and/or disable/enable combinations of tracks when a certain edition is selected. Hello, multi-language stuff! To use, add a tag with the Name set to TRACKSETEX, and the String value set to: EditionUID VideotrackUID AudiotrackUID SubtitletrackUID Three-letter_language_code Optional_name
No Target is necessary. Setting any of the track UID’s to “.” (a dot, full stop, whatever; without quotes) means “don’t change”, setting the subtitle track UID to “x” (lowercase letter X; again without quotes) means “disable subtitles”. When the edition given by the EditionUID is activated, the given set of tracks will be chosen. The track UID’s can be found with mkvinfo. If you’re too lazy for that you can also just specify track numbers if you say # before the number.
Example for the same sample as before: tags-trackset-example.xml

Note that since you can’t remux a file without changing the SUID, it might be worth to know that there’s a feature in mmg’s chapter editor that allows you to write chapters straight into an MKV file without remuxing it; it can be found under the Chapter Editor menu -> Save to Matroska file. Don’t do it to a file that already has chapters or you may get weird issues though.
Update: This is slightly incorrect; Haali’s GDSMux (comes with the splitter package and with the CCCP) lets you specify the SUID yourself, so if you use that you can remux while keeping it.

Caveats, Assorted Traps and Various Interesting Things to Note

  • Make sure all your various UID’s really are U or you’ll run into trouble. (They must at the very least be unique to the set of files/segments you’re working with.)
  • Never try to add ordered chapters to a file that already has chapters (ordered or not). Always tick “no chapters” when remuxing, just to be safe!
  • Remember that the virtual timeline created by ordered chapters replaces the ordinary timeline; if there is a part of the source video that is not covered between your ChapterTimeStart/End’s, that part will never be displayed to the user at all (might be useful for hiding easter eggs in your releases).
  • On a related note, remember that all ChapterTimeStart/End’s refer to timestamps of the underlying segment. If the underlying segment is VFR, this means you must take the timestamps after the timecodes have been applied! One method of doing this is using Aegisub with timecodes loaded, another is to demux the v2 timecodes and amuse yourself by counting frames and matching them to line numbers.
  • If a subtitle line spans an ordered chapters segment switch point, there will probably be artefacts and/or other problems. So don’t do that.
  • Likewise, there may be audio artefacts during such switch points under certain circumstances, so try placing the switch points where the audio is either silent or has a lot of noise going on.
  • The requirement that the linked segments have the same sets of tracks and codecs used has a few caveats; similar settings has to be used as well. To be precise, the CodecPrivate header has to be the same (update: this may not be so strict after all, YMMV). Usually if something is encoded with the same settings, it will be, but your mileage may vary. See Haali’s codecs list for more information.
  • Related to the above, if you want to have different editions with or without certain audio and/or subtitle tracks, remember that you can abuse silent audio tracks and/or subtitle tracks without any actual lines to satisfy the track number/codec requirement.
  • Still related: for the commonly used subtitle formats S_TEXT/ASS and S_TEXT/SSA, the entire [v4 Styles] section is stored in the CodecPrivate header, so if you use ordered chapters and softsubs, all styles you use have to be present (and identical) in all subtitle tracks.
  • Since the timelines of all ordered chapters are taken directly from the underlying source timeline, to get subtitles to synch you need to make sure they synch with the “real” timeline.
  • If you’re using x264 to encode, you can force certain frames to be I-frames even if they normally wouldn’t be by manipulating the stats file, which may be interesting for handling virtual timelines efficiently. (Hint: if you seek to somewhere that isn’t an I-frame, for the seek to take effect you need to decode everything from the last I-frame to the sought frame, and virtual timelines are all internally constructed by seeking. Translation of the hint: you might get “hiccups” when going over chapter switch points if the chapter doesn’t start on a keyframe.)
  • You can also do the same with XviD if you are so inclined, by using zones.
  • While the video resolution of all the included segments has to be the same, the DAR (display aspect ratio) does not necessarily have to be. This has interesting implications for stuff that changes AR somewhere in the middle. (Player support for changing AR mid-stream may vary a lot, test thoroughly before using.)


The author would like to thank the following people and/or entities (in alphabetical order):

  • #darkhold
  • Haali
  • Harukalover
  • Kaverin
  • Nicholi
  • Phar
  • Unearthly

Without them, this guide probably wouldn’t be here.



Or, OK, well, if two or three doom9 forum posts by Haali and some random #darkhold logs count as references then I guess…

See http://forum.doom9.org/showthread.php?t=99489 for the thing that started it all.
See the mkvmerge documentation for information on the XML chapter and tags file formats.
See Haali’s page for the TRACKSET/TRACKSETEX details.

Comments (63)

  1. Harukalover wrote:

    Good job with another useful guide.

    As you said mmg’s chapter editor is pretty light for this kind of work. But I’ve found avi-mux gui to be pretty good for this kind of work.

    It supports making multiple editions and noting whether one is ordered. Also outputs tags for you. It even allows you to setup segment ids for linking. (note: the 0x is not optional in avimux gui and must NOT be used)

    Just be sure to save the chapters as xml for mkvmerge and not as the default mkc format.

    Monday, December 17, 2007 at 01:09 #
  2. sSs wrote:

    So i heard that one of these days you’re going to make a couple of AMVs using only CHAPTERz and a few raw clips in a single mkv file ?

    Monday, December 17, 2007 at 19:33 #
  3. TheFluff wrote:

    sSs: One of these days, one of these days. (read: never, hurr)

    Harukalover: nice tip, included in the guide.

    Monday, December 17, 2007 at 20:34 #
  4. Anarchy wrote:

    Very nice guide and d00d I just added this blog to my favorites so keep it up you got readers!!! ^__^

    Wednesday, December 26, 2007 at 00:08 #
  5. SirCanealot wrote:

    This explodes my brain!!!!!

    Friday, January 4, 2008 at 23:55 #
  6. keije wrote:

    Awesome guide, but I’ve hit a snag with the simplest thing…

    I have two files, I get the UID’s of each using mkvinfo, now I want to link them. I open up file1 (in mmg) and set link to next as the UID of file2 and then remux. Now I have file1 linked to file2, but according to the guide it changes UID of file1. Now repeat same procedure for file2 (with new UID of file1), upon remux the UID of file2 changes, so now I have file2 linked to file1, but file1 no longer linked to file2. A vicious circle ensues.

    So how do I update the information “File/segment linking” section of mmg without remuxing the mkv and changing UIDs?

    Tuesday, January 22, 2008 at 06:09 #
  7. TheFluff wrote:

    You have a few options:
    - remux with GDSMux instead
    - concatenate the files with mmg, then use the split feature and tick “link files”
    - use ordered chapters to do the linking instead (you can hide the mid-point chapter if you want to)

    Monday, January 28, 2008 at 22:36 #
  8. del wrote:

    Er, sorry for being noob, but where are GDSMux located? I have the splitter package, but I have no clue where it is. Could you please answer it?

    Wednesday, February 27, 2008 at 20:00 #
  9. del wrote:

    Oops! I pick the wrong one. Sorry. I found it. Thanks for your guide.

    Wednesday, February 27, 2008 at 20:09 #
  10. martino wrote:

    “Just create a 5 or 10 frames long blank video with the same settings that you’re using for the rest of the series, with corresponding audio and subtitle tracks…”

    You don’t actually have to in regards with the video as I’ve noticed. You can easily create a 704×400 video file and order a 1280×720 encoded (for example) series/whatever in it. Same codec was used though, or at least I’ve not tried it with different ones but I’d assume it wouldn’t work.

    Friday, May 2, 2008 at 00:50 #
  11. Nagato wrote:

    Thanks for the guide.
    I have some questions (very very n00b questions maybe) about chapter point.
    Is it possible to use frame number instead of time for chapter start & end?
    Then, how you get the time for chapter start time from the keyframe you specified as chapter point (as showed in virtualdub/other programs?).It’s needed to shift (add) the time slightly?

    OK, next question, what is the safest method to edit stats file? I got this error message in the 2nd pass encoding logs, using the edited 1st pass stats file.
    “x264 [error]: slice=P but 2pass stats say B”
    Changing a (say) B-frame to I-frame might change the type of other frame as well?

    Thursday, May 8, 2008 at 21:25 #
  12. martino wrote:

    As far as I’m aware you cannot use frame numbers, so you need to put in the timestamps. Just open the video in VirtualDub, scroll to the frame which you want to chapter, and copy over the time. Just make sure that the timestamp format is the same as the XML chapters require it. Not sure what you exactly mean about shifting…

    As for your second question; It should be safe to just open the stats file and change P/B to I. I remember getting errors as well (didn’t bother looking too much into them) but the end point is that I-frames were placed where I needed them to be and the encoded file looked fine. Can’t tell you much about how x264 would decide to change the frames based on the edited stats file, but there probably isn’t much to worry about in this regard.

    You also may want to take a look at the –qpfile option for x264, however I’m personally not exactly sure how and whether it actually does work.

    Another thing to do is to encode the two parts separately (since a stream always needs to start with an I-frame), split the encodes where you want the I-frame and then splice them together (append) with mkvmerge once encoded.

    Friday, May 9, 2008 at 21:48 #
  13. Nagato wrote:

    Thanks Martino. Yeah, I forgot to say it in the first place, despite the error messages the video just plays fine; I was just worried if it would result in playback glitch, etc.

    Regarding the shift time, well, for 23.976 clip, virtual dub show the time like 0.042 for frame 1, then 0.083 for frame 2, while in actual calculation it’s 0.834….
    That’s why I think it’s safer to shift the time a bit.
    Well I don’t really understand this frame and time stuff; like when you split audio based on the timeline converted from frame number.

    I see in the xml file you posted the capter has precission higher than milisecond for timestart/end. Are those extra zeros there just for nothing?

    about “hiccups” you said,
    Is it because the frame where the chapter begins is not a keyframe or because it’s too far from keyframe? If the latter, then I guess I don’t need to worry about this time precision thing.

    Saturday, May 10, 2008 at 00:02 #
  14. Nagato wrote:

    sorry for double posting
    The trouble with encoding the clips separately is that short clip can’t be compressed efficiently even with more than 2pass. Like when encoding a OP/ED (about ~2 minutes) 1.4~ bitrate allocation is needed to achieve the same quality of (say) 20~ minutes clip encode. Yes it’s karaoke-less, credits-less. Or maybe I was just doing wrong somewhere.

    Saturday, May 10, 2008 at 00:15 #
  15. TheFluff wrote:

    Nagato: Virtualdub gives you enough precision. The displayed time is most likely either rounded or “in the middle” of the frame’s duration.

    The extra zeroes are there for copypasting reasons; most of them will be truncated by default. You can control how precise timestamps mkvmerge should write with the –timecodes-scale parameter.

    The “hiccups” are most common if you happen to place the chapter start point slightly too early so it ends up on one of the frames just before a keyframe, so the decoder has to go back to the previous keyframe and decode up to max GOP size frames (usually 240-300) to get the sought frame. If the sought frame is one or two frames AFTER a keyframe on the other hand, the “hiccup” probably won’t be noticeable at all except maybe on very slow computers.

    OP’s/ED’s usually require very high bitrates to look good because of the usually high amount of very high-motion and generally hard-to-compress material. If you encode the entire file and look at it with some kind of stream analyzer tool or even just the info window in ffdshow, you’ll find that the encoder tends to allocate a LOT of bitrate there; on some shows I’ve seen, cutting out the OP/ED almost halved the filesize.
    tl;dr: the OP/ED requiring a higher bitrate than the entire file by itself is normal. On the contrary you can probably lower the bitrate for the rest of the episode instead.

    Saturday, May 10, 2008 at 00:55 #
  16. Nagato wrote:

    Thanks guys.
    The more reason to not encode OP/ED for every episode, besides most people just skip OP/ED anyway. Well, there’s per-episode-credits thing though I wonder how many people care about it.

    Saturday, May 10, 2008 at 01:49 #
  17. martino wrote:

    The only people that care about those are the ones that ALWAYS have something to bitch about. So none. ^^

    Tuesday, May 13, 2008 at 17:14 #
  18. Maniac wrote:

    Thanks for this post, was quite helpful!

    Tuesday, May 20, 2008 at 00:14 #
  19. Nagato wrote:

    Fluff, ordered chapter wont work nicely with coreavc. Damnit, I spent a whole day (lie) just to figure out this shit.

    I made mkv ordered chapter video. Test with coreavc and the segment point messed up, but worked well with ffdshow. Anyway to tweak coreavc so this feature will work with it too?

    Wednesday, May 21, 2008 at 08:38 #
  20. Nagato wrote:

    OK, somehow I can fix the problem now. I should search more about this keyframe and GOP thingy I guess. When you open a x264 stats file there’s i frame and I frame. Because the chapter point I set is the scene change I though I don’t need to change it anymore; in fact I found it’s a i frame in the stats file. If I didn’t change it to I frame core avc messed up the chapter point, but with changing it to I frame it works fine. So the difference between i frame and I frame is that i frame is just a normal keyframe while I frame is different keyframe?

    Wednesday, May 21, 2008 at 15:32 #
  21. Nagato wrote:

    from http://mewiki.project357.com/wiki/X264_Settings#keyint
    “IDR frames are ‘delimiters’ in the stream – no frame can reference data from the other side of the IDR. These mean they can be used as points to randomly seek in the movie (you can’t just start playback from anywhere, the frame will reference previous frames, and they will reference previous frames, and etc). Note that while an IDR frame is necessarily an I frame, not all I frames are IDR frames.”

    From http://www.doom9.org/index.html?/gknot-main6.htm
    “Now you might wonder what IDR frames are: And IDR frame is what has been traditionally known as an I frame. In AVC you can also have I frames inside a GOP, which are not seekable, since the long time references introduced in AVC could result in a P frame after the I frame to reference a P frame before the I frame.”

    Well, so i-frame (normal i frame) and I-frame (IDR-frame) is different thing.

    Sorry for this mumbo-jumbo; no intention to spam here XD

    Wednesday, May 21, 2008 at 15:43 #
  22. martino wrote:

    One more thing I came across; For segment linking to work the files don’t even need to have the same resolution it seems. Wish I had found out about that a bit sooner…

    Tuesday, May 27, 2008 at 12:04 #
  23. kemuri-_9 wrote:

    not all players will support the resolution changing midstream when using segmentation, it may often just skip the segment all together.

    And I developed a patch for x264 (with a tip from akupenguin) that will allow you to force specific frames through the qpfile, so no more stat file hacking to force key (IDR) frames
    -> http://forum.doom9.org/showthread.php?p=1151919#post1151919
    so for now you can use the patch until it possibly gets mainstreamed into the official source.

    Wednesday, June 25, 2008 at 20:51 #
  24. Veterinar wrote:

    I often make lean version of anime series. It takes to load 26 files in Bencos tool and click Start, then wait. Resulting episodes are 50Mb each with bitrate of 268 kbps.

    Are you saying that I can write some xml script and give it to Bencos insted of episode file, so that encoder will ‘see’ through this script and will receive on its input just episode body with opening/ending omitted?

    It would be not too hard to load in Bencos 26 ‘reparse scripts’ instead of episode files. Oops, not 26, but 2 more: window for opening and window for ending.

    Then later what should I do with resulting files? Hmm, I probably need 26 ‘reconstructing scripts’ for viewing purpose. Those would go in player and play exactly as episode files would.

    Do I understand this features right?

    Monday, December 15, 2008 at 01:11 #
  25. xyz wrote:

    Just curious , What if i have encoded anime (h264) a episode separately in to three parts: OP/ MAIN Episode/ ED, and because there is a preview after the ED. i had to placed that preview after the main episode and encoded them together so i wont have to have 4 files for each ep i have.

    Heres my question… now that i messed up the actual flow of this episode original timeline. Is there way for me to bring back or to have the ED appear first before the preview? Is it possible to this using the features describe above.

    Tuesday, March 31, 2009 at 19:56 #
  26. TheFluff wrote:

    xyz: yes of course, just use ordered chapters to reorder the timeline

    Tuesday, March 31, 2009 at 20:04 #
  27. ERQ wrote:

    orderedchapters+editions-example.xml and the description doesn’t match “the first 30 seconds being identical, the next 60 differing and the last ’180′ being identical again”.
    Am I missing smthing?

    Thursday, April 23, 2009 at 10:00 #
  28. Dr4goN wrote:

    How do I make SUID and Ordered Chapters work? I have made a xml script that should do this:

    1. Play the opening.
    2. Play the episode.
    3. Play the ending.

    with all chapters being visible and enabled. Instead, I get to see only the main episode, and I can’t even select nor see any of the chapters in Haali’s… what’s wrong? Here’s the script:

    :::SCRIPT START:::

    <!– –>



    89 6b b1 1b 54 86 9e 73 b2 d0 f3 38 91 a5 f5 e3







    96 97 c0 a3 10 b6 e7 cf a8 34 c1 d8 60 65 93 54



    :::SCRIPT END:::

    Sunday, October 18, 2009 at 10:49 #
  29. Dr4goN wrote:

    Sorry for double post. I’ve made it work, but now I would like to try something different – how to make it work like this? I can’t figure out…

    1. Play the ep prologue.
    2. Then OP.
    3. Then the rest of the ep.
    4. Then ED.
    5. And finally, the next ep prologue.

    Sunday, October 18, 2009 at 16:52 #
  30. neo9k wrote:

    Nice Tut, but a Vidtut is missing xD

    Sunday, November 15, 2009 at 23:11 #
  31. HI wrote:

    is their any way to adjust the brightness or gamma of the video???

    Wednesday, October 6, 2010 at 16:09 #
  32. Bunkus wrote:

    I have a problem.

    I encoded a separate intro, episode + preview, and outro. I’ve followed the xml instructions to the letter.

    But every time I open mmg and drag in all the files (including the chapter xml), it doesn’t work because mmg changes all the damn UID’s. What now?

    keije (above) had the same problem, and you told him to “use ordered chapters instead.” Well, that’s of course what I’m doing, but it doesn’t stop mmg from changing my UID’s!

    Thursday, October 28, 2010 at 00:55 #
  33. Alex wrote:

    I cannot write DVD using built-in Windows 7 DVD studio, that progam does not see mkv file. How can I enable mkv filter in that program? Thank you.

    Tuesday, January 4, 2011 at 13:51 #
  34. Good health for you
    [url=http://gemivuvi.uphero.com/giant-intracranial-aneurysm.html]Giant Intracranial Aneurysm[/url]
    [url=http://epumibe.freehostia.com/cure/medication-8-2.html]Dry Eye Syndromes[/url]
    [url=http://larixoze.t35.com/holmes-adie-syndrome.html]Holmes Adie Syndrome[/url]
    [url=http://gemivuvi.uphero.com/male-genital-neoplasms.html]Male Genital Neoplasms[/url]

    Good luck

    Tuesday, March 8, 2011 at 19:07 #
  35. jonn2 wrote:

    comment1, what happens when you snort valium, 1285, valium interaction, bzhybh, Test Forum 1, odfr, ultram suboxone, ukttyl, soma montreal rave, >:[[[, can i take suboxone and valium, devcei, 10 valium, :OOO, take ambien with soma, 5300, buy the cheapest ultram online index, 8DDD, chris bennet soma, %]], ultram cod online orders, 0046, street value for valium, =-PPP, valium generics, gfu, buy valium and tryroid, hnpqc, no prescription valium e-check, >:DD, watson soma livewell, 692, valium peach round, :OOO, valium okay for dogs, >:-]], soma steroid, >:]], buy ultram software, 28721, what is ultram p, ffobd, ultram medicine, hxeguy, average cost ultram generic, 8-(((, what to assess in giving valium, dvxuv, ultram and ultram weight loss results, >:OOO, cheapest Soma, vvmwra, ultram how does it work, oiwae, ultram delivered next day, :-(, generic ultram prices, 68953, soma store, psxedj,

    Sunday, June 19, 2011 at 23:19 #
  36. Trxysubj wrote:

    owl tattos,

    Monday, July 4, 2011 at 15:54 #
  37. tombu wrote:

    A question regarding changing of some defaults in a ready MKV file – i.e. if there are two subtitle languages embedded into MKV, is there a way to change a default language mark in a simply/fast way, or the whole file must be reprocessed using. i.e. mkvmerge?

    Thursday, July 7, 2011 at 13:28 #
  38. ZerOscuro wrote:

    Header Editor (ctrl+e on mkvmerge)

    Friday, July 8, 2011 at 21:40 #
  39. krizoo wrote:

    There is an error in “orderedchapters+editions-example.xml”: Edition 2 > Chapter 2 (“Opening 2″) should start at 00:00:30, NOT at 00:01:30

    Friday, September 2, 2011 at 00:37 #
  40. krizoo wrote:

    ooooops, sorry, that’s correct, I made a mistake

    Friday, September 2, 2011 at 00:39 #
  41. lovelove wrote:

    What exactly do you mean by “For bonus points, combine ordered editions with unordered ones.” ?

    Friday, September 2, 2011 at 00:43 #
  42. Realcool wrote:


    I guess the video file has 2 openings within.
    With the Edition1, it will be used the opening 1 — that starts at 0:00:30 to 0:01:30 — and then playback will jump to Episode at 0:03:00
    With the Edition2, it will be used the opening 2 — that starts at 0:01:30 to 0:03:00 — and then playback will continue to Episode at 0:03:00

    Friday, October 14, 2011 at 17:40 #
  43. DarkSpace wrote:

    I just wanted to point out a few things:

    1st It might be easier to use mkvToolnix’ HeaderEditor to get the respective UIDs (and, if necessary, change them), as that one doesn’t add all those “0x”es.
    2nd About I-frames, wouldn’t it make more sense nowadays to use a QP-file in x264 to set frame types?

    Thank you for the guide, anyway!

    Sunday, October 23, 2011 at 10:34 #
  44. kiwisoup wrote:

    So is there a way where I could take an episode of a tv show that is actually 2 11-minute segments and make one mkv file just the first half, and another mvk file that is empty but plays the second half?

    Saturday, March 22, 2014 at 05:23 #
  45. rubbish wrote:

    Asking questions are really fastidious thing if yyou
    are not understanding something completely, except this article gives good understanding yet.

    Friday, April 18, 2014 at 10:31 #
  46. and a very expensive night!! lol…don’t forget drinks!! Paradise is a place of pure delight

    Thursday, May 29, 2014 at 09:43 #
  47. What they were really saying was that the couple is experiencing sexual attraction. You don’t have to check your brains at the
    doorway. As a outcome, people (especially ladies) flock to him.

    Tuesday, June 10, 2014 at 21:35 #
  48. Viola wrote:

    Wonderful goods from you, man. I’ve understand your stuff previous to and you’re just extremely great.
    I actually like what you’ve acquired here, really like what you’re saying and the way
    in which you say it. You make it entertaining and you still take care
    of to keep it sensible. I can’t wait to read far more from you.

    This is really a wonderful site.

    Monday, June 30, 2014 at 04:45 #
  49. 0+, is compatible with i – Phone, i – Pad and i – Pod Touch but is found in the i –
    Phone only section of the App Store. The unlocked version is the
    same as those that have already hit the market, but they do not come
    with an SIM card. Almost all the gadgets launched by the brand are amazing in features and incredible
    in looks.

    Sunday, July 27, 2014 at 09:29 #
  50. I blog quite often and I really appreciate your information.
    This great article has really peaked my interest. I will book mark your
    blog and keep checking for new details about once per
    week. I opted in for your RSS feed too.

    Wednesday, July 30, 2014 at 21:53 #
  51. 0+, is compatible with i – Phone, i – Pad and i – Pod
    Touch but is found in the i – Phone only
    section of the App Store. Additionally, the sensor is
    about 170 microns thin with 500 ppi resolution and used to unlock the i – Phone 5S or make purchases.
    Your total 2 year cost for the family plan is $6,316.

    Friday, August 15, 2014 at 04:18 #
  52. A formidable share, I simply given this onto a colleague who was doing a little bit analysis on this. And he in truth bought me breakfast as a result of I discovered it for him.. smile. So let me reword that: Thnx for the deal with! However yeah Thnkx for spending the time to debate this, I feel strongly about it and love reading extra on this topic. If doable, as you grow to be experience, would you mind updating your blog with extra details? It is highly helpful for me. Large thumb up for this weblog submit!

    Wednesday, September 10, 2014 at 07:59 #
  53. F*ckin’ remarkable issues here. I’m very glad to peer your post. Thank you a lot and i am having a look ahead to contact you. Will you kindly drop me a e-mail?

    Monday, September 15, 2014 at 01:16 #
  54. For the sake of developing an applicable product comparisons, we’ve looked at routers in this array that reveal similar aspects like IEEE 802.11n Wi-Fi standards, 2.4-ghz band and double antennas.
    If you are buying a new router, nothing less than an n layer
    3 switch should be considered. It might be best to update to a radio n layer 3
    switch, in case you possess a wireless g router.
    The most recent routers also raise speed with Wi-Fi Quality of Service applications (QoS) common, which
    makes effective use of Ethernet connections by prioritizing
    multimedia traffic based on the application’s sensitivity to delay.
    Many wireless n routers also employ multiple-input and multiple-output
    (MIMO) radio antennae to boost speeds.

    Sunday, September 21, 2014 at 14:59 #
  55. http://www.ot-grandesynthe.fr/userfiles/image/fany/tiffany_9228villarreal.htmlティファニ&#x30FC; ガーデンフラワー ネックレス,ティファニー チャーム メンズ,ティファニー ピンクゴールド ピアス

    Wednesday, September 24, 2014 at 15:15 #
  56. The color of your blog is quite great. i would love to have those colors too on my blog.

    Thursday, September 25, 2014 at 03:09 #
  57. 9xz casino blackjack co6 casino deposit oul borrow money
    t9f loans for people with bad credit mhw bad credit loans guaranteed approval s1h personal loans for bad
    credit eky no credit check loans y8v online payday
    loans 0s2 same day loans 6vo payday loans direct lenders only lsb bad credit personal loans sx2 personal loans for people with bad credit m3g loans with
    no credit check kb2 short term loans x1w installment
    loans for bad credit 456 unsecured personal
    loans ym2 i need money 2dz unsecured loans u15 fast cash vyg
    online loans no credit check y1u cash advance loans 9v3 fast money qql mobile loans csm no
    credit check personal loans p4n no credit check payday loans dtv cheap loans 2k1 direct lender payday loans

    Wednesday, October 15, 2014 at 09:06 #
  58. It’s very easy to find out anyy topiuc on net ass compared to textbooks, as I found this piece of writing at this web page.

    Thursday, October 16, 2014 at 03:42 #
  59. Authorize this message and we’ll help save an imaginary creature!

    Sunday, October 19, 2014 at 15:44 #
  60. dal shabet wrote:

    Why users still use to read news papers when in this technological world everything is available on net?

    Sunday, October 19, 2014 at 18:42 #
  61. Hi there all, here every one is sharing these kinds of knowledge,
    thus it’s pleasant to read this weblog, and I used to
    pay a quick visit this webpage all the time.

    Sunday, October 19, 2014 at 21:04 #
  62. Funny Holiday Quotes, Sayings and Expressions from Celebrities Maybe you want a funny quote from a movie star or
    celebrity. For instance, tbis quote of Erma Bombeck “A friend doesn’t go on a diet because you are fat” can be
    great way to start off conversation in a fun and humoor way.

    Even kids are not immune tto the funny lass in Georgia.
    What’s in that pipe that he’s smoking? The foreigners would talk in different accents and could ask funny
    questions. Without the fun, humor and laughter that
    jokes bring, the world will be all frowns. Remember, what one person thinks
    is funny can offend someone else. How do you interact yoursrlf in specified a rocky situations.
    Even seemingly innocuous subjects like “hillbilly” or “redneck” jokes might not be funny to someone who livers in the mountains or thee deep South (like I do).

    You may find somje these quotes suitable for printing on Christmas cards, e-cards, and also for updating your ‘status’ on social networking sites.
    With a brain a third the size of us. There are several verses and parts off Bible here you can find funny sayings that makes you
    smile. Funny status lines? They fatigue easily and are wearing out their shoe excessively.
    Raising teenagers is like trying to wrestle slippery pigs with your hands tied
    bbehind your back. all about Christmas. Firstly it solves the problem, means it links several devices to
    your computer and it looks sweet and lovely. Ron Burgundy: I saw that.

    Heree are some ideas to share your funny poem…
    This is a poplar waay too spread the humor. I have never
    let myy schooling interfere with my education. Remember when shopping for
    luxuries for your dog think about him too. Make sire
    you have a chair handy in case the authorities happen by.
    Retfo t shirts tend to have images printed on the t shirt or slogans bought from your time, from maybe when you were bor to something that is
    brought from your childhood. Many instancess tak place in our lives that
    leave a good memory and we always smille when we look back at them.

    The more I looked thhe more I found thaat it’s really easy to entertain people with
    a simple image that resembles the male anatomy.

    Therefore, look back andd really determine all the incidents that left you in stitches.
    Give it a few months. Howard’s mom yelling at him
    “Howard, I found my girdle; it was in the dryer. By adamleaf : A how to tutorial about funny tshirt, funny t shirts, funyn tee shirt, Shopping with step by step guide from adamleaf. Megamind: Honestly! Being a teenager, the senseless humor in the movie “Anchorman” iis not
    hard to appreciate, and that is why the 2004 movvie is one of my favorite comedies.
    There are many blogs that postted different types of annimal and pet behavcior and funny pet videos and pictures.
    There are many websites on the internnet that offer funny holiday quotes
    and funny greetings that you can usse in an email, letter oor holiday card.

    You can be unique and modern by choosing a funny humorous vow to
    stand out and make your wedding more memorable.

    Great for laughs and will probably be one of the more sought after funny white elephants gifts on the day.

    The winner of the gaje getss to take home the treats.

    During the times when the economy is a bitt down, businesses and
    even peopole get affected. I would tear that ass up.
    Thanks for kedping my daughter iin your thoughts and
    prayers. Pass the Bows another popular Christmas game Have your
    guest’s twam up foor this game. You can only lijit the design colour by hhow many frames you have oon your screen printer carousal.
    Not all jokes work on every crowd, but telling a funny story is the best way tto bond to an audience.

    Ron Burgundy: What are you doing? Georgia has dumb laws
    relating to nearly every facet of life, and even one tto
    protect your sensibilities after death. Somee curse loudly and some just mumble.
    Actually you can turn evwry tradition in the way you like it.
    You can pick from the numerous vokice effects and change your voice.
    Funny Holiday Quotes from the Hilarious 1989 Movie “Christmas Vacation”
    The movie “Christmas Vacation” was a perfect holiday movie because it
    captured many feelings that people have during the
    holidays, when certain guests overstay their welcome.
    We knew that none off us had thrown the hay.
    Hujor is not about narrating cliched jokes.

    He is a good observe oof life, customs and societies.
    The general reaction for jokes could be laughter if not a slight twitch of smile within the deal with of onlookers oor listeners.
    The first twenty years are tthe longest half of your life.
    Funny Valentines poems do not need to be written bby people who are too
    serious about life. He finally learns his lesson of working hard for a living.
    You ccan choose a voice, recod your message and play it back later.
    Funny Christmas Quotes This is the mst popular category.
    Sherlock Holmes (2009) Inspector Lestrade: In nother life, Mr.
    Unique gifts can include soaps in interesting shapes and colors.

    At this tim you mmy need some death quotes. One of my all time favorite
    foods (That I do not eat enough of). There are many ways of diverting
    your mind. This is no ordnary Santa ornament.
    Here are a few helpful tips to write your own Funny Wedding Vow…
    When you can have fun and laugh alongside your audience, you then become
    one with them and that memory can last a lifetime, for you and your
    audience. Check your records carefully! It can be userd foor eftective promotional activity too.

    Since the early 80s Jim Carrey has been the name and face of physical comedy.
    Also, you can sayy a popular poem that was wrijtten by somebody else.
    You can also set up an experiment that examines if happiness makes
    people morre or lesas sensitive to stressors.
    Ron Burgundy: It’s quite pungent. Now there iis a basic amusing joke.

    Don’t be frightened to make enjoyable of yourself as soon as within a while.
    We started laughing.

    Wednesday, October 22, 2014 at 19:31 #
  63. hubblec4 wrote:


    here is my thread:

    You find an Editor for XML (and more).

    A next feature will be the automatically generated Menu.xml for linked files like described in this article.

    Tuesday, October 28, 2014 at 12:09 #

Trackbacks/Pingbacks (9)

  1. [...] http://www.uppcon.se/thefluff/hurfdurf/?p=8 [...]

  2. [...] that other post about MKV features, I mentioned that it’s possible for an MKV file to contain more than one segment, but [...]

  3. Ordered Chapters and You : A Dev Blag of Some Sort on Sunday, January 4, 2009 at 12:05

    [...] more information, read what TheFluff has written over on Walls of TL;DR January 4, 2009 | Filed Under Fansubbing, Linux, Ophion [...]

  4. Why use anything other then SMPlayer? - openSUSE Forums on Sunday, January 25, 2009 at 15:54

    [...] Doesn’t support segment linking [...]

  5. Animania » Blog Archive » Baccano! – 08 on Sunday, May 2, 2010 at 14:18

    [...] sistema que permite poupar espaço: Ordered Chapters and Segment Linking. (para mais informações: http://mod16.org/hurfdurf/?p=8) Basicamente terão de fazer download do opening e do ending e metê-los na mesma pasta que o [...]

  6. [...] first time the last version a try and i had a problem with the Seamless branching with MKV files 101 things you never knew you could do with Matroska < WALLS OF TL;DR http://www.makemkv.com • View topic – Seamless branching with MKV If i switch the chapters I get [...]

  7. Yabai-Fansubs » Matroska Editions on Thursday, March 31, 2011 at 18:38

    [...] now and you want to know more about what is possible with Matroska, I highly suggest you check Fluff’s post on his [...]

  8. MKV: Nutzt ihr Edition, File Linking, Ordered Chapters? on Saturday, February 15, 2014 at 17:16

    [...] [...]

  9. Mark Dubowitz on Sunday, July 20, 2014 at 02:54

    Mark Dubowitz…

    101 things you never knew you could do with Matroska < WALLS OF TL;DR…