[Fwd: [Matroska-devel] USF muxing]

Christian HJ Wiesner <[email protected]> Sun, 22 May 2005 10:27:41 +0200
Newsgroups gmane.comp.multimedia.usf.devel
Message-ID <[email protected]>
FYI, in case you are not subscribed to matroska-devel
-------- Original-Nachricht --------
Betreff: 	[Matroska-devel] USF muxing
Datum: 	Sun, 22 May 2005 09:47:59 +0200
Von: 	Moritz Bunkus <[email protected]>
Antwort an: 	Discussion about the current and future development of=20
Matroska <[email protected]>
An: 	[email protected]



Hey guys,

as Chris has already announced I've just implemented the first version
of an USF subtitle reader and muxer into mkvmerge. It hasn't been tested
a lot, the format it uses is DEFINITELY not meant for "production" etc
etc etc.

Here I want to give an overview of how it muxes USF into Matroska. This
is meant as a basis for debate -- I don't know all that much about USF
subs in the first place, and there may be better ways regarding how to
store it inside Matroska.

I'm attaching the example file that Alex No=E9 has uploaded for me. I'll
refer to that.

So here it goes.

1. XML data is stored both in CodecPrivate and the blocks themselves.

2. The XML metadata (not the <metadata> element!): Stuff like the style
   sheet definition or the XML header is dropped. The <USFSubtitles>
   root element is dropped as well.

3. CodecPrivate. At the moment all but the <subtitles> elements beneath
   the <USFSubtitles> root element are copied into the CodecPrivate as
   they are. White spaces are stipped. The CodecPrivate will contain the
   <metadata>, <styles> etc nodes among others (basically really all
   that mkvmerge encounters safe for the <subtitles> element).

   This also means that the order in which the elements occured in the
   source file is destroyed. unmei said that order doesn't matter, and I
   hope it doesn't, so this shouldn't be a problem.

4. Each <subtitles> element is converted into one Matroska track. Each
   <language> element is converted into Matroska's language header
   field. The <languageext> element is dropped at the moment. Apart from
   the <subtitle> elements all other unknown elements beneath
   <subtitles> are dropped as well.

5. Each <subtitle> element is copied into one Matroska data block. The
   <subtitle> ... </subtitle> tags themselves are kept at the moment
   although I guess that they can/should be removed. The "start=3D" and
   "stop=3D" attributes of the <subtitle> element are stripped and
   converted into the start and duration of the Matroska data block. (The
   <subtitle> ... </subtitle> tags can be removed if there are no other
   attributes apart from "start=3D" and "stop=3D". Comments?)

6. Subtitles and CodecPrivate are compressed with ZLIB by default. This
   can be turned off manually by adding "--compression 0:none" on the
   command line before the input file or in the GUI.

7. CodecID is "S_TEXT/USF" at the moment, but as Chris pointed out, USF
   may also contain images. So maybe "S_USF" might be more
   appropriate. Comments?

8. mmg has been updated to list files with the extensions ".usf" and
   ".xml" for USF subtitles.

Here's the link:
http://www.bunkus.org/videotools/mkvtoolnix/win32/pre//mkvtoolnix-unicode=
-1.4.2-build20050522-1.rar

Comments more than welcome :)

Mosu

--=20
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds





-- Attached file included as plaintext by Ecartis --
-- File: SimpleSample.usf

=EF=BB=BF<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<!-- DOCTYPE USFSubtitles SYSTEM "USFV100.dtd" -->
<?xml-stylesheet type=3D"text/xsl" href=3D"USFV100.xsl"?>
<USFSubtitles version=3D"1.00">
	<metadata>
	 <resolution x=3D"640" y=3D"480"></resolution>
	</metadata>
  <styles>
		<style name=3D"Default">
			<fontstyle face=3D"Tahoma" family=3D"Tahoma" size=3D"22" color=3D"#7FF=
FFFDF" outline-color=3D"#FF002953" outline-level=3D"6" shadow-level=3D"0"=
 back-color=3D"#7F007FFF"/>
			<position alignment=3D"BottomCenter" vertical-margin=3D"50%" relative-=
to=3D"Window" horizontal-margin=3D"2%"/>
		</style>
		<style name=3D"title">
			<fontstyle size=3D"36" color=3D"#FFBF00" outline-color=3D"#D20000" fac=
e=3D"Tahoma" family=3D"Tahoma" outline-level=3D"3" shadow-level=3D"0"/>
		</style>
		<style name=3D"credits">
			<fontstyle color=3D"#008000" outline-color=3D"#FFBF00" face=3D"Tahoma"=
 family=3D"Tahoma" outline-level=3D"2" shadow-level=3D"0"/>
		</style>
	</styles>
	<subtitles>
		<language code=3D""></language>
		<languageext code=3D""></languageext>
		<subtitle start=3D"00:00:01.120" stop=3D"00:00:04.112">
			<text>Was?! Ist das wahr, Drachen-G=C3=B6ttin, Jade?</text>
		</subtitle>
		<subtitle start=3D"00:00:06.120" stop=3D"00:00:09.112">
			<karaoke><k t=3D"1000"/>Was?! Ist das wahr, <k t=3D"1000"/>Drachen-G=C3=
=B6ttin, <k t=3D"992"/><font  back-color=3D"#7FDF0000">Jade?</font><k t=3D=
"1"/></karaoke>
		</subtitle>
		<subtitle start=3D"00:00:09.400" stop=3D"00:00:11.356">
			<text>Ja, ich bin mir sicher,<br/>Drachen-Meister.</text>
		</subtitle>
		<subtitle start=3D"00:00:11.640" stop=3D"00:00:13.870">
			<text>Meine blinden Augen<br/>haben in die Zukunft gesehen.</text>
		</subtitle>
		<subtitle start=3D"00:00:14.160" stop=3D"00:00:16.913">
			<text>Alexiel wird auferstehen...!</text>
		</subtitle>
		<subtitle start=3D"00:00:17.200" stop=3D"00:00:21.876">
			<text>Aber ihre Auferstehung bringt f=C3=BCr<br/>"Assiah", die physisc=
he Welt,</text>
		</subtitle>
		<subtitle start=3D"00:00:22.160" stop=3D"00:00:24.594">
			<text>eine nicht wiedergutzumachende<br/>Katastrophe mit sich.</text>
		</subtitle>
		<subtitle start=3D"00:00:25.320" stop=3D"00:00:27.356">
			<text>Und verge=C3=9Ft nicht,</text>
		</subtitle>
		<subtitle start=3D"00:00:27.640" stop=3D"00:00:31.952">
			<text>die Auferstehung von Alexiel<br/>bedeutet f=C3=BCr Setsuna Mudo =
den Tod.</text>
		</subtitle>
		<subtitle start=3D"00:00:33.280" stop=3D"00:00:35.953">
			<text>Tod? Setsuna wird sterben?</text>
		</subtitle>
		<subtitle start=3D"00:00:36.880" stop=3D"00:00:40.270">
			<text>"Es tut mir leid, aber<br/>jetzt kann ich nichts f=C3=BCr dich t=
un."</text>
		</subtitle>
		<subtitle start=3D"00:00:44.800" stop=3D"00:00:47.394">
			<text>Ist mir doch egal, was aus ihm wird!</text>
		</subtitle>
		<subtitle start=3D"00:00:48.120" stop=3D"00:00:51.192">
			<text>Mir reicht es,<br/>wenn Alexiel zur=C3=BCckkommt.</text>
		</subtitle>
	</subtitles>
	<metadata>
		<title>Angel Sanctuary - OVA 2 (deutsch)[kraut]</title>
		<author>
			<name>[kraut]</name>
			<task>rip, typeset</task>
		</author>
		<date>2003-10-27</date>
		<language code=3D"deu">Deutsch</language>
		<comment>Freigegeben ab 16 Jahren.<br/><br/>Angel Sanctuary ist graphis=
ch ein typisches CLAMP-Werk, die Thematik um Geschwisterliebe und Welten/=
Himmel/H=C3=B6llen ist jedoch sehr erwachsenenorientiert.<br/><br/>DVD-Ba=
cktext:<br/>Angel Sanctuary:<br/>Alexiel, h=C3=B6chster und geliebtester =
Engel des Himmels, verb=C3=BCndet sich mit einem Heer von D=C3=A4monen, f=
=C3=BChrt eine Rebellion gegen Gott - und verliert den entscheidenden Kam=
pf.<br/>Gefangengenommen und eingeschmolzen in Engelskristall wird Alexie=
l's Seele in dem Erdenjungen Setsuna Mudo wiedergeboren, ohne dass dieser=
 etwas von seinem Schiksal ahnt. Den 16-j=C3=A4hrigen Sch=C3=BCler, der s=
eine leibliche Schwester Sara liebt, wie es einem Bruder untersagt ist, q=
u=C3=A4len mehr und mehr Horrorvisionen, als Engel und D=C3=A4monen auf d=
ie Erde str=C3=B6men um Alexiel wiederzuerwecken. Im Angesicht des Kampfe=
s auf Leben und Tod entwickelt Setsuna pl=C3=B6tzlich =C3=BCbernat=C3=BCr=
liche Kr=C3=A4fte.<br/>Wird die Liebe zwischen Sara und Setsuna den Zorn =
des Himmels und der H=C3=B6l
 le =C3=BCberstehen?<br/><br/>Mysik und Religion, verpackt in einer drama=
tischen wie actionreichen Story um eine leidenschaftliche, aber verbotene=
 Liebe - das ist die Geschicht von Angel Sanctuary.<br/><br/>(c) Kaori Yu=
ki / Hakusensha / Angel Sanctuary Commitee<br/>(p) 2003 OVA Films</commen=
t>
	</metadata>
</USFSubtitles>

-- Attached file included as plaintext by Ecartis --
-- File: file:///C|/DOKUME%7E1/V-CC/LOKALE%7E1/TEMP/nsmail.tmp

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQBCkDkyTJ9OsraNuaERAg3+AJ46JEk7v/rShdBaSyKhCNcXyFAyVQCfcdcR
oLfg5BJo5MkqMTw1eqWaAqI=3D
=3DtL++
-----END PGP SIGNATURE-----


-- Attached file included as plaintext by Ecartis --
-- File: file:///C|/DOKUME%7E1/V-CC/LOKALE%7E1/TEMP/nsmail-2.txt

_______________________________________________
Matroska-devel mailing list
[email protected]
http://lists.matroska.org/cgi-bin/mailman/listinfo/matroska-devel



http://usf.corecodec.org