rfc3533.txt 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. Network Working Group S. Pfeiffer
  2. Request for Comments: 3533 CSIRO
  3. Category: Informational May 2003
  4. The Ogg Encapsulation Format Version 0
  5. Status of this Memo
  6. This memo provides information for the Internet community. It does
  7. not specify an Internet standard of any kind. Distribution of this
  8. memo is unlimited.
  9. Copyright Notice
  10. Copyright (C) The Internet Society (2003). All Rights Reserved.
  11. Abstract
  12. This document describes the Ogg bitstream format version 0, which is
  13. a general, freely-available encapsulation format for media streams.
  14. It is able to encapsulate any kind and number of video and audio
  15. encoding formats as well as other data streams in a single bitstream.
  16. Terminology
  17. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  18. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  19. document are to be interpreted as described in BCP 14, RFC 2119 [2].
  20. Table of Contents
  21. 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2
  22. 2. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . 2
  23. 3. Requirements for a generic encapsulation format . . . . . . . 3
  24. 4. The Ogg bitstream format . . . . . . . . . . . . . . . . . . . 3
  25. 5. The encapsulation process . . . . . . . . . . . . . . . . . . 6
  26. 6. The Ogg page format . . . . . . . . . . . . . . . . . . . . . 9
  27. 7. Security Considerations . . . . . . . . . . . . . . . . . . . 11
  28. 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 12
  29. A. Glossary of terms and abbreviations . . . . . . . . . . . . . 13
  30. B. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 14
  31. Author's Address . . . . . . . . . . . . . . . . . . . . . . . 14
  32. Full Copyright Statement . . . . . . . . . . . . . . . . . . . 15
  33. Pfeiffer Informational [Page 1]
  34. RFC 3533 OGG May 2003
  35. 1. Introduction
  36. The Ogg bitstream format has been developed as a part of a larger
  37. project aimed at creating a set of components for the coding and
  38. decoding of multimedia content (codecs) which are to be freely
  39. available and freely re-implementable, both in software and in
  40. hardware for the computing community at large, including the Internet
  41. community. It is the intention of the Ogg developers represented by
  42. Xiph.Org that it be usable without intellectual property concerns.
  43. This document describes the Ogg bitstream format and how to use it to
  44. encapsulate one or several media bitstreams created by one or several
  45. encoders. The Ogg transport bitstream is designed to provide
  46. framing, error protection and seeking structure for higher-level
  47. codec streams that consist of raw, unencapsulated data packets, such
  48. as the Vorbis audio codec or the upcoming Tarkin and Theora video
  49. codecs. It is capable of interleaving different binary media and
  50. other time-continuous data streams that are prepared by an encoder as
  51. a sequence of data packets. Ogg provides enough information to
  52. properly separate data back into such encoder created data packets at
  53. the original packet boundaries without relying on decoding to find
  54. packet boundaries.
  55. Please note that the MIME type application/ogg has been registered
  56. with the IANA [1].
  57. 2. Definitions
  58. For describing the Ogg encapsulation process, a set of terms will be
  59. used whose meaning needs to be well understood. Therefore, some of
  60. the most fundamental terms are defined now before we start with the
  61. description of the requirements for a generic media stream
  62. encapsulation format, the process of encapsulation, and the concrete
  63. format of the Ogg bitstream. See the Appendix for a more complete
  64. glossary.
  65. The result of an Ogg encapsulation is called the "Physical (Ogg)
  66. Bitstream". It encapsulates one or several encoder-created
  67. bitstreams, which are called "Logical Bitstreams". A logical
  68. bitstream, provided to the Ogg encapsulation process, has a
  69. structure, i.e., it is split up into a sequence of so-called
  70. "Packets". The packets are created by the encoder of that logical
  71. bitstream and represent meaningful entities for that encoder only
  72. (e.g., an uncompressed stream may use video frames as packets). They
  73. do not contain boundary information - strung together they appear to
  74. be streams of random bytes with no landmarks.
  75. Pfeiffer Informational [Page 2]
  76. RFC 3533 OGG May 2003
  77. Please note that the term "packet" is not used in this document to
  78. signify entities for transport over a network.
  79. 3. Requirements for a generic encapsulation format
  80. The design idea behind Ogg was to provide a generic, linear media
  81. transport format to enable both file-based storage and stream-based
  82. transmission of one or several interleaved media streams independent
  83. of the encoding format of the media data. Such an encapsulation
  84. format needs to provide:
  85. o framing for logical bitstreams.
  86. o interleaving of different logical bitstreams.
  87. o detection of corruption.
  88. o recapture after a parsing error.
  89. o position landmarks for direct random access of arbitrary positions
  90. in the bitstream.
  91. o streaming capability (i.e., no seeking is needed to build a 100%
  92. complete bitstream).
  93. o small overhead (i.e., use no more than approximately 1-2% of
  94. bitstream bandwidth for packet boundary marking, high-level
  95. framing, sync and seeking).
  96. o simplicity to enable fast parsing.
  97. o simple concatenation mechanism of several physical bitstreams.
  98. All of these design considerations have been taken into consideration
  99. for Ogg. Ogg supports framing and interleaving of logical
  100. bitstreams, seeking landmarks, detection of corruption, and stream
  101. resynchronisation after a parsing error with no more than
  102. approximately 1-2% overhead. It is a generic framework to perform
  103. encapsulation of time-continuous bitstreams. It does not know any
  104. specifics about the codec data that it encapsulates and is thus
  105. independent of any media codec.
  106. 4. The Ogg bitstream format
  107. A physical Ogg bitstream consists of multiple logical bitstreams
  108. interleaved in so-called "Pages". Whole pages are taken in order
  109. from multiple logical bitstreams multiplexed at the page level. The
  110. logical bitstreams are identified by a unique serial number in the
  111. Pfeiffer Informational [Page 3]
  112. RFC 3533 OGG May 2003
  113. header of each page of the physical bitstream. This unique serial
  114. number is created randomly and does not have any connection to the
  115. content or encoder of the logical bitstream it represents. Pages of
  116. all logical bitstreams are concurrently interleaved, but they need
  117. not be in a regular order - they are only required to be consecutive
  118. within the logical bitstream. Ogg demultiplexing reconstructs the
  119. original logical bitstreams from the physical bitstream by taking the
  120. pages in order from the physical bitstream and redirecting them into
  121. the appropriate logical decoding entity.
  122. Each Ogg page contains only one type of data as it belongs to one
  123. logical bitstream only. Pages are of variable size and have a page
  124. header containing encapsulation and error recovery information. Each
  125. logical bitstream in a physical Ogg bitstream starts with a special
  126. start page (bos=beginning of stream) and ends with a special page
  127. (eos=end of stream).
  128. The bos page contains information to uniquely identify the codec type
  129. and MAY contain information to set up the decoding process. The bos
  130. page SHOULD also contain information about the encoded media - for
  131. example, for audio, it should contain the sample rate and number of
  132. channels. By convention, the first bytes of the bos page contain
  133. magic data that uniquely identifies the required codec. It is the
  134. responsibility of anyone fielding a new codec to make sure it is
  135. possible to reliably distinguish his/her codec from all other codecs
  136. in use. There is no fixed way to detect the end of the codec-
  137. identifying marker. The format of the bos page is dependent on the
  138. codec and therefore MUST be given in the encapsulation specification
  139. of that logical bitstream type. Ogg also allows but does not require
  140. secondary header packets after the bos page for logical bitstreams
  141. and these must also precede any data packets in any logical
  142. bitstream. These subsequent header packets are framed into an
  143. integral number of pages, which will not contain any data packets.
  144. So, a physical bitstream begins with the bos pages of all logical
  145. bitstreams containing one initial header packet per page, followed by
  146. the subsidiary header packets of all streams, followed by pages
  147. containing data packets.
  148. The encapsulation specification for one or more logical bitstreams is
  149. called a "media mapping". An example for a media mapping is "Ogg
  150. Vorbis", which uses the Ogg framework to encapsulate Vorbis-encoded
  151. audio data for stream-based storage (such as files) and transport
  152. (such as TCP streams or pipes). Ogg Vorbis provides the name and
  153. revision of the Vorbis codec, the audio rate and the audio quality on
  154. the Ogg Vorbis bos page. It also uses two additional header pages
  155. per logical bitstream. The Ogg Vorbis bos page starts with the byte
  156. 0x01, followed by "vorbis" (a total of 7 bytes of identifier).
  157. Pfeiffer Informational [Page 4]
  158. RFC 3533 OGG May 2003
  159. Ogg knows two types of multiplexing: concurrent multiplexing (so-
  160. called "Grouping") and sequential multiplexing (so-called
  161. "Chaining"). Grouping defines how to interleave several logical
  162. bitstreams page-wise in the same physical bitstream. Grouping is for
  163. example needed for interleaving a video stream with several
  164. synchronised audio tracks using different codecs in different logical
  165. bitstreams. Chaining on the other hand, is defined to provide a
  166. simple mechanism to concatenate physical Ogg bitstreams, as is often
  167. needed for streaming applications.
  168. In grouping, all bos pages of all logical bitstreams MUST appear
  169. together at the beginning of the Ogg bitstream. The media mapping
  170. specifies the order of the initial pages. For example, the grouping
  171. of a specific Ogg video and Ogg audio bitstream may specify that the
  172. physical bitstream MUST begin with the bos page of the logical video
  173. bitstream, followed by the bos page of the audio bitstream. Unlike
  174. bos pages, eos pages for the logical bitstreams need not all occur
  175. contiguously. Eos pages may be 'nil' pages, that is, pages
  176. containing no content but simply a page header with position
  177. information and the eos flag set in the page header. Each grouped
  178. logical bitstream MUST have a unique serial number within the scope
  179. of the physical bitstream.
  180. In chaining, complete logical bitstreams are concatenated. The
  181. bitstreams do not overlap, i.e., the eos page of a given logical
  182. bitstream is immediately followed by the bos page of the next. Each
  183. chained logical bitstream MUST have a unique serial number within the
  184. scope of the physical bitstream.
  185. It is possible to consecutively chain groups of concurrently
  186. multiplexed bitstreams. The groups, when unchained, MUST stand on
  187. their own as a valid concurrently multiplexed bitstream. The
  188. following diagram shows a schematic example of such a physical
  189. bitstream that obeys all the rules of both grouped and chained
  190. multiplexed bitstreams.
  191. physical bitstream with pages of
  192. different logical bitstreams grouped and chained
  193. -------------------------------------------------------------
  194. |*A*|*B*|*C*|A|A|C|B|A|B|#A#|C|...|B|C|#B#|#C#|*D*|D|...|#D#|
  195. -------------------------------------------------------------
  196. bos bos bos eos eos eos bos eos
  197. In this example, there are two chained physical bitstreams, the first
  198. of which is a grouped stream of three logical bitstreams A, B, and C.
  199. The second physical bitstream is chained after the end of the grouped
  200. bitstream, which ends after the last eos page of all its grouped
  201. logical bitstreams. As can be seen, grouped bitstreams begin
  202. Pfeiffer Informational [Page 5]
  203. RFC 3533 OGG May 2003
  204. together - all of the bos pages MUST appear before any data pages.
  205. It can also be seen that pages of concurrently multiplexed bitstreams
  206. need not conform to a regular order. And it can be seen that a
  207. grouped bitstream can end long before the other bitstreams in the
  208. group end.
  209. Ogg does not know any specifics about the codec data except that each
  210. logical bitstream belongs to a different codec, the data from the
  211. codec comes in order and has position markers (so-called "Granule
  212. positions"). Ogg does not have a concept of 'time': it only knows
  213. about sequentially increasing, unitless position markers. An
  214. application can only get temporal information through higher layers
  215. which have access to the codec APIs to assign and convert granule
  216. positions or time.
  217. A specific definition of a media mapping using Ogg may put further
  218. constraints on its specific use of the Ogg bitstream format. For
  219. example, a specific media mapping may require that all the eos pages
  220. for all grouped bitstreams need to appear in direct sequence. An
  221. example for a media mapping is the specification of "Ogg Vorbis".
  222. Another example is the upcoming "Ogg Theora" specification which
  223. encapsulates Theora-encoded video data and usually comes multiplexed
  224. with a Vorbis stream for an Ogg containing synchronised audio and
  225. video. As Ogg does not specify temporal relationships between the
  226. encapsulated concurrently multiplexed bitstreams, the temporal
  227. synchronisation between the audio and video stream will be specified
  228. in this media mapping. To enable streaming, pages from various
  229. logical bitstreams will typically be interleaved in chronological
  230. order.
  231. 5. The encapsulation process
  232. The process of multiplexing different logical bitstreams happens at
  233. the level of pages as described above. The bitstreams provided by
  234. encoders are however handed over to Ogg as so-called "Packets" with
  235. packet boundaries dependent on the encoding format. The process of
  236. encapsulating packets into pages will be described now.
  237. From Ogg's perspective, packets can be of any arbitrary size. A
  238. specific media mapping will define how to group or break up packets
  239. from a specific media encoder. As Ogg pages have a maximum size of
  240. about 64 kBytes, sometimes a packet has to be distributed over
  241. several pages. To simplify that process, Ogg divides each packet
  242. into 255 byte long chunks plus a final shorter chunk. These chunks
  243. are called "Ogg Segments". They are only a logical construct and do
  244. not have a header for themselves.
  245. Pfeiffer Informational [Page 6]
  246. RFC 3533 OGG May 2003
  247. A group of contiguous segments is wrapped into a variable length page
  248. preceded by a header. A segment table in the page header tells about
  249. the "Lacing values" (sizes) of the segments included in the page. A
  250. flag in the page header tells whether a page contains a packet
  251. continued from a previous page. Note that a lacing value of 255
  252. implies that a second lacing value follows in the packet, and a value
  253. of less than 255 marks the end of the packet after that many
  254. additional bytes. A packet of 255 bytes (or a multiple of 255 bytes)
  255. is terminated by a lacing value of 0. Note also that a 'nil' (zero
  256. length) packet is not an error; it consists of nothing more than a
  257. lacing value of zero in the header.
  258. The encoding is optimized for speed and the expected case of the
  259. majority of packets being between 50 and 200 bytes large. This is a
  260. design justification rather than a recommendation. This encoding
  261. both avoids imposing a maximum packet size as well as imposing
  262. minimum overhead on small packets. In contrast, e.g., simply using
  263. two bytes at the head of every packet and having a max packet size of
  264. 32 kBytes would always penalize small packets (< 255 bytes, the
  265. typical case) with twice the segmentation overhead. Using the lacing
  266. values as suggested, small packets see the minimum possible byte-
  267. aligned overhead (1 byte) and large packets (>512 bytes) see a fairly
  268. constant ~0.5% overhead on encoding space.
  269. Pfeiffer Informational [Page 7]
  270. RFC 3533 OGG May 2003
  271. The following diagram shows a schematic example of a media mapping
  272. using Ogg and grouped logical bitstreams:
  273. logical bitstream with packet boundaries
  274. -----------------------------------------------------------------
  275. > | packet_1 | packet_2 | packet_3 | <
  276. -----------------------------------------------------------------
  277. |segmentation (logically only)
  278. v
  279. packet_1 (5 segments) packet_2 (4 segs) p_3 (2 segs)
  280. ------------------------------ -------------------- ------------
  281. .. |seg_1|seg_2|seg_3|seg_4|s_5 | |seg_1|seg_2|seg_3|| |seg_1|s_2 | ..
  282. ------------------------------ -------------------- ------------
  283. | page encapsulation
  284. v
  285. page_1 (packet_1 data) page_2 (pket_1 data) page_3 (packet_2 data)
  286. ------------------------ ---------------- ------------------------
  287. |H|------------------- | |H|----------- | |H|------------------- |
  288. |D||seg_1|seg_2|seg_3| | |D|seg_4|s_5 | | |D||seg_1|seg_2|seg_3| | ...
  289. |R|------------------- | |R|----------- | |R|------------------- |
  290. ------------------------ ---------------- ------------------------
  291. |
  292. pages of |
  293. other --------| |
  294. logical -------
  295. bitstreams | MUX |
  296. -------
  297. |
  298. v
  299. page_1 page_2 page_3
  300. ------ ------ ------- ----- -------
  301. ... || | || | || | || | || | ...
  302. ------ ------ ------- ----- -------
  303. physical Ogg bitstream
  304. In this example we take a snapshot of the encapsulation process of
  305. one logical bitstream. We can see part of that bitstream's
  306. subdivision into packets as provided by the codec. The Ogg
  307. encapsulation process chops up the packets into segments. The
  308. packets in this example are rather large such that packet_1 is split
  309. into 5 segments - 4 segments with 255 bytes and a final smaller one.
  310. Packet_2 is split into 4 segments - 3 segments with 255 bytes and a
  311. Pfeiffer Informational [Page 8]
  312. RFC 3533 OGG May 2003
  313. final very small one - and packet_3 is split into two segments. The
  314. encapsulation process then creates pages, which are quite small in
  315. this example. Page_1 consists of the first three segments of
  316. packet_1, page_2 contains the remaining 2 segments from packet_1, and
  317. page_3 contains the first three pages of packet_2. Finally, this
  318. logical bitstream is multiplexed into a physical Ogg bitstream with
  319. pages of other logical bitstreams.
  320. 6. The Ogg page format
  321. A physical Ogg bitstream consists of a sequence of concatenated
  322. pages. Pages are of variable size, usually 4-8 kB, maximum 65307
  323. bytes. A page header contains all the information needed to
  324. demultiplex the logical bitstreams out of the physical bitstream and
  325. to perform basic error recovery and landmarks for seeking. Each page
  326. is a self-contained entity such that the page decode mechanism can
  327. recognize, verify, and handle single pages at a time without
  328. requiring the overall bitstream.
  329. The Ogg page header has the following format:
  330. 0 1 2 3
  331. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1| Byte
  332. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  333. | capture_pattern: Magic number for page start "OggS" | 0-3
  334. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  335. | version | header_type | granule_position | 4-7
  336. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  337. | | 8-11
  338. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  339. | | bitstream_serial_number | 12-15
  340. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  341. | | page_sequence_number | 16-19
  342. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  343. | | CRC_checksum | 20-23
  344. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  345. | |page_segments | segment_table | 24-27
  346. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  347. | ... | 28-
  348. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  349. The LSb (least significant bit) comes first in the Bytes. Fields
  350. with more than one byte length are encoded LSB (least significant
  351. byte) first.
  352. Pfeiffer Informational [Page 9]
  353. RFC 3533 OGG May 2003
  354. The fields in the page header have the following meaning:
  355. 1. capture_pattern: a 4 Byte field that signifies the beginning of a
  356. page. It contains the magic numbers:
  357. 0x4f 'O'
  358. 0x67 'g'
  359. 0x67 'g'
  360. 0x53 'S'
  361. It helps a decoder to find the page boundaries and regain
  362. synchronisation after parsing a corrupted stream. Once the
  363. capture pattern is found, the decoder verifies page sync and
  364. integrity by computing and comparing the checksum.
  365. 2. stream_structure_version: 1 Byte signifying the version number of
  366. the Ogg file format used in this stream (this document specifies
  367. version 0).
  368. 3. header_type_flag: the bits in this 1 Byte field identify the
  369. specific type of this page.
  370. * bit 0x01
  371. set: page contains data of a packet continued from the previous
  372. page
  373. unset: page contains a fresh packet
  374. * bit 0x02
  375. set: this is the first page of a logical bitstream (bos)
  376. unset: this page is not a first page
  377. * bit 0x04
  378. set: this is the last page of a logical bitstream (eos)
  379. unset: this page is not a last page
  380. 4. granule_position: an 8 Byte field containing position information.
  381. For example, for an audio stream, it MAY contain the total number
  382. of PCM samples encoded after including all frames finished on this
  383. page. For a video stream it MAY contain the total number of video
  384. Pfeiffer Informational [Page 10]
  385. RFC 3533 OGG May 2003
  386. frames encoded after this page. This is a hint for the decoder
  387. and gives it some timing and position information. Its meaning is
  388. dependent on the codec for that logical bitstream and specified in
  389. a specific media mapping. A special value of -1 (in two's
  390. complement) indicates that no packets finish on this page.
  391. 5. bitstream_serial_number: a 4 Byte field containing the unique
  392. serial number by which the logical bitstream is identified.
  393. 6. page_sequence_number: a 4 Byte field containing the sequence
  394. number of the page so the decoder can identify page loss. This
  395. sequence number is increasing on each logical bitstream
  396. separately.
  397. 7. CRC_checksum: a 4 Byte field containing a 32 bit CRC checksum of
  398. the page (including header with zero CRC field and page content).
  399. The generator polynomial is 0x04c11db7.
  400. 8. number_page_segments: 1 Byte giving the number of segment entries
  401. encoded in the segment table.
  402. 9. segment_table: number_page_segments Bytes containing the lacing
  403. values of all segments in this page. Each Byte contains one
  404. lacing value.
  405. The total header size in bytes is given by:
  406. header_size = number_page_segments + 27 [Byte]
  407. The total page size in Bytes is given by:
  408. page_size = header_size + sum(lacing_values: 1..number_page_segments)
  409. [Byte]
  410. 7. Security Considerations
  411. The Ogg encapsulation format is a container format and only
  412. encapsulates content (such as Vorbis-encoded audio). It does not
  413. provide for any generic encryption or signing of itself or its
  414. contained content bitstreams. However, it encapsulates any kind of
  415. content bitstream as long as there is a codec for it, and is thus
  416. able to contain encrypted and signed content data. It is also
  417. possible to add an external security mechanism that encrypts or signs
  418. an Ogg physical bitstream and thus provides content confidentiality
  419. and authenticity.
  420. As Ogg encapsulates binary data, it is possible to include executable
  421. content in an Ogg bitstream. This can be an issue with applications
  422. that are implemented using the Ogg format, especially when Ogg is
  423. used for streaming or file transfer in a networking scenario. As
  424. Pfeiffer Informational [Page 11]
  425. RFC 3533 OGG May 2003
  426. such, Ogg does not pose a threat there. However, an application
  427. decoding Ogg and its encapsulated content bitstreams has to ensure
  428. correct handling of manipulated bitstreams, of buffer overflows and
  429. the like.
  430. 8. References
  431. [1] Walleij, L., "The application/ogg Media Type", RFC 3534, May
  432. 2003.
  433. [2] Bradner, S., "Key words for use in RFCs to Indicate Requirement
  434. Levels", BCP 14, RFC 2119, March 1997.
  435. Pfeiffer Informational [Page 12]
  436. RFC 3533 OGG May 2003
  437. Appendix A. Glossary of terms and abbreviations
  438. bos page: The initial page (beginning of stream) of a logical
  439. bitstream which contains information to identify the codec type
  440. and other decoding-relevant information.
  441. chaining (or sequential multiplexing): Concatenation of two or more
  442. complete physical Ogg bitstreams.
  443. eos page: The final page (end of stream) of a logical bitstream.
  444. granule position: An increasing position number for a specific
  445. logical bitstream stored in the page header. Its meaning is
  446. dependent on the codec for that logical bitstream and specified in
  447. a specific media mapping.
  448. grouping (or concurrent multiplexing): Interleaving of pages of
  449. several logical bitstreams into one complete physical Ogg
  450. bitstream under the restriction that all bos pages of all grouped
  451. logical bitstreams MUST appear before any data pages.
  452. lacing value: An entry in the segment table of a page header
  453. representing the size of the related segment.
  454. logical bitstream: A sequence of bits being the result of an encoded
  455. media stream.
  456. media mapping: A specific use of the Ogg encapsulation format
  457. together with a specific (set of) codec(s).
  458. (Ogg) packet: A subpart of a logical bitstream that is created by the
  459. encoder for that bitstream and represents a meaningful entity for
  460. the encoder, but only a sequence of bits to the Ogg encapsulation.
  461. (Ogg) page: A physical bitstream consists of a sequence of Ogg pages
  462. containing data of one logical bitstream only. It usually
  463. contains a group of contiguous segments of one packet only, but
  464. sometimes packets are too large and need to be split over several
  465. pages.
  466. physical (Ogg) bitstream: The sequence of bits resulting from an Ogg
  467. encapsulation of one or several logical bitstreams. It consists
  468. of a sequence of pages from the logical bitstreams with the
  469. restriction that the pages of one logical bitstream MUST come in
  470. their correct temporal order.
  471. Pfeiffer Informational [Page 13]
  472. RFC 3533 OGG May 2003
  473. (Ogg) segment: The Ogg encapsulation process splits each packet into
  474. chunks of 255 bytes plus a last fractional chunk of less than 255
  475. bytes. These chunks are called segments.
  476. Appendix B. Acknowledgements
  477. The author gratefully acknowledges the work that Christopher
  478. Montgomery and the Xiph.Org foundation have done in defining the Ogg
  479. multimedia project and as part of it the open file format described
  480. in this document. The author hopes that providing this document to
  481. the Internet community will help in promoting the Ogg multimedia
  482. project at http://www.xiph.org/. Many thanks also for the many
  483. technical and typo corrections that C. Montgomery and the Ogg
  484. community provided as feedback to this RFC.
  485. Author's Address
  486. Silvia Pfeiffer
  487. CSIRO, Australia
  488. Locked Bag 17
  489. North Ryde, NSW 2113
  490. Australia
  491. Phone: +61 2 9325 3141
  492. EMail: Silvia.Pfeiffer@csiro.au
  493. URI: http://www.cmis.csiro.au/Silvia.Pfeiffer/
  494. Pfeiffer Informational [Page 14]
  495. RFC 3533 OGG May 2003
  496. Full Copyright Statement
  497. Copyright (C) The Internet Society (2003). All Rights Reserved.
  498. This document and translations of it may be copied and furnished to
  499. others, and derivative works that comment on or otherwise explain it
  500. or assist in its implementation may be prepared, copied, published
  501. and distributed, in whole or in part, without restriction of any
  502. kind, provided that the above copyright notice and this paragraph are
  503. included on all such copies and derivative works. However, this
  504. document itself may not be modified in any way, such as by removing
  505. the copyright notice or references to the Internet Society or other
  506. Internet organizations, except as needed for the purpose of
  507. developing Internet standards in which case the procedures for
  508. copyrights defined in the Internet Standards process must be
  509. followed, or as required to translate it into languages other than
  510. English.
  511. The limited permissions granted above are perpetual and will not be
  512. revoked by the Internet Society or its successors or assigns.
  513. This document and the information contained herein is provided on an
  514. "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  515. TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  516. BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  517. HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  518. MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  519. Acknowledgement
  520. Funding for the RFC Editor function is currently provided by the
  521. Internet Society.
  522. Pfeiffer Informational [Page 15]