<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.xiph.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Michaelni</id>
	<title>XiphWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.xiph.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Michaelni"/>
	<link rel="alternate" type="text/html" href="https://wiki.xiph.org/Special:Contributions/Michaelni"/>
	<updated>2026-06-09T06:16:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=Oggless&amp;diff=8321</id>
		<title>Oggless</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=Oggless&amp;diff=8321"/>
		<updated>2008-02-04T12:34:49Z</updated>

		<summary type="html">&lt;p&gt;Michaelni: Update link to prevent breakage when svn.mplayerhq txt is removed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
This page documents how to embed the different Xiph codecs like Vorbis or Theora in containers other than Ogg.  It&#039;s still in the drating stage, and most of it was taken from the [http://svn.mplayerhq.hu/nut/docs/oggless-xiph-codecs.txt?view=log&amp;amp;pathrev=577 MPlayer SVN], authored by Michael Niedermayer.&lt;br /&gt;
&lt;br /&gt;
==Current Version==&lt;br /&gt;
* 2007-07-21&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
Misses information on how to convert losslessly from one format to another, as well timestamping of Ogg.  Regardless, it is mostly finished and likely won&#039;t be further updated.&lt;br /&gt;
&lt;br /&gt;
==Minimum container requirements==&lt;br /&gt;
This appendix only explains how to store Xiph codecs in containers which &lt;br /&gt;
support at least one global header per stream, can separate individual codec packets and in principle support the codec, so for example in the case of Vorbis that would be variable bitrate and variable number of samples/packet.  Storage in other containers is outside the scope of this appendix.&lt;br /&gt;
&lt;br /&gt;
===Global header:===&lt;br /&gt;
If the container can store 3 headers per stream in an unambiguous and ordered way then they shall be stored in that way, if OTOH the container is only capable to store a single global header then the 3 codec headers shall be concatenated without any additional header, footer or separator between them to recover the 3 headers from such a global header the following procedure shall be used:&lt;br /&gt;
: 1) search for the 1st occurrence of ID1 the found match and the following ID1_LEN bytes are the 1st header packet&lt;br /&gt;
: 2) search for the 1st occurrence of ID2 after here&lt;br /&gt;
:: 3) read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
:: 4) [user_comment_list_length] = read an unsigned integer of 32 bits&lt;br /&gt;
:: 5) iterate [user_comment_list_length] times {&lt;br /&gt;
::: 6) read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
:: }&lt;br /&gt;
:: 7) skip 1 byte&lt;br /&gt;
: 8) the match in 2) and what follows until here is the 2nd header packet&lt;br /&gt;
: 9) search for the 1st occurrence of ID3 after here the matching part and what follows is the 3rd header packet&lt;br /&gt;
&lt;br /&gt;
====Constants:====&lt;br /&gt;
{|&lt;br /&gt;
! Codec&lt;br /&gt;
! ID1&lt;br /&gt;
! ID2&lt;br /&gt;
! ID3&lt;br /&gt;
! ID1_LEN&lt;br /&gt;
|-&lt;br /&gt;
| Vorbis&lt;br /&gt;
| 0x01,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039;&lt;br /&gt;
| 0x03,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039;     &lt;br /&gt;
| 0x05,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039;&lt;br /&gt;
| 23&lt;br /&gt;
|-&lt;br /&gt;
| Theora&lt;br /&gt;
| 0x80,&#039;t&#039;,&#039;h&#039;,&#039;e&#039;,&#039;o&#039;,&#039;r&#039;,&#039;a&#039;&lt;br /&gt;
| 0x81,&#039;t&#039;,&#039;h&#039;,&#039;e&#039;,&#039;o&#039;,&#039;r&#039;,&#039;a&#039;&lt;br /&gt;
| 0x82,&#039;t&#039;,&#039;h&#039;,&#039;e&#039;,&#039;o&#039;,&#039;r&#039;,&#039;a&#039;&lt;br /&gt;
| 35&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the container needs an identifier for the global header, for example a 4cc for a global header chunk then glbl shall be used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Storing packets:===&lt;br /&gt;
Each codec packet shall be stored in exactly one &amp;quot;container packet&amp;quot; and one &amp;quot;container packet&amp;quot; must not contain more then one codec packet &amp;quot;container packet&amp;quot; here means the smallest separatable unit of data in the container.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Codec Identifier:===&lt;br /&gt;
{|&lt;br /&gt;
! xiph-codec&lt;br /&gt;
! 4-cc id&lt;br /&gt;
! long id&lt;br /&gt;
|-&lt;br /&gt;
| Vorbis      &lt;br /&gt;
| vrbs        &lt;br /&gt;
| vorbis&lt;br /&gt;
|-&lt;br /&gt;
| Theora&lt;br /&gt;
| ther&lt;br /&gt;
| theora&lt;br /&gt;
|-&lt;br /&gt;
| Tarkin&lt;br /&gt;
| trkn&lt;br /&gt;
| tarkin&lt;br /&gt;
|-&lt;br /&gt;
| Flac&lt;br /&gt;
| flac&lt;br /&gt;
| flac&lt;br /&gt;
|-&lt;br /&gt;
| Speex&lt;br /&gt;
| spex&lt;br /&gt;
| speex&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the container uses 4-character codes 4-cc identifier from the table above shall be used if the container uses arbitrary length strings as identifiers, then the long id from the table above shall be used.&lt;br /&gt;
&lt;br /&gt;
===Examples and Discussions about specific containers===&lt;br /&gt;
What follows are some notes about specific containers, these notes are just informative as they just repeat what is written above or in the &lt;br /&gt;
specification of the specific container.&lt;br /&gt;
&lt;br /&gt;
====Example and Discussion of the AVI container====&lt;br /&gt;
AVI supports everything needed to store Vorbis, this does not mean that all application will support Vorbis in AVI, as Vorbis is rather different from other audio codecs commonly stored in AVI.&lt;br /&gt;
&lt;br /&gt;
AVI supports a single global header like WAV does, the 3 Vorbis headers&lt;br /&gt;
shall be stored in it and only in it as described above.  dwSampleSize must be set to zero as vorbis is VBR, many applications do this incorrectly for other VBR codecs and consequently VBR audio in AVI&lt;br /&gt;
becomes problematic.&lt;br /&gt;
&lt;br /&gt;
AVI does not have timestamps, but each chunk has a constant duration, while Vorbis packets can have one of 2 durations, if now the AVI header is setup so that each AVI chunk has the same duration as the smaller duration of the 2 possibilities in Vorbis then simply inserting empty AVI chunks will allow every AVI chunk to have the correct duration, this is of course not the most beautiful solution but it is the only way to keep things exact.  Additionally, note that empty chunks have been used since ages in AVI to lengthen the duration of video chunks.&lt;br /&gt;
&lt;br /&gt;
Some Links:&lt;br /&gt;
* [http://svn.xiph.org/tags/vorbisacm_20020708/ Vorbisacm]&lt;br /&gt;
* [http://www.alexander-noe.com/video/documentation/avi.pdf AVI File Format] (PDF), 5.7 (p.21) VFR Audio - Storing Vorbis in AVI&lt;br /&gt;
&lt;br /&gt;
====Example and Discussion of the ASF container====&lt;br /&gt;
ASF supports a single global header per stream and has timestamps, so&lt;br /&gt;
storing Xiph codecs in it should be possible, but ASF is patented and &lt;br /&gt;
Microsoft has already threatened individuals, so we strongly urge you to &lt;br /&gt;
avoid this container.&lt;br /&gt;
&lt;br /&gt;
====Example and Discussion of the Matroska container====&lt;br /&gt;
Matroska supports storing 3 headers using a codec specific format, which should be used for storing the 3 headers.&lt;br /&gt;
&lt;br /&gt;
Note that the above procedure to split one header into 3 works with the&lt;br /&gt;
Vorbis-Matroska specific format too.&lt;br /&gt;
&lt;br /&gt;
====Example and Discussion of the NUT container====&lt;br /&gt;
NUT supports a single global header per stream so the 1&amp;lt;-&amp;gt;3 merge/split&lt;br /&gt;
procedure above must be used, except that theres nothing special with &lt;br /&gt;
storing Xiph codecs in NUT.&lt;br /&gt;
&lt;br /&gt;
====Example and Discussion of MPEG-PS / MPEG-TS container====&lt;br /&gt;
These containers neither support a global header nor provide the neccessary packet separation / framing, so storing Xiph codecs in them is outside the scope of this appendix.&lt;br /&gt;
&lt;br /&gt;
====Example and Discussion of WAV container====&lt;br /&gt;
WAV does not provide the necessary packet separation / framing, so storing Xiph codecs in it is outside the scope of this appendix.&lt;br /&gt;
&lt;br /&gt;
====Example and Discussion of the Mov container====&lt;br /&gt;
A single glbl atom shall be placed in the stsd atom in which the the global header shall be stored.&lt;/div&gt;</summary>
		<author><name>Michaelni</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=Oggless&amp;diff=6761</id>
		<title>Oggless</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=Oggless&amp;diff=6761"/>
		<updated>2007-05-24T13:21:16Z</updated>

		<summary type="html">&lt;p&gt;Michaelni: theora support&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The text below is supposed to be a startpoint for disscussions and is ATM identical to [http://svn.mplayerhq.hu/nut/docs/oggless-xiph-codecs.txt?view=log]&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
Embedding xiph codecs like vorbis in containers other than ogg&lt;br /&gt;
&lt;br /&gt;
==Current Version==&lt;br /&gt;
* 2007-05-23&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
This is a proposal being discussed.  It&#039;s currently not ready to be used on real-life situations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==License==&lt;br /&gt;
GPL + GFDL + anything neeeded to turn this into a open standard like a RFC~&lt;br /&gt;
(License should not be stated yet, or it will be a mess to change later) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Minimum container requirments==&lt;br /&gt;
This appendix only explains how to store xiph codecs in containers which &lt;br /&gt;
support at least one global header per stream, can separate individual codec&lt;br /&gt;
packets and in principle support the codec, so for example in the case of&lt;br /&gt;
vorbis that would be variable bitrate and variable number of samples/packet&lt;br /&gt;
Storage in other containers is outside the scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FIXME non vorbis/theora&lt;br /&gt;
===Global header:===&lt;br /&gt;
If the container can store 3 headers per stream in an unambiguos and ordered&lt;br /&gt;
way then they shall be stored in that way, if OTOH the container is only&lt;br /&gt;
capable to store a single global header then the 3 codec headers shall be&lt;br /&gt;
concatenated without any additional header, footer or separator between them&lt;br /&gt;
to recover the 3 headers from such a global header the following procedure&lt;br /&gt;
shall be used:&lt;br /&gt;
: 1) search for the 1st occurance of ID1 the found match and the following ID1_LEN bytes are the 1st header packet&lt;br /&gt;
: 2) search for the 1st occurance of ID2 after here&lt;br /&gt;
:: 3) read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
:: 4) [user_comment_list_length] = read an unsigned integer of 32 bits&lt;br /&gt;
:: 5) iterate [user_comment_list_length] times {&lt;br /&gt;
::: 6) read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
:: }&lt;br /&gt;
:: 7) skip 1 byte&lt;br /&gt;
: 8) the match in 2) and what follows until here is the 2nd header packet&lt;br /&gt;
: 9) search for the 1st occurance of ID3 after here the matching part and what follows is the 3rd header packet&lt;br /&gt;
&lt;br /&gt;
====Constants:====&lt;br /&gt;
{|&lt;br /&gt;
! Codec&lt;br /&gt;
! ID1&lt;br /&gt;
! ID2&lt;br /&gt;
! ID3&lt;br /&gt;
! ID1_LEN&lt;br /&gt;
|-&lt;br /&gt;
| Vorbis&lt;br /&gt;
| 0x01,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039;&lt;br /&gt;
| 0x03,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039;     &lt;br /&gt;
| 0x05,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039;&lt;br /&gt;
| 23&lt;br /&gt;
|-&lt;br /&gt;
| Theora&lt;br /&gt;
| 0x80,&#039;t&#039;,&#039;h&#039;,&#039;e&#039;,&#039;o&#039;,&#039;r&#039;,&#039;a&#039;&lt;br /&gt;
| 0x81,&#039;t&#039;,&#039;h&#039;,&#039;e&#039;,&#039;o&#039;,&#039;r&#039;,&#039;a&#039;&lt;br /&gt;
| 0x82,&#039;t&#039;,&#039;h&#039;,&#039;e&#039;,&#039;o&#039;,&#039;r&#039;,&#039;a&#039;&lt;br /&gt;
| 35&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
if the container needs an identifer for the global header, for example a 4cc&lt;br /&gt;
for a global header chunk then glbl shall be used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Storing packets:===&lt;br /&gt;
Each codec packet shall be stored in exactly one &amp;quot;container packet&amp;quot;&lt;br /&gt;
and one &amp;quot;container packet&amp;quot; must not contain more then one codec packet&lt;br /&gt;
&amp;quot;container packet&amp;quot; here means the smallest separatable unit of data in the&lt;br /&gt;
container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Codec Identifer:===&lt;br /&gt;
{|&lt;br /&gt;
! xiph-codec&lt;br /&gt;
! 4-cc id&lt;br /&gt;
! long id&lt;br /&gt;
|-&lt;br /&gt;
| Vorbis      &lt;br /&gt;
| vrbs        &lt;br /&gt;
| vorbis&lt;br /&gt;
|-&lt;br /&gt;
| Theora&lt;br /&gt;
| ther&lt;br /&gt;
| theora&lt;br /&gt;
|-&lt;br /&gt;
| Tarkin&lt;br /&gt;
| trkn&lt;br /&gt;
| tarkin&lt;br /&gt;
|-&lt;br /&gt;
| Flac&lt;br /&gt;
| flac&lt;br /&gt;
| flac&lt;br /&gt;
|-&lt;br /&gt;
| Speex&lt;br /&gt;
| spex&lt;br /&gt;
| speex&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
if the container uses 4-character codes 4-cc identifer from the table above&lt;br /&gt;
shall be used&lt;br /&gt;
if the container uses arbitrary length strings as identifers then the long&lt;br /&gt;
id from the table above shall be used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Examples and Disscussions about specific containers===&lt;br /&gt;
What follows are some notes about specific containers, these notes are just&lt;br /&gt;
informative as they just repeat what is written above or in the &lt;br /&gt;
specification of the specific container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the avi container====&lt;br /&gt;
avi supports everything needed to store vorbis, this does not mean that all&lt;br /&gt;
application will support vorbis in avi as vorbis is rather different from&lt;br /&gt;
other audio codecs commonly stored in avi ...&lt;br /&gt;
avi supports a single global header like wav does, the 3 vorbis headers&lt;br /&gt;
shall be stored in it and only in it as described above&lt;br /&gt;
dwSampleSize must be set to zero as vorbis is vbr, many applications do&lt;br /&gt;
this incorrectly for other vbr codecs and consequently vbr audio in avi&lt;br /&gt;
becomes problematic&lt;br /&gt;
avi does not have timestamps but each chunk has a constant duration, while&lt;br /&gt;
vorbis packets can have one of 2 durations, if now the avi header is setup&lt;br /&gt;
so that each avi chunk has the same duration as the smaller duration of&lt;br /&gt;
the 2 possibilities in vorbis then simply inserting empty avi chunks will&lt;br /&gt;
allow every avi chunk to have the correct duration, this is of course&lt;br /&gt;
not the most beautifull solution but it is the only way to keep things&lt;br /&gt;
exact, additionally note, that empty chunks have been used since ages&lt;br /&gt;
in avi to lengthen the duration of video chunks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the asf container====&lt;br /&gt;
asf supports a single global header per stream and has timestamps so&lt;br /&gt;
storing xiph codecs in it should be possible but asf is patented and &lt;br /&gt;
microsoft has already threatened individuals so we strongly urge you to &lt;br /&gt;
avoid this container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the matroska container====&lt;br /&gt;
matroska supports storing 3 headers using a codec specific&lt;br /&gt;
format, which should be used for storing the 3 headers&lt;br /&gt;
Note, the above procedure to split one header into 3 works with the&lt;br /&gt;
vorbis-matroska specific format too&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the nut container====&lt;br /&gt;
nut supports a single global header per stream so the 1&amp;lt;-&amp;gt;3 merge/split&lt;br /&gt;
procedure above must be used, except that theres nothing special with &lt;br /&gt;
storing xiph codecs in nut&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of mpeg-ps / mpeg-ts container====&lt;br /&gt;
These containers neither support a global header nor provide the neccessary&lt;br /&gt;
packet separation / framing, so storing xiph codecs in them is outside the &lt;br /&gt;
scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of wav container====&lt;br /&gt;
wav does not provide the neccessary packet separation / framing, so storing &lt;br /&gt;
xiph codecs in it is outside the scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the mov container====&lt;br /&gt;
a single glbl atom shall be placed in the stsd atom in which the the global&lt;br /&gt;
header shall be stored&lt;/div&gt;</summary>
		<author><name>Michaelni</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=Oggless&amp;diff=6760</id>
		<title>Oggless</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=Oggless&amp;diff=6760"/>
		<updated>2007-05-24T12:57:04Z</updated>

		<summary type="html">&lt;p&gt;Michaelni: fix link, our svn admin doesnt stop moving things around&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The text below is supposed to be a startpoint for disscussions and is ATM identical to [http://svn.mplayerhq.hu/nut/docs/oggless-xiph-codecs.txt?view=log]&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
Embedding xiph codecs like vorbis in containers other than ogg&lt;br /&gt;
&lt;br /&gt;
==Current Version==&lt;br /&gt;
* 2007-05-23&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
This is a proposal being discussed.  It&#039;s currently not ready to be used on real-life situations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==License==&lt;br /&gt;
GPL + GFDL + anything neeeded to turn this into a open standard like a RFC~&lt;br /&gt;
(License should not be stated yet, or it will be a mess to change later) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Minimum container requirments==&lt;br /&gt;
This appendix only explains how to store xiph codecs in containers which &lt;br /&gt;
support at least one global header per stream, can separate individual codec&lt;br /&gt;
packets and in principle support the codec, so for example in the case of&lt;br /&gt;
vorbis that would be variable bitrate and variable number of samples/packet&lt;br /&gt;
Storage in other containers is outside the scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FIXME non vorbis&lt;br /&gt;
===Global header:===&lt;br /&gt;
If the container can store 3 headers per stream in an unambiguos and ordered&lt;br /&gt;
way then they shall be stored in that way, if OTOH the container is only&lt;br /&gt;
capable to store a single global header then the 3 codec headers shall be&lt;br /&gt;
concatenated without any additional header, footer or separator between them&lt;br /&gt;
to recover the 3 headers from such a global header the following procedure&lt;br /&gt;
shall be used:&lt;br /&gt;
: 1) search for the 1st occurance of 01,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039; the found match and the following 23 bytes are the 1st header packet&lt;br /&gt;
: 2) search for the 1st occurance of 03,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039; after here&lt;br /&gt;
:: 3) read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
:: 4) [user_comment_list_length] = read an unsigned integer of 32 bits&lt;br /&gt;
:: 5) iterate [user_comment_list_length] times {&lt;br /&gt;
::: 6) read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
:: }&lt;br /&gt;
:: 7) skip 1 byte&lt;br /&gt;
: 8) the match in 2) and what follows until here is the 2nd header packet&lt;br /&gt;
: 9) search for the 1st occurance of 05,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039; after here the matching part and what follows is the 3rd header packet&lt;br /&gt;
&lt;br /&gt;
if the container needs an identifer for the global header, for example a 4cc&lt;br /&gt;
for a global header chunk then glbl shall be used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Storing packets:===&lt;br /&gt;
Each codec packet shall be stored in exactly one &amp;quot;container packet&amp;quot;&lt;br /&gt;
and one &amp;quot;container packet&amp;quot; must not contain more then one codec packet&lt;br /&gt;
&amp;quot;container packet&amp;quot; here means the smallest separatable unit of data in the&lt;br /&gt;
container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Codec Identifer:===&lt;br /&gt;
{|&lt;br /&gt;
! xiph-codec&lt;br /&gt;
! 4-cc id&lt;br /&gt;
! long id&lt;br /&gt;
|-&lt;br /&gt;
| Vorbis      &lt;br /&gt;
| vrbs        &lt;br /&gt;
| vorbis&lt;br /&gt;
|-&lt;br /&gt;
| Theora&lt;br /&gt;
| ther&lt;br /&gt;
| theora&lt;br /&gt;
|-&lt;br /&gt;
| Tarkin&lt;br /&gt;
| trkn&lt;br /&gt;
| tarkin&lt;br /&gt;
|-&lt;br /&gt;
| Flac&lt;br /&gt;
| flac&lt;br /&gt;
| flac&lt;br /&gt;
|-&lt;br /&gt;
| Speex&lt;br /&gt;
| spex&lt;br /&gt;
| speex&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
if the container uses 4-character codes 4-cc identifer from the table above&lt;br /&gt;
shall be used&lt;br /&gt;
if the container uses arbitrary length strings as identifers then the long&lt;br /&gt;
id from the table above shall be used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Examples and Disscussions about specific containers===&lt;br /&gt;
What follows are some notes about specific containers, these notes are just&lt;br /&gt;
informative as they just repeat what is written above or in the &lt;br /&gt;
specification of the specific container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the avi container====&lt;br /&gt;
avi supports everything needed to store vorbis, this does not mean that all&lt;br /&gt;
application will support vorbis in avi as vorbis is rather different from&lt;br /&gt;
other audio codecs commonly stored in avi ...&lt;br /&gt;
avi supports a single global header like wav does, the 3 vorbis headers&lt;br /&gt;
shall be stored in it and only in it as described above&lt;br /&gt;
dwSampleSize must be set to zero as vorbis is vbr, many applications do&lt;br /&gt;
this incorrectly for other vbr codecs and consequently vbr audio in avi&lt;br /&gt;
becomes problematic&lt;br /&gt;
avi does not have timestamps but each chunk has a constant duration, while&lt;br /&gt;
vorbis packets can have one of 2 durations, if now the avi header is setup&lt;br /&gt;
so that each avi chunk has the same duration as the smaller duration of&lt;br /&gt;
the 2 possibilities in vorbis then simply inserting empty avi chunks will&lt;br /&gt;
allow every avi chunk to have the correct duration, this is of course&lt;br /&gt;
not the most beautifull solution but it is the only way to keep things&lt;br /&gt;
exact, additionally note, that empty chunks have been used since ages&lt;br /&gt;
in avi to lengthen the duration of video chunks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the asf container====&lt;br /&gt;
asf supports a single global header per stream and has timestamps so&lt;br /&gt;
storing xiph codecs in it should be possible but asf is patented and &lt;br /&gt;
microsoft has already threatened individuals so we strongly urge you to &lt;br /&gt;
avoid this container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the matroska container====&lt;br /&gt;
matroska supports storing 3 headers using a codec specific&lt;br /&gt;
format, which should be used for storing the 3 headers&lt;br /&gt;
Note, the above procedure to split one header into 3 works with the&lt;br /&gt;
vorbis-matroska specific format too&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the nut container====&lt;br /&gt;
nut supports a single global header per stream so the 1&amp;lt;-&amp;gt;3 merge/split&lt;br /&gt;
procedure above must be used, except that theres nothing special with &lt;br /&gt;
storing xiph codecs in nut&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of mpeg-ps / mpeg-ts container====&lt;br /&gt;
These containers neither support a global header nor provide the neccessary&lt;br /&gt;
packet separation / framing, so storing xiph codecs in them is outside the &lt;br /&gt;
scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of wav container====&lt;br /&gt;
wav does not provide the neccessary packet separation / framing, so storing &lt;br /&gt;
xiph codecs in it is outside the scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the mov container====&lt;br /&gt;
a single glbl atom shall be placed in the stsd atom in which the the global&lt;br /&gt;
header shall be stored&lt;/div&gt;</summary>
		<author><name>Michaelni</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=Oggless&amp;diff=6755</id>
		<title>Oggless</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=Oggless&amp;diff=6755"/>
		<updated>2007-05-22T18:38:48Z</updated>

		<summary type="html">&lt;p&gt;Michaelni: sections and bold text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The text below is supposed to be a startpoint for disscussions and is ATM identical to [http://svn.mplayerhq.hu/nut.merged/docs/oggless-xiph-codecs.txt?view=log]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Title&#039;&#039;&#039;       &lt;br /&gt;
Embedding xiph codecs like vorbis in containers other then ogg&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Version&#039;&#039;&#039;     &lt;br /&gt;
2006-07-30 (draft)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Status&#039;&#039;&#039;      &lt;br /&gt;
this is not a standard or otherwise accepted by xiph or any other&lt;br /&gt;
group, one day when we have a fully working implementation, did&lt;br /&gt;
enough testing and so on we might submit it to IETF? to become an&lt;br /&gt;
RFC ...&lt;br /&gt;
furthermore this document has been submitted to vorbis-dev and&lt;br /&gt;
so far has been ignored, maybe they where too busy maybe xiph&lt;br /&gt;
wants to prevent their open codecs from being used in containers&lt;br /&gt;
other then their own?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Author&#039;&#039;&#039;&lt;br /&gt;
Michael Niedermayer (michaelni at gmx dot at)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;License&#039;&#039;&#039;&lt;br /&gt;
GPL + GFDL + anything neeeded to turn this into a open standard like a RFC&lt;br /&gt;
&lt;br /&gt;
Minimum container requirments:&lt;br /&gt;
This appendix only explains how to store xiph codecs in containers which &lt;br /&gt;
support at least one global header per stream, can separate individual codec&lt;br /&gt;
packets and in principle support the codec, so for example in the case of&lt;br /&gt;
vorbis that would be variable bitrate and variable number of samples/packet&lt;br /&gt;
Storage in other containers is outside the scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FIXME non vorbis&lt;br /&gt;
===Global header:===&lt;br /&gt;
If the container can store 3 headers per stream in an unambiguos and ordered&lt;br /&gt;
way then they shall be stored in that way, if OTOH the container is only&lt;br /&gt;
capable to store a single global header then the 3 codec headers shall be&lt;br /&gt;
concatenated without any additional header, footer or separator between them&lt;br /&gt;
to recover the 3 headers from such a global header the following procedure&lt;br /&gt;
shall be used:&lt;br /&gt;
: 1) search for the 1st occurance of 01,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039; the found match and the following 23 bytes are the 1st header packet&lt;br /&gt;
: 2) search for the 1st occurance of 03,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039; after here&lt;br /&gt;
:: 3) read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
:: 4) [user_comment_list_length] = read an unsigned integer of 32 bits&lt;br /&gt;
:: 5) iterate [user_comment_list_length] times {&lt;br /&gt;
::: 6) read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
:: }&lt;br /&gt;
:: 7) skip 1 byte&lt;br /&gt;
: 8) the match in 2) and what follows until here is the 2nd header packet&lt;br /&gt;
: 9) search for the 1st occurance of 05,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039; after here the matching part and what follows is the 3rd header packet&lt;br /&gt;
&lt;br /&gt;
if the container needs an identifer for the global header, for example a 4cc&lt;br /&gt;
for a global header chunk then glbl shall be used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Storing packets:===&lt;br /&gt;
Each codec packet shall be stored in exactly one &amp;quot;container packet&amp;quot;&lt;br /&gt;
and one &amp;quot;container packet&amp;quot; must not contain more then one codec packet&lt;br /&gt;
&amp;quot;container packet&amp;quot; here means the smallest separatable unit of data in the&lt;br /&gt;
container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Codec Identifer:===&lt;br /&gt;
{|&lt;br /&gt;
! xiph-codec&lt;br /&gt;
! 4-cc id&lt;br /&gt;
! long id&lt;br /&gt;
|-&lt;br /&gt;
| Vorbis      &lt;br /&gt;
| vrbs        &lt;br /&gt;
| vorbis&lt;br /&gt;
|-&lt;br /&gt;
| Theora&lt;br /&gt;
| ther&lt;br /&gt;
| theora&lt;br /&gt;
|-&lt;br /&gt;
| Tarkin&lt;br /&gt;
| trkn&lt;br /&gt;
| tarkin&lt;br /&gt;
|-&lt;br /&gt;
| Flac&lt;br /&gt;
| flac&lt;br /&gt;
| flac&lt;br /&gt;
|-&lt;br /&gt;
| Speex&lt;br /&gt;
| spex&lt;br /&gt;
| speex&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
if the container uses 4-character codes 4-cc identifer from the table above&lt;br /&gt;
shall be used&lt;br /&gt;
if the container uses arbitrary length strings as identifers then the long&lt;br /&gt;
id from the table above shall be used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Examples and Disscussions about specific containers===&lt;br /&gt;
What follows are some notes about specific containers, these notes are just&lt;br /&gt;
informative as they just repeat what is written above or in the &lt;br /&gt;
specification of the specific container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the avi container====&lt;br /&gt;
avi supports everything needed to store vorbis, this does not mean that all&lt;br /&gt;
application will support vorbis in avi as vorbis is rather different from&lt;br /&gt;
other audio codecs commonly stored in avi ...&lt;br /&gt;
avi supports a single global header like wav does, the 3 vorbis headers&lt;br /&gt;
shall be stored in it and only in it as described above&lt;br /&gt;
dwSampleSize must be set to zero as vorbis is vbr, many applications do&lt;br /&gt;
this incorrectly for other vbr codecs and consequently vbr audio in avi&lt;br /&gt;
becomes problematic&lt;br /&gt;
avi does not have timestamps but each chunk has a constant duration, while&lt;br /&gt;
vorbis packets can have one of 2 durations, if now the avi header is setup&lt;br /&gt;
so that each avi chunk has the same duration as the smaller duration of&lt;br /&gt;
the 2 possibilities in vorbis then simply inserting empty avi chunks will&lt;br /&gt;
allow every avi chunk to have the correct duration, this is of course&lt;br /&gt;
not the most beautifull solution but it is the only way to keep things&lt;br /&gt;
exact, additionally note, that empty chunks have been used since ages&lt;br /&gt;
in avi to lengthen the duration of video chunks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the asf container====&lt;br /&gt;
asf supports a single global header per stream and has timestamps so&lt;br /&gt;
storing xiph codecs in it should be possible but asf is patented and &lt;br /&gt;
microsoft has already threatened individuals so we strongly urge you to &lt;br /&gt;
avoid this container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the matroska container====&lt;br /&gt;
matroska supports storing 3 headers using a codec specific&lt;br /&gt;
format, which should be used for storing the 3 headers&lt;br /&gt;
Note, the above procedure to split one header into 3 works with the&lt;br /&gt;
vorbis-matroska specific format too&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the nut container====&lt;br /&gt;
nut supports a single global header per stream so the 1&amp;lt;-&amp;gt;3 merge/split&lt;br /&gt;
procedure above must be used, except that theres nothing special with &lt;br /&gt;
storing xiph codecs in nut&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of mpeg-ps / mpeg-ts container====&lt;br /&gt;
These containers neither support a global header nor provide the neccessary&lt;br /&gt;
packet separation / framing, so storing xiph codecs in them is outside the &lt;br /&gt;
scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of wav container====&lt;br /&gt;
wav does not provide the neccessary packet separation / framing, so storing &lt;br /&gt;
xiph codecs in it is outside the scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example and Disscussion of the mov container====&lt;br /&gt;
a single glbl atom shall be placed in the stsd atom in which the the global&lt;br /&gt;
header shall be stored&lt;/div&gt;</summary>
		<author><name>Michaelni</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=Oggless&amp;diff=6754</id>
		<title>Oggless</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=Oggless&amp;diff=6754"/>
		<updated>2007-05-22T18:29:30Z</updated>

		<summary type="html">&lt;p&gt;Michaelni: format codec identifer table and parsing list so a human can read them&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The text below is supposed to be a startpoint for disscussions and is ATM identical to [http://svn.mplayerhq.hu/nut.merged/docs/oggless-xiph-codecs.txt?view=log]&lt;br /&gt;
&lt;br /&gt;
Ill make the formatting look more sane later today&lt;br /&gt;
&lt;br /&gt;
Title       Embedding xiph codecs like vorbis in containers other then ogg&lt;br /&gt;
&lt;br /&gt;
Version     2006-07-30 (draft)&lt;br /&gt;
&lt;br /&gt;
Status      this is not a standard or otherwise accepted by xiph or any other&lt;br /&gt;
group, one day when we have a fully working implementation, did&lt;br /&gt;
enough testing and so on we might submit it to IETF? to become an&lt;br /&gt;
RFC ...&lt;br /&gt;
furthermore this document has been submitted to vorbis-dev and&lt;br /&gt;
so far has been ignored, maybe they where too busy maybe xiph&lt;br /&gt;
wants to prevent their open codecs from being used in containers&lt;br /&gt;
other then their own?&lt;br /&gt;
&lt;br /&gt;
Author      Michael Niedermayer (michaelni at gmx dot at)&lt;br /&gt;
&lt;br /&gt;
License     GPL + GFDL + anything neeeded to turn this into a open standard&lt;br /&gt;
like a RFC&lt;br /&gt;
&lt;br /&gt;
Minimum container requirments:&lt;br /&gt;
This appendix only explains how to store xiph codecs in containers which &lt;br /&gt;
support at least one global header per stream, can separate individual codec&lt;br /&gt;
packets and in principle support the codec, so for example in the case of&lt;br /&gt;
vorbis that would be variable bitrate and variable number of samples/packet&lt;br /&gt;
Storage in other containers is outside the scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FIXME non vorbis&lt;br /&gt;
Global header:&lt;br /&gt;
If the container can store 3 headers per stream in an unambiguos and ordered&lt;br /&gt;
way then they shall be stored in that way, if OTOH the container is only&lt;br /&gt;
capable to store a single global header then the 3 codec headers shall be&lt;br /&gt;
concatenated without any additional header, footer or separator between them&lt;br /&gt;
to recover the 3 headers from such a global header the following procedure&lt;br /&gt;
shall be used:&lt;br /&gt;
: 1) search for the 1st occurance of 01,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039; the found match and the following 23 bytes are the 1st header packet&lt;br /&gt;
: 2) search for the 1st occurance of 03,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039; after here&lt;br /&gt;
:: 3) read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
:: 4) [user_comment_list_length] = read an unsigned integer of 32 bits&lt;br /&gt;
:: 5) iterate [user_comment_list_length] times {&lt;br /&gt;
::: 6) read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
:: }&lt;br /&gt;
:: 7) skip 1 byte&lt;br /&gt;
: 8) the match in 2) and what follows until here is the 2nd header packet&lt;br /&gt;
: 9) search for the 1st occurance of 05,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039; after here the matching part and what follows is the 3rd header packet&lt;br /&gt;
&lt;br /&gt;
if the container needs an identifer for the global header, for example a 4cc&lt;br /&gt;
for a global header chunk then glbl shall be used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Storing packets:&lt;br /&gt;
Each codec packet shall be stored in exactly one &amp;quot;container packet&amp;quot;&lt;br /&gt;
and one &amp;quot;container packet&amp;quot; must not contain more then one codec packet&lt;br /&gt;
&amp;quot;container packet&amp;quot; here means the smallest separatable unit of data in the&lt;br /&gt;
container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Codec Identifer:&lt;br /&gt;
{|&lt;br /&gt;
! xiph-codec&lt;br /&gt;
! 4-cc id&lt;br /&gt;
! long id&lt;br /&gt;
|-&lt;br /&gt;
| Vorbis      &lt;br /&gt;
| vrbs        &lt;br /&gt;
| vorbis&lt;br /&gt;
|-&lt;br /&gt;
| Theora&lt;br /&gt;
| ther&lt;br /&gt;
| theora&lt;br /&gt;
|-&lt;br /&gt;
| Tarkin&lt;br /&gt;
| trkn&lt;br /&gt;
| tarkin&lt;br /&gt;
|-&lt;br /&gt;
| Flac&lt;br /&gt;
| flac&lt;br /&gt;
| flac&lt;br /&gt;
|-&lt;br /&gt;
| Speex&lt;br /&gt;
| spex&lt;br /&gt;
| speex&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
if the container uses 4-character codes 4-cc identifer from the table above&lt;br /&gt;
shall be used&lt;br /&gt;
if the container uses arbitrary length strings as identifers then the long&lt;br /&gt;
id from the table above shall be used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples and Disscussions about specific containers&lt;br /&gt;
What follows are some notes about specific containers, these notes are just&lt;br /&gt;
informative as they just repeat what is written above or in the &lt;br /&gt;
specification of the specific container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of the avi container&lt;br /&gt;
avi supports everything needed to store vorbis, this does not mean that all&lt;br /&gt;
application will support vorbis in avi as vorbis is rather different from&lt;br /&gt;
other audio codecs commonly stored in avi ...&lt;br /&gt;
avi supports a single global header like wav does, the 3 vorbis headers&lt;br /&gt;
shall be stored in it and only in it as described above&lt;br /&gt;
dwSampleSize must be set to zero as vorbis is vbr, many applications do&lt;br /&gt;
this incorrectly for other vbr codecs and consequently vbr audio in avi&lt;br /&gt;
becomes problematic&lt;br /&gt;
avi does not have timestamps but each chunk has a constant duration, while&lt;br /&gt;
vorbis packets can have one of 2 durations, if now the avi header is setup&lt;br /&gt;
so that each avi chunk has the same duration as the smaller duration of&lt;br /&gt;
the 2 possibilities in vorbis then simply inserting empty avi chunks will&lt;br /&gt;
allow every avi chunk to have the correct duration, this is of course&lt;br /&gt;
not the most beautifull solution but it is the only way to keep things&lt;br /&gt;
exact, additionally note, that empty chunks have been used since ages&lt;br /&gt;
in avi to lengthen the duration of video chunks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of the asf container&lt;br /&gt;
asf supports a single global header per stream and has timestamps so&lt;br /&gt;
storing xiph codecs in it should be possible but asf is patented and &lt;br /&gt;
microsoft has already threatened individuals so we strongly urge you to &lt;br /&gt;
avoid this container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of the matroska container&lt;br /&gt;
matroska supports storing 3 headers using a codec specific&lt;br /&gt;
format, which should be used for storing the 3 headers&lt;br /&gt;
Note, the above procedure to split one header into 3 works with the&lt;br /&gt;
vorbis-matroska specific format too&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of the nut container&lt;br /&gt;
nut supports a single global header per stream so the 1&amp;lt;-&amp;gt;3 merge/split&lt;br /&gt;
procedure above must be used, except that theres nothing special with &lt;br /&gt;
storing xiph codecs in nut&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of mpeg-ps / mpeg-ts container&lt;br /&gt;
These containers neither support a global header nor provide the neccessary&lt;br /&gt;
packet separation / framing, so storing xiph codecs in them is outside the &lt;br /&gt;
scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of wav container&lt;br /&gt;
wav does not provide the neccessary packet separation / framing, so storing &lt;br /&gt;
xiph codecs in it is outside the scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of the mov container&lt;br /&gt;
a single glbl atom shall be placed in the stsd atom in which the the global&lt;br /&gt;
header shall be stored&lt;/div&gt;</summary>
		<author><name>Michaelni</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=Oggless&amp;diff=6753</id>
		<title>Oggless</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=Oggless&amp;diff=6753"/>
		<updated>2007-05-22T13:10:11Z</updated>

		<summary type="html">&lt;p&gt;Michaelni: Proposal about storing xiph codecs in containers other than ogg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The text below is supposed to be a startpoint for disscussions and is ATM identical to [http://svn.mplayerhq.hu/nut.merged/docs/oggless-xiph-codecs.txt?view=log]&lt;br /&gt;
&lt;br /&gt;
Ill make the formatting look more sane later today&lt;br /&gt;
&lt;br /&gt;
Title       Embedding xiph codecs like vorbis in containers other then ogg&lt;br /&gt;
&lt;br /&gt;
Version     2006-07-30 (draft)&lt;br /&gt;
&lt;br /&gt;
Status      this is not a standard or otherwise accepted by xiph or any other&lt;br /&gt;
group, one day when we have a fully working implementation, did&lt;br /&gt;
enough testing and so on we might submit it to IETF? to become an&lt;br /&gt;
RFC ...&lt;br /&gt;
furthermore this document has been submitted to vorbis-dev and&lt;br /&gt;
so far has been ignored, maybe they where too busy maybe xiph&lt;br /&gt;
wants to prevent their open codecs from being used in containers&lt;br /&gt;
other then their own?&lt;br /&gt;
&lt;br /&gt;
Author      Michael Niedermayer (michaelni at gmx dot at)&lt;br /&gt;
&lt;br /&gt;
License     GPL + GFDL + anything neeeded to turn this into a open standard&lt;br /&gt;
like a RFC&lt;br /&gt;
&lt;br /&gt;
Minimum container requirments:&lt;br /&gt;
This appendix only explains how to store xiph codecs in containers which &lt;br /&gt;
support at least one global header per stream, can separate individual codec&lt;br /&gt;
packets and in principle support the codec, so for example in the case of&lt;br /&gt;
vorbis that would be variable bitrate and variable number of samples/packet&lt;br /&gt;
Storage in other containers is outside the scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FIXME non vorbis&lt;br /&gt;
Global header:&lt;br /&gt;
If the container can store 3 headers per stream in an unambiguos and ordered&lt;br /&gt;
way then they shall be stored in that way, if OTOH the container is only&lt;br /&gt;
capable to store a single global header then the 3 codec headers shall be&lt;br /&gt;
concatenated without any additional header, footer or separator between them&lt;br /&gt;
to recover the 3 headers from such a global header the following procedure&lt;br /&gt;
shall be used:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; &lt;br /&gt;
  search for the 1st occurance of 01,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039;&lt;br /&gt;
  the found match and the following 23 bytes are the 1st header packet&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; &lt;br /&gt;
  search for the 1st occurance of 03,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039; after here&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; &lt;br /&gt;
    read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; &lt;br /&gt;
    [user_comment_list_length] = read an unsigned integer of 32 bits&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; &lt;br /&gt;
    iterate [user_comment_list_length] times {&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
      read an unsigned integer of 32 bits and skip that many bytes&lt;br /&gt;
     }&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
    skip 1 byte&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
  the match in 2) and what follows until here is the 2nd header packet&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
  search for the 1st occurance of 05,&#039;v&#039;,&#039;o&#039;,&#039;r&#039;,&#039;b&#039;,&#039;i&#039;,&#039;s&#039; after here&lt;br /&gt;
  the matching part and what follows is the 3rd header packet&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
if the container needs an identifer for the global header, for example a 4cc&lt;br /&gt;
for a global header chunk then glbl shall be used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Storing packets:&lt;br /&gt;
Each codec packet shall be stored in exactly one &amp;quot;container packet&amp;quot;&lt;br /&gt;
and one &amp;quot;container packet&amp;quot; must not contain more then one codec packet&lt;br /&gt;
&amp;quot;container packet&amp;quot; here means the smallest separatable unit of data in the&lt;br /&gt;
container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Codec Identifer:&lt;br /&gt;
xiph-codec  4-cc id     long id&lt;br /&gt;
Vorbis      vrbs        vorbis&lt;br /&gt;
Theora      ther        theora&lt;br /&gt;
Tarkin      trkn        tarkin&lt;br /&gt;
Flac        flac        flac&lt;br /&gt;
Speex       spex        speex&lt;br /&gt;
&lt;br /&gt;
if the container uses 4-character codes 4-cc identifer from the table above&lt;br /&gt;
shall be used&lt;br /&gt;
if the container uses arbitrary length strings as identifers then the long&lt;br /&gt;
id from the table above shall be used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples and Disscussions about specific containers&lt;br /&gt;
What follows are some notes about specific containers, these notes are just&lt;br /&gt;
informative as they just repeat what is written above or in the &lt;br /&gt;
specification of the specific container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of the avi container&lt;br /&gt;
avi supports everything needed to store vorbis, this does not mean that all&lt;br /&gt;
application will support vorbis in avi as vorbis is rather different from&lt;br /&gt;
other audio codecs commonly stored in avi ...&lt;br /&gt;
avi supports a single global header like wav does, the 3 vorbis headers&lt;br /&gt;
shall be stored in it and only in it as described above&lt;br /&gt;
dwSampleSize must be set to zero as vorbis is vbr, many applications do&lt;br /&gt;
this incorrectly for other vbr codecs and consequently vbr audio in avi&lt;br /&gt;
becomes problematic&lt;br /&gt;
avi does not have timestamps but each chunk has a constant duration, while&lt;br /&gt;
vorbis packets can have one of 2 durations, if now the avi header is setup&lt;br /&gt;
so that each avi chunk has the same duration as the smaller duration of&lt;br /&gt;
the 2 possibilities in vorbis then simply inserting empty avi chunks will&lt;br /&gt;
allow every avi chunk to have the correct duration, this is of course&lt;br /&gt;
not the most beautifull solution but it is the only way to keep things&lt;br /&gt;
exact, additionally note, that empty chunks have been used since ages&lt;br /&gt;
in avi to lengthen the duration of video chunks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of the asf container&lt;br /&gt;
asf supports a single global header per stream and has timestamps so&lt;br /&gt;
storing xiph codecs in it should be possible but asf is patented and &lt;br /&gt;
microsoft has already threatened individuals so we strongly urge you to &lt;br /&gt;
avoid this container&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of the matroska container&lt;br /&gt;
matroska supports storing 3 headers using a codec specific&lt;br /&gt;
format, which should be used for storing the 3 headers&lt;br /&gt;
Note, the above procedure to split one header into 3 works with the&lt;br /&gt;
vorbis-matroska specific format too&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of the nut container&lt;br /&gt;
nut supports a single global header per stream so the 1&amp;lt;-&amp;gt;3 merge/split&lt;br /&gt;
procedure above must be used, except that theres nothing special with &lt;br /&gt;
storing xiph codecs in nut&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of mpeg-ps / mpeg-ts container&lt;br /&gt;
These containers neither support a global header nor provide the neccessary&lt;br /&gt;
packet separation / framing, so storing xiph codecs in them is outside the &lt;br /&gt;
scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of wav container&lt;br /&gt;
wav does not provide the neccessary packet separation / framing, so storing &lt;br /&gt;
xiph codecs in it is outside the scope of this appendix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example and Disscussion of the mov container&lt;br /&gt;
a single glbl atom shall be placed in the stsd atom in which the the global&lt;br /&gt;
header shall be stored&lt;/div&gt;</summary>
		<author><name>Michaelni</name></author>
	</entry>
</feed>