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 Display Modes
Old 18th October 2007, 08:59   #1  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
Linking external file in Matroska

A friend of mine asked me following question, which I couldn't answer, so I'm hoping to get an answer here. He told me he heard that it is possible to include an external file in Matroska. Sounds strange, I know, I'll try te explain you the idea.

Let's say there are TV series all with the same intro. His idea was to make a file containing only the intro and then have the episodes without intro. But when he starts one of the episode, the intro will play first and then continue with the episode.

Is it possible? If yes, then how could it be done?
vlada is offline   Reply With Quote
Old 18th October 2007, 10:32   #2  |  Link
Daodan
unrecognized user
 
Join Date: Oct 2005
Location: home of Stella Artois
Posts: 303
Ordered chapters would be most elegant (runtime appears as if it's full there etc), but linking can work as well (in mmg you have a box for that), but this way you won't be able to add a file in the middle of another let's say.
__________________
zzz
Daodan is offline   Reply With Quote
Old 19th October 2007, 00:43   #3  |  Link
Nicholi
Registered User
 
Join Date: Apr 2003
Location: Lancaster, CA
Posts: 89
Quote:
Originally Posted by Daodan
Ordered chapters would be most elegant (runtime appears as if it's full there etc), but linking can work as well (in mmg you have a box for that), but this way you won't be able to add a file in the middle of another let's say.
You can of course use ordered chapters together with segment linking in order to place something "in the middle" of a file.
Nicholi is offline   Reply With Quote
Old 19th October 2007, 08:09   #4  |  Link
Daodan
unrecognized user
 
Join Date: Oct 2005
Location: home of Stella Artois
Posts: 303
Quote:
Originally Posted by Nicholi View Post
You can of course use ordered chapters together with segment linking in order to place something "in the middle" of a file.
That IS what I said actually. Was refering to the fact you can't do that in mmg's easier to use "link dialog".
__________________
zzz
Daodan is offline   Reply With Quote
Old 20th October 2007, 19:59   #5  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,200
open an mkv file, Haali icon appears on toolbar, double click it > options > input > try to open linked files > yes

just dont ask me how to link them, maybe this has to be done at the muxing stage in mkvmerge? I guess some kind of info is needed so that the episode file needs to know which file to open at the beginning, before the episode is displayed itself.

Last edited by Thunderbolt8; 20th October 2007 at 20:01.
Thunderbolt8 is offline   Reply With Quote
Old 21st October 2007, 16:56   #6  |  Link
Unearthly
Encoder in Training
 
Unearthly's Avatar
 
Join Date: Mar 2007
Location: Massachusetts
Posts: 37
Since I couldn't find any good instructions when trying to do this myself, I'll go ahead and lay out the steps to creating an mkv that uses Ordered Chapters.

Step 1: Find the Segment UID of the files you want to externally link. Run mkvinfo on the file to find the SUID.

Step 1a: If your file does not show a SUID (for example, if your file came straight out of x264), then you will need to remux with mkvmerge. The SUID should show up then.

Step 2: Create your chapters file. Below is an example with a single edition which has 5 chapters, 2 of which are actually external files.

Code:
<?xml version="1.0" encoding="UTF-8"?>

<!-- <!DOCTYPE Tags SYSTEM "matroskatags.dtd"> -->

<Chapters>
  <EditionEntry>
    <EditionFlagOrdered>1</EditionFlagOrdered>
    <EditionFlagHidden>0</EditionFlagHidden>
    <EditionFlagDefault>0</EditionFlagDefault>
    <EditionUID>2572935589</EditionUID>
    <ChapterAtom>
      <ChapterDisplay>
        <ChapterString>Internal Part 1</ChapterString>
        <ChapterLanguage>und</ChapterLanguage>
      </ChapterDisplay>
      <ChapterUID>1</ChapterUID>
      <ChapterFlagHidden>0</ChapterFlagHidden>
      <ChapterFlagEnabled>1</ChapterFlagEnabled>
      <ChapterTimeStart>00:00:00.000000000</ChapterTimeStart>
      <ChapterTimeEnd>00:00:08.341675008</ChapterTimeEnd>
    </ChapterAtom>
    <ChapterAtom>
      <ChapterDisplay>
        <ChapterString>External File 1</ChapterString>
        <ChapterLanguage>und</ChapterLanguage>
      </ChapterDisplay>
      <ChapterUID>2</ChapterUID>
      <ChapterFlagHidden>0</ChapterFlagHidden>
      <ChapterFlagEnabled>1</ChapterFlagEnabled>
      <ChapterTimeStart>00:00:00.000000000</ChapterTimeStart>
      <ChapterTimeEnd>00:00:08.341675008</ChapterTimeEnd>
	  <ChapterSegmentUID format="hex">0xbb 0x5c 0x5c 0x1a 0x9f 0x02 0xb2 0xce 0x8c 0x19 0x54 0x50 0x91 0x16 0x95 0x42</ChapterSegmentUID >
    </ChapterAtom>
    <ChapterAtom>
      <ChapterDisplay>
        <ChapterString>Internal Part 2</ChapterString>
        <ChapterLanguage>und</ChapterLanguage>
      </ChapterDisplay>
      <ChapterUID>3</ChapterUID>
      <ChapterFlagHidden>0</ChapterFlagHidden>
      <ChapterFlagEnabled>1</ChapterFlagEnabled>
      <ChapterTimeStart>00:00:08.341675008</ChapterTimeStart>
      <ChapterTimeEnd>00:00:16.66</ChapterTimeEnd>
    </ChapterAtom>
    <ChapterAtom>
      <ChapterDisplay>
        <ChapterString>External File 2</ChapterString>
        <ChapterLanguage>und</ChapterLanguage>
      </ChapterDisplay>
      <ChapterUID>4</ChapterUID>
      <ChapterTimeStart>00:00:00.000000000</ChapterTimeStart>
      <ChapterTimeEnd>00:00:08.341675008</ChapterTimeEnd>
      <ChapterFlagHidden>0</ChapterFlagHidden>
      <ChapterFlagEnabled>1</ChapterFlagEnabled>
	  <ChapterSegmentUID format="hex">0xb9 0x58 0x7b 0x0a 0x6e 0x32 0x3a 0x16 0x99 0x7b 0x55 0x07 0x64 0x52 0x50 0x1e</ChapterSegmentUID >
    </ChapterAtom>
    <ChapterAtom>
      <ChapterDisplay>
        <ChapterString>Internal Part 3</ChapterString>
        <ChapterLanguage>und</ChapterLanguage>
      </ChapterDisplay>
      <ChapterUID>5</ChapterUID>
      <ChapterFlagHidden>0</ChapterFlagHidden>
      <ChapterFlagEnabled>1</ChapterFlagEnabled>
      <ChapterTimeStart>00:00:16.66</ChapterTimeStart>
      <ChapterTimeEnd>00:00:25.025025025</ChapterTimeEnd>
    </ChapterAtom>
  </EditionEntry>
</Chapters>
The "ChapterSegmentUID" is what signals that the given chapter is an external file. If the tag isn't present, it will assume that it is part of the muxed mkv.

Step 3: Remux with the new chapters file. When you play the file it should link everything together as long as they are in the same directory.
Unearthly is offline   Reply With Quote
Reply

Thread Tools
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 01:31.


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