draft-kerr-avt-theora-rtp-00.txt 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513
  1. AVT Working Group P. Kerr
  2. Internet-Draft Xiph.Org
  3. Expires: August 1, 2005 January 31, 2005
  4. draft-kerr-avt-theora-rtp-00
  5. RTP Payload Format for Theora Encoded Video
  6. Status of this Memo
  7. This document is an Internet-Draft and is subject to all provisions
  8. of section 3 of RFC 3667. By submitting this Internet-Draft, each
  9. author represents that any applicable patent or other IPR claims of
  10. which he or she is aware have been or will be disclosed, and any of
  11. which he or she become aware will be disclosed, in accordance with
  12. RFC 3668.
  13. Internet-Drafts are working documents of the Internet Engineering
  14. Task Force (IETF), its areas, and its working groups. Note that
  15. other groups may also distribute working documents as
  16. Internet-Drafts.
  17. Internet-Drafts are draft documents valid for a maximum of six months
  18. and may be updated, replaced, or obsoleted by other documents at any
  19. time. It is inappropriate to use Internet-Drafts as reference
  20. material or to cite them other than as "work in progress."
  21. The list of current Internet-Drafts can be accessed at
  22. http://www.ietf.org/ietf/1id-abstracts.txt.
  23. The list of Internet-Draft Shadow Directories can be accessed at
  24. http://www.ietf.org/shadow.html.
  25. This Internet-Draft will expire on August 1, 2005.
  26. Copyright Notice
  27. Copyright (C) The Internet Society (2005).
  28. Abstract
  29. This document describes a RTP payload format for transporting Theora
  30. encoded video. It details the RTP encapsulation mechanism for raw
  31. Theora data and configuration headers consisting of the quantization
  32. matrices and the Huffman codebooks for the DCT coefficients, and a
  33. table of limit values for the deblocking filter.
  34. Also included within the document are the necessary details for the
  35. use of Theora with MIME and Session Description Protocol (SDP).
  36. Kerr Expires August 1, 2005 [Page 1]
  37. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  38. Editors Note
  39. All references to RFC XXXX are to be replaced by references to the
  40. RFC number of this memo, when published.
  41. Table of Contents
  42. 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
  43. 1.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . 3
  44. 2. Payload Format . . . . . . . . . . . . . . . . . . . . . . . . 4
  45. 2.1 RTP Header . . . . . . . . . . . . . . . . . . . . . . . . 4
  46. 2.2 Payload Header . . . . . . . . . . . . . . . . . . . . . . 5
  47. 2.3 Payload Data . . . . . . . . . . . . . . . . . . . . . . . 6
  48. 2.4 Example RTP Packet . . . . . . . . . . . . . . . . . . . . 7
  49. 3. Frame Packetizing . . . . . . . . . . . . . . . . . . . . . . 8
  50. 3.1 Example Fragmented Theora Packet . . . . . . . . . . . . . 9
  51. 4. Packet Loss . . . . . . . . . . . . . . . . . . . . . . . . . 12
  52. 5. Configuration Headers . . . . . . . . . . . . . . . . . . . . 13
  53. 5.1 In-band Header Transmission . . . . . . . . . . . . . . . 13
  54. 5.1.1 Identification Header . . . . . . . . . . . . . . . . 13
  55. 5.1.2 Comment Header . . . . . . . . . . . . . . . . . . . . 15
  56. 5.1.3 Setup Header . . . . . . . . . . . . . . . . . . . . . 16
  57. 5.2 Packed Headers Delivery . . . . . . . . . . . . . . . . . 18
  58. 5.2.1 Packed Headers IANA Considerations . . . . . . . . . . 21
  59. 5.3 Setup Header Caching . . . . . . . . . . . . . . . . . . . 22
  60. 5.4 Loss of Configuration Headers . . . . . . . . . . . . . . 22
  61. 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23
  62. 6.1 Mapping MIME Parameters into SDP . . . . . . . . . . . . . 24
  63. 7. Security Considerations . . . . . . . . . . . . . . . . . . . 25
  64. 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 25
  65. 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 25
  66. 9.1 Normative References . . . . . . . . . . . . . . . . . . . . 25
  67. 9.2 Informative References . . . . . . . . . . . . . . . . . . . 26
  68. Author's Address . . . . . . . . . . . . . . . . . . . . . . . 26
  69. Intellectual Property and Copyright Statements . . . . . . . . 27
  70. Kerr Expires August 1, 2005 [Page 2]
  71. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  72. 1. Introduction
  73. Theora is a general purpose, lossy video codec. It is based on the
  74. VP3.1 video codec produced by On2 Technologies and has been donated
  75. to the Xiph.org Foundation.
  76. Theora I is a block-based lossy transform codec that utilizes an 8 x
  77. 8 Type-II Discrete Cosine Transform and block-based motion
  78. compensation. This places it in the same class of codecs as MPEG-1,
  79. MPEG-2, MPEG-4, and H.263. The details of how individual blocks are
  80. organized and how DCT coefficients are stored in the bitstream differ
  81. substantially from these codecs, however. Theora supports only intra
  82. frames (I frames in MPEG) and inter frames (P frames in MPEG).
  83. Theora provides none of its own framing, synchronization, or
  84. protection against transmission errors. Theora is a free-form
  85. variable bit rate (VBR) codec, and packets have no minimum size,
  86. maximum size, or fixed/expected size. Theora packets are thus
  87. intended to be used with a transport mechanism that provides
  88. free-form framing, synchronization, positioning, and error correction
  89. in accordance with these design assumptions, such as Ogg [1]. or
  90. RTP/AVP [3].
  91. Theora I currently supports progressive video data of arbitrary
  92. dimensions at a constant frame rate in one of several YCbCr color
  93. spaces. Three different chroma subsampling formats are supported:
  94. 4:2:0, 4:2:2, and 4:4:4. The Theora I format does not support
  95. interlaced material, variable frame rates, bit-depths larger than 8
  96. bits per component, nor alternate color spaces such as RGB or
  97. arbitrary multi-channel spaces. Black and white content can be
  98. efficiently encoded, however, because the uniform chroma planes
  99. compress well.
  100. Theora is similar to Vorbis audio [9] in that it requires the
  101. inclusion of the entire probability model for the DCT coefficients
  102. and all the quantization parameters in the bitstream headers to be
  103. sent ahead of the video data. It is therefore impossible to decode
  104. any frame in the stream without having previously fetched the codec
  105. info and codec setup headers, although Theora can initiate decode at
  106. an arbitrary intra-frame packet within a bitstream so long as the
  107. codec has been initialized with the setup headers.
  108. 1.1 Terminology
  109. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  110. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  111. document are to be interpreted as described in RFC 2119 [2].
  112. Kerr Expires August 1, 2005 [Page 3]
  113. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  114. 2. Payload Format
  115. Each frame of digital video is packetized into one or more RTP
  116. packets. If the data for a complete frame exceeds the network MTU,
  117. it SHOULD be fragmented into multiple RTP packets, each smaller than
  118. the MTU. A single RTP packet MAY contain data for more than one
  119. Theora frame.
  120. For RTP based transportation of Theora encoded video the standard RTP
  121. header is followed by a 5 octet payload header, then the payload
  122. data.
  123. 2.1 RTP Header
  124. The format of the RTP header is specified in [3] and shown in Figure
  125. 1. This payload format uses the fields of the header in a manner
  126. consistent with that specification.
  127. 0 1 2 3
  128. 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
  129. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  130. |V=2|P|X| CC |M| PT | sequence number |
  131. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  132. | timestamp |
  133. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  134. | synchronization source (SSRC) identifier |
  135. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  136. | contributing source (CSRC) identifiers |
  137. | ... |
  138. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  139. Figure 1: RTP Header
  140. The RTP header begins with an octet of fields (V, P, X, and CC) to
  141. support specialized RTP uses (see [3] and [4] for details). For
  142. Theora RTP, the following values are used.
  143. Version (V): 2 bits
  144. This field identifies the version of RTP. The version used by this
  145. specification is two (2).
  146. Padding (P): 1 bit
  147. Padding MAY be used with this payload format according to section 5.1
  148. of [3].
  149. Extension (X): 1 bit
  150. Kerr Expires August 1, 2005 [Page 4]
  151. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  152. The Extension bit is used in accordance with [3].
  153. CSRC count (CC): 4 bits
  154. The CSRC count is used in accordance with [3].
  155. Marker (M): 1 bit
  156. The Marker bit is used in accordance with [3].
  157. Payload Type (PT): 7 bits
  158. An RTP profile for a class of applications is expected to assign a
  159. payload type for this format, or a dynamically allocated payload type
  160. SHOULD be chosen which designates the payload as Theora.
  161. Sequence number: 16 bits
  162. The sequence number increments by one for each RTP data packet sent,
  163. and may be used by the receiver to detect packet loss and to restore
  164. packet sequence. This field is detailed further in [3].
  165. Timestamp: 32 bits
  166. A timestamp representing the sampling time of the first sample of the
  167. first Theora packet in the RTP packet. The clock frequency MUST be
  168. set to the sample rate of the encoded video data and is conveyed
  169. out-of-band as an SDP attribute.
  170. SSRC/CSRC identifiers:
  171. These two fields, 32 bits each with one SSRC field and a maximum of
  172. 16 CSRC fields, are as defined in [3].
  173. 2.2 Payload Header
  174. After the RTP Header section the following five octets are the
  175. Payload Header. This header is split into a number of bitfields
  176. detailing the format of the following Payload Data packets.
  177. Kerr Expires August 1, 2005 [Page 5]
  178. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  179. 0 1 2 3
  180. 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
  181. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  182. | Setup Header Ident |
  183. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  184. |C|F|0|0|# pkts.|
  185. +-+-+-+-+-+-+-+-+
  186. Figure 2: Payload Header
  187. Setup Header Ident: 32 bits
  188. This 32 bit field is used to associate the Theora data to a decoding
  189. Setup Header. It is created by making a CRC32 checksum of the Setup
  190. Header required to decode the particular Theora video stream.
  191. Continuation (C): 1 bit
  192. Set to one if this is a continuation of a fragmented packet.
  193. Fragmented (F): 1 bit
  194. Set to one if the payload contains complete packets or if it contains
  195. the last fragment of a fragmented packet.
  196. The next two bits are currently reserved and MUST be set to 0.
  197. The last 4 bits are the number of complete packets in this payload.
  198. This provides for a maximum number of 15 Theora packets in the
  199. payload. If the packet contains fragmented data the number of
  200. packets MUST be set to 0.
  201. 2.3 Payload Data
  202. Each Theora payload section starts with a three octet header. The
  203. first octet is used to denote what kind of Theora data follows. Then
  204. a two octet length header is used to represent the size of the
  205. following data payload, followed by the raw Theora data.
  206. Kerr Expires August 1, 2005 [Page 6]
  207. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  208. 0 1 2 3
  209. 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
  210. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  211. | Data type | Payload Length | Theora Data ..
  212. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  213. Figure 3: Payload Data
  214. The data type octet is used to signify the payload data type. If the
  215. first bit is set to 0, this indicates the payload is Theora video
  216. data.
  217. The following values for the Theora payload type are valid:
  218. 0 = Raw Theora data
  219. 0x80 = Theora Identification header
  220. 0x81 = Theora Comment header
  221. 0x82 = Theora Setup header
  222. The Theora packet length header is the length of the Theora data
  223. block only and does not count the length octets and payload data type
  224. octet.
  225. The Theora codec uses relatively unstructured raw packets containing
  226. binary integer fields of arbitrary width that often do not fall on an
  227. octet boundary. When this happens the bitstream is packed to an
  228. octet boundary. When a Theora encoder produces packets unused space
  229. in the last byte of a packet is always zeroed during the encoding
  230. process. Thus, should this unused space be read, it will return
  231. binary zeros.
  232. For payloads which consist of multiple Theora packets the payload
  233. data consists of the data type field, the payload length field
  234. followed by the payload data for each of the Theora packets in the
  235. payload.
  236. 2.4 Example RTP Packet
  237. Here is an example RTP packet containing two Theora packets.
  238. RTP Packet Header:
  239. Kerr Expires August 1, 2005 [Page 7]
  240. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  241. 0 1 2 3
  242. 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
  243. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  244. | 2 |0|0| 0 |0| PT | sequence number |
  245. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  246. | timestamp (in sample rate units) |
  247. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  248. | synchronisation source (SSRC) identifier |
  249. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  250. | contributing source (CSRC) identifiers |
  251. | ... |
  252. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  253. Figure 4: Example RTP Packet
  254. Payload Data:
  255. 0 1 2 3
  256. 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
  257. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  258. | Setup Header Ident |
  259. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  260. |0|1|0|0| 2 pks | 0x80 | Payload Length |
  261. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  262. | Theora data ..
  263. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  264. .. data | 0 | Payload Length ..
  265. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  266. .. Theora data |
  267. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  268. Figure 5: Example Theora Payload Packet
  269. The payload portion of the packet starts with the 32 bit Setup Header
  270. ident field followed by the 8 bit fragment/count fields. The F bit
  271. is set to 1, indicating that this packet contains whole Theora frame
  272. data. The number of whole Theora data packets is set to 2.
  273. Each of the payload blocks starts with a Data type field, for the
  274. first payload this is set to 0x80 indicating it is an Identification
  275. header and the second payload is set to 0 indicating it is raw Theora
  276. data. Then the two octet length field is followed by the variable
  277. length Theora data.
  278. 3. Frame Packetizing
  279. Each RTP packet contains either one complete Theora packet, one
  280. Theora packet fragment, or an integer number of complete Theora
  281. Kerr Expires August 1, 2005 [Page 8]
  282. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  283. packets (up to a max of 15 packets, since the number of packets is
  284. defined by a 4 bit value).
  285. Any Theora data packet that is less than path MTU SHOULD be bundled
  286. in the RTP packet with as many Theora packets as will fit, up to a
  287. maximum of 15. Path MTU is detailed in [6] and [7].
  288. If a Theora packet is larger than 65535 octets it MUST be fragmented.
  289. A fragmented packet has a zero in the last four bits of the payload
  290. header. Each fragment after the first will also set the Continued
  291. (C) bit to one in the payload header. The RTP packet containing the
  292. last fragment of the Theora packet will have the Fragmented (F) bit
  293. set to one. To maintain the correct sequence for fragmented packet
  294. reception the timestamp field of fragmented packets MUST be the same
  295. as the first packet sent, with the sequence number incremented as
  296. normal for the subsequent RTP packets.
  297. 3.1 Example Fragmented Theora Packet
  298. Here is an example fragmented Theora packet split over three RTP
  299. packets. Each packet contains the standard RTP headers as well as
  300. the 5 octet Theora headers.
  301. Kerr Expires August 1, 2005 [Page 9]
  302. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  303. Packet 1:
  304. 0 1 2 3
  305. 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
  306. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  307. |V=2|P|X| CC |M| PT | 1000 |
  308. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  309. | xxxxx |
  310. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  311. | synchronization source (SSRC) identifier |
  312. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  313. | contributing source (CSRC) identifiers |
  314. | ... |
  315. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  316. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  317. | Setup Header Ident |
  318. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  319. |0|0|0|0| 0| 0 | Payload Length |
  320. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  321. | Theora data ..
  322. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  323. Figure 6: Example Fragmented Packet (Packet 1)
  324. In this packet the initial sequence number is 1000 and the timestamp
  325. is xxxxx. The Continuation (C) bit is set to one, indicating it is
  326. not the continuation of a fragmented bit, and the Fragmentation (F)
  327. is set to 0 indicating it is a fragmented packet. The number of
  328. packets field is set to 0, and as the payload is raw Theora data the
  329. Theora payload type field is set to 0.
  330. Kerr Expires August 1, 2005 [Page 10]
  331. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  332. Packet 2:
  333. 0 1 2 3
  334. 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
  335. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  336. |V=2|P|X| CC |M| PT | 1001 |
  337. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  338. | xxxxx |
  339. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  340. | synchronization source (SSRC) identifier |
  341. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  342. | contributing source (CSRC) identifiers |
  343. | ... |
  344. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  345. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  346. | Setup Header Ident |
  347. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  348. |1|0|0|0| 0| 0 | Payload Length |
  349. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  350. | Theora data ..
  351. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  352. Figure 7: Example Fragmented Packet (Packet 2)
  353. The C bit is set to 1 and the number of packets field is set to 0.
  354. For large Theora fragments there can be several of these type of
  355. payload packets. The maximum packet size SHOULD be no greater than
  356. the path MTU, including all RTP and payload headers. The sequence
  357. number has been incremented by one but the timestamp field remains
  358. the same as the initial packet.
  359. Kerr Expires August 1, 2005 [Page 11]
  360. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  361. Packet 3:
  362. 0 1 2 3
  363. 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
  364. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  365. |V=2|P|X| CC |M| PT | 1002 |
  366. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  367. | xxxxx |
  368. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  369. | synchronization source (SSRC) identifier |
  370. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  371. | contributing source (CSRC) identifiers |
  372. | ... |
  373. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  374. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  375. | Setup Header Ident |
  376. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  377. |1|1|0|0| 0| 0 | Payload Length |
  378. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  379. | Theora data ..
  380. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  381. Figure 8: Example Fragmented Packet (Packet 3)
  382. This is the last Theora fragment packet. The C and F bits are set
  383. and the packet count remains set to 0. As in the previous packets
  384. the timestamp remains set to the first packet in the sequence and the
  385. sequence number has been incremented.
  386. 4. Packet Loss
  387. As there is no error correction within the Theora stream, packet loss
  388. will result in a loss of signal. Packet loss is more of an issue for
  389. fragmented Theora packets as the client will have to cope with the
  390. handling of the C and F flags. If we use the fragmented Theora
  391. packet example above and the first packet is lost the client SHOULD
  392. detect that the next packet has the packet count field set to 0 and
  393. the C bit is set and MUST drop it. The next packet, which is the
  394. final fragmented packet, SHOULD be dropped in the same manner, or
  395. buffered. Feedback reports on lost and dropped packets MUST be sent
  396. back via RTCP.
  397. If a particular multicast session has a large number of participants
  398. care must be taken to prevent an RTCP feedback implosion, [8], in the
  399. event of packet loss from a large number of participants.
  400. Kerr Expires August 1, 2005 [Page 12]
  401. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  402. 5. Configuration Headers
  403. To decode a Theora stream three configuration header blocks are
  404. needed. The first header, the Identification Header, indicates the
  405. frame dimensions, quality, blocks used and the version of the Theora
  406. encoder used. The second header, the Comment Header, contains stream
  407. metadata and the third header, the Setup Header, details which
  408. contains dequantization and Huffman tables.
  409. As the RTP stream may change certain configuration data mid-session
  410. there are two different methods for delivering this configuration
  411. data to a client, in-band and SDP which is detailed below. SDP
  412. delivery is used to set-up an initial state for the client
  413. application and in-band is used to change state during the session.
  414. The changes may be due to different metadata or Setup Header as well
  415. as different bitrates of the stream.
  416. Out of the two delivery vectors the use of an SDP attribute to
  417. indicate an URI where the configuration and Setup Header data can be
  418. obtained is preferred as they can be fetched reliably using TCP. The
  419. in-band Setup Header delivery SHOULD only be used in situations where
  420. the link between the client is unidirectional or if the SDP-based
  421. information is not available.
  422. Synchronizing the configuration and Setup Header to the RTP stream is
  423. critical. The 32 bit Setup Header Ident field is used to indicate
  424. when a change in the stream has taken place. The client application
  425. MUST have in advance the correct configuration and Setup Headers and
  426. if the client detects a change in the Ident value and does not have
  427. this information it MUST NOT decode the raw Theora data.
  428. 5.1 In-band Header Transmission
  429. The three header data blocks are sent in-band with the packet type
  430. bits set to match the payload type. Normally the Setup Header and
  431. Identification Header are sent once per session if the stream is an
  432. encoding of live video, as typically the encoder state will not
  433. change, but the encoder state can change at the boundary of chained
  434. Theora video files. Metadata can be sent at the start as well as any
  435. time during the life of the session. Clients MUST be capable of
  436. dealing with periodic re-transmission of the configuration headers.
  437. 5.1.1 Identification Header
  438. The Identification Header is a short header with only a few fields
  439. used to declare the stream definitively as Theora and provide
  440. detailed information about the format of the fully decoded video
  441. data.
  442. Kerr Expires August 1, 2005 [Page 13]
  443. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  444. 0 1 2 3
  445. 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
  446. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  447. |V=2|P|X| CC |M| PT | xxxx |
  448. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  449. | xxxxx |
  450. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  451. | synchronization source (SSRC) identifier |
  452. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  453. | contributing source (CSRC) identifiers |
  454. | ... |
  455. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  456. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  457. | Setup Header Ident |
  458. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  459. |0|1|0|0| 1| 0x80 | Payload Length |
  460. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  461. | VMAJ | VMIN | VREV | FMBW |
  462. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  463. | FMBW | FMBH | NSBS |
  464. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  465. | NSBS | |
  466. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  467. | NBS | NMBS |
  468. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  469. | NMBS | PICW |
  470. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  471. | PICW | PICH |
  472. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  473. | PICH | PICX | PICY | FRN |
  474. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  475. | FRN | FRD |
  476. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  477. | FRD | PARN |
  478. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  479. | PARN | PARD |
  480. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  481. | PARD | CS |PF | NOMBR |
  482. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  483. | NOMBR | QUAL | KFGSHIFT|
  484. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  485. Figure 9: Identification Header
  486. The fields listed above have the following meanings:
  487. Kerr Expires August 1, 2005 [Page 14]
  488. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  489. VMAJ = The major version number. 8 bits.
  490. VMIN = The minor version number. 8 bits.
  491. VREV = The version revision number. 8 bits.
  492. FMBW = The width of the frame in macro blocks. 16 bits.
  493. FMBH = The height of the frame in macro blocks. 16 bits.
  494. NSBS = The total number of super blocks in a frame. 32 bits.
  495. NBS = The total number of blocks in a frame. 36 bits.
  496. NMBS = The total number of macro blocks in a frame. 32 bits.
  497. PICW = The width of the picture region in pixels. 20 bits.
  498. PICH = The height of the picture region in pixels. 20 bits.
  499. PICX = The X offset of the picture region in pixels. 8 bits.
  500. PICY = The Y offset of the picture region in pixels. 8 bits.
  501. FRN = The frame-rate numerator. 32 bits.
  502. FRD = The frame-rate denominator. 32 bits.
  503. PARN = The pixel aspect-ratio numerator. 24 bits.
  504. PARD = The pixel aspect-ratio denominator. 24 bits.
  505. CS = The color space. 8 bits.
  506. PF = The pixel format. 2 bits.
  507. NOMBR = The nominal bitrate of the stream, in bits per second.
  508. 24 bits.
  509. QUAL = The quality hint. 6 bits.
  510. KFGSHIFT = The amount to shift the key frame number by in the
  511. granule position. 5 bits.
  512. 5.1.2 Comment Header
  513. The Theora Comment Header is the second of three header packets that
  514. begin a Theora stream. It is meant for short text comments, not
  515. arbitrary metadata; arbitrary metadata belongs in a separate logical
  516. stream that provides greater structure and machine parseability. The
  517. comment field is meant to be used much like someone jotting a quick
  518. note on the label of a video. It should be a little information to
  519. remember the disc or tape by and explain it to others; a short,
  520. to-the-point text note that can be more than a couple words, but
  521. isn't going to be more than a short paragraph.
  522. Kerr Expires August 1, 2005 [Page 15]
  523. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  524. 0 1 2 3
  525. 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
  526. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  527. |V=2|P|X| CC |M| PT | xxxx |
  528. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  529. | xxxxx |
  530. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  531. | synchronization source (SSRC) identifier |
  532. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  533. | contributing source (CSRC) identifiers |
  534. | ... |
  535. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  536. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  537. | Setup Header Ident |
  538. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  539. |0|1|0|0| 1| 0x81 | Payload Length |
  540. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  541. | User comments list length |
  542. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  543. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  544. | User comment length |
  545. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  546. | User comment ..
  547. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  548. .. User comment |
  549. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  550. Figure 10: Comment Header
  551. The format for the data takes the form of a 32 bit field denoting the
  552. number of user comments. Each of the user comments is prefixed by a
  553. 32 bit length field followed by the comment text encoded in UTF-8.
  554. 5.1.3 Setup Header
  555. The Theora setup header contains the limit values used to drive the
  556. loop filter, the base matrices and scale values used to build the
  557. dequantization tables, and the Huffman tables used to unpack the DCT
  558. tokens. Because the contents of this header are specific to Theora,
  559. no concessions have been made to keep the fields octet-aligned for
  560. easy parsing.
  561. Kerr Expires August 1, 2005 [Page 16]
  562. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  563. 0 1 2 3
  564. 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
  565. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  566. |V=2|P|X| CC |M| PT | xxxx |
  567. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  568. | xxxxx |
  569. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  570. | synchronization source (SSRC) identifier |
  571. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  572. | contributing source (CSRC) identifiers |
  573. | ... |
  574. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  575. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  576. | Setup Header Ident |
  577. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  578. |0|1|0|0| 1| 0x82 | Payload Length |
  579. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  580. | Setup Header Length |
  581. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  582. | Setup Header ..
  583. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  584. .. Setup Header |
  585. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  586. Figure 11: Setup Header
  587. 5.1.3.1 Setup Header CRC32 Generation
  588. In order for different implementations of Theora RTP clients and
  589. servers to interoperate with each other a common format for the
  590. production of the CRC32 hash is required. The polynomial is
  591. X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0.
  592. The following C code function SHOULD be used by implementations, if
  593. not then the code responsible for generating the CRC32 value MUST use
  594. the polynomial function above.
  595. unsigned int crc32 (int length, unsigned char *crcdata)
  596. {
  597. int index, loop;
  598. unsigned int byte, crc, mask;
  599. index = 0;
  600. crc = 0xFFFFFFFF;
  601. while (index < length) {
  602. byte = crcdata [index];
  603. Kerr Expires August 1, 2005 [Page 17]
  604. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  605. crc = crc ^ byte;
  606. for (loop = 7; loop >= 0; loop--) {
  607. mask = -(crc & 1);
  608. crc = (crc >> 1) ^ (0xEDB88320 & mask);
  609. }
  610. index++;
  611. }
  612. return ~crc;
  613. }
  614. 5.2 Packed Headers Delivery
  615. As mentioned above the RECOMMENDED delivery vector for Theora
  616. configuration data is via an SDP attribute as this retrieval method
  617. can be performed using a reliable transport protocol.
  618. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  619. | Number of packed headers |
  620. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  621. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  622. | Packed header |
  623. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  624. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  625. | Packed header |
  626. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  627. Figure 12: Packed Headers Overview
  628. As the RTP headers are not required for this method of delivery the
  629. structure of the configuration data is slightly different. The
  630. packed header starts with a 32 bit count field which details the
  631. number of packed headers that are contained in the bundle. Next is
  632. the packed header payload for each chained Theora file.
  633. Kerr Expires August 1, 2005 [Page 18]
  634. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  635. 0 1 2 3
  636. 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
  637. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  638. | Header Length |
  639. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  640. | Setup Header Ident |
  641. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  642. | Identification Header ..
  643. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  644. .. Identification Header |
  645. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  646. | Comment Header ..
  647. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  648. .. Comment Header |
  649. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  650. | Setup Header ..
  651. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  652. .. Setup Header |
  653. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  654. Figure 13: Packed Headers Detail
  655. The key difference between the in-band format is there is no need for
  656. the payload header octet and Setup Header Ident field. Below are
  657. examples of the packed headers format.
  658. Kerr Expires August 1, 2005 [Page 19]
  659. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  660. 0 1 2 3
  661. 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
  662. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  663. | VMAJ | VMIN | VREV | FMBW |
  664. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  665. | FMBW | FMBH | NSBS |
  666. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  667. | NSBS | |
  668. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  669. | NBS | NMBS |
  670. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  671. | NMBS | PICW |
  672. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  673. | PICW | PICH |
  674. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  675. | PICH | PICX | PICY | FRN |
  676. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  677. | FRN | FRD |
  678. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  679. | FRD | PARN |
  680. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  681. | PARN | PARD |
  682. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  683. | PARD | CS |PF | NOMBR |
  684. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  685. | NOMBR | QUAL | KFGSHIFT|
  686. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  687. Figure 14: Packed Identification Header
  688. The alignment of the packed Identification Header is slightly
  689. different from the RTP payload type as the payload header is not
  690. used.
  691. Kerr Expires August 1, 2005 [Page 20]
  692. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  693. 0 1 2 3
  694. 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
  695. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  696. | User comments list length |
  697. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  698. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  699. | User comment length |
  700. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  701. | User comment ..
  702. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  703. .. User comment |
  704. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  705. Figure 15: Packed Comment Header
  706. The packed Comment Header also as a slightly different structure to
  707. that of the RTP payload type with the payload header not being used.
  708. 0 1 2 3
  709. 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
  710. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  711. | Setup Header Length |
  712. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  713. | Setup Header ..
  714. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  715. .. Setup Header |
  716. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  717. Figure 16: Packed Setup Header
  718. The packed Setup Header also has a slightly different structure to
  719. that of the RTP payload type. The Setup Header Ident field that is
  720. normally part of this structure is moved to the second field of the
  721. overall packed structure.
  722. 5.2.1 Packed Headers IANA Considerations
  723. The following IANA considerations MUST only be applied to the packed
  724. headers.
  725. MIME media type name: video
  726. MIME subtype: theora-config
  727. Required Parameters:
  728. None.
  729. Kerr Expires August 1, 2005 [Page 21]
  730. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  731. Optional Parameters:
  732. None.
  733. Encoding considerations:
  734. This type is only defined for transfer via HTTP as specified in RFC
  735. XXXX.
  736. Security Considerations:
  737. See Section 6 of RFC 3047.
  738. Interoperability considerations: none
  739. Published specification:
  740. See RFC XXXX for details.
  741. Applications which use this media type:
  742. Theora encoded video, configuration data.
  743. Additional information: none
  744. Person & email address to contact for further information:
  745. Phil Kerr: <phil@plus24.com>
  746. Intended usage: COMMON
  747. Author/Change controller:
  748. Author: Phil Kerr
  749. Change controller: IETF AVT Working Group
  750. 5.3 Setup Header Caching
  751. Setup Header caching allows clients that have previously connected to
  752. a stream to re-use the associated Setup Header and configuration
  753. data. When a client receives a Setup Header it may store it locally
  754. and can compare the CRC32 key with that of the new stream and begin
  755. decoding before it has received any of the headers.
  756. 5.4 Loss of Configuration Headers
  757. Unlike the loss of raw Theora payload data, loss of a configuration
  758. Kerr Expires August 1, 2005 [Page 22]
  759. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  760. header can lead to a situation where it will not be possible to
  761. successfully decode the stream.
  762. Out of the three headers, loss of either the Setup Header or
  763. Identification Headers MUST result in the halting of stream decoding.
  764. Loss of the Comment header SHOULD NOT be regarded as fatal for
  765. decoding. Loss of any of the headers SHOULD be reported to the
  766. client as well as a loss report sent via RTCP.
  767. 6. IANA Considerations
  768. MIME media type name: video
  769. MIME subtype: theora
  770. Required Parameters:
  771. sampling: Determines the chroma subsampling format.
  772. width: Determines the number of pixels per line. This is an integer
  773. between 1 and 1048561 and MUST be in multiples of 16.
  774. height: Determines the number of lines per frame. This is an integer
  775. between 1 and 1048561 and MUST be in multiples of 16.
  776. header: Indicates the URI of the decoding configuration headers.
  777. Optional Parameters:
  778. None.
  779. Encoding considerations:
  780. This type is only defined for transfer via RTP as specified in RFC
  781. XXXX.
  782. Security Considerations:
  783. See Section 6 of RFC 3047.
  784. Interoperability considerations: none
  785. Published specification:
  786. See the Theora documentation [11] for details.
  787. Applications which use this media type:
  788. Kerr Expires August 1, 2005 [Page 23]
  789. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  790. Video streaming and conferencing tools
  791. Additional information: none
  792. Person & email address to contact for further information:
  793. Phil Kerr: <phil@plus24.com>
  794. Intended usage: COMMON
  795. Author/Change controller:
  796. Author: Phil Kerr
  797. Change controller: IETF AVT Working Group
  798. 6.1 Mapping MIME Parameters into SDP
  799. The information carried in the MIME media type specification has a
  800. specific mapping to fields in the Session Description Protocol (SDP)
  801. [5], which is commonly used to describe RTP sessions. When SDP is
  802. used to specify sessions the mapping are as follows:
  803. o The MIME type ("video") goes in SDP "m=" as the media name.
  804. o The MIME subtype ("THEORA") goes in SDP "a=rtpmap" as the encoding
  805. name.
  806. o The parameter "rate" also goes in "a=rtpmap" as clock rate.
  807. o The parameter "channels" also goes in "a=rtpmap" as channel count.
  808. o The parameter "header" goes in the SDP "a=fmpt" attribute.
  809. If the stream comprises chained Theora files the configuration and
  810. Setup Headers for each file SHOULD be packaged together and passed to
  811. the client using the headers attribute if all the files to be played
  812. are known in advance.
  813. Example:
  814. c=IN IP4/6
  815. m=video RTP/AVP 98
  816. a=rtpmap:98 theora/90000
  817. a=fmtp:98 sampling=YCbCr-4:2:2; width=1280; height=720;
  818. header=<URI of configuration header>
  819. Kerr Expires August 1, 2005 [Page 24]
  820. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  821. 7. Security Considerations
  822. RTP packets using this payload format are subject to the security
  823. considerations discussed in the RTP specification [3]. This implies
  824. that the confidentiality of the media stream is achieved by using
  825. encryption. Because the data compression used with this payload
  826. format is applied end-to-end, encryption may be performed on the
  827. compressed data. Where the size of a data block is set care MUST be
  828. taken to prevent buffer overflows in the client applications.
  829. 8. Acknowledgments
  830. Thanks to the AVT, Ogg Theora Communities / Xiph.org, Fluendo, Ralph
  831. Giles.
  832. 9. References
  833. 9.1 Normative References
  834. [1] Pfeiffer, S., "The Ogg Encapsulation Format Version 0", RFC
  835. 3533.
  836. [2] Bradner, S., "Key words for use in RFCs to Indicate Requirement
  837. Levels", RFC 2119.
  838. [3] Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson,
  839. "RTP: A Transport Protocol for real-time applications", RFC
  840. 3550.
  841. [4] Schulzrinne, H. and S. Casner, "RTP Profile for video and Video
  842. Conferences with Minimal Control.", RFC 3551.
  843. [5] Handley, M. and V. Jacobson, "SDP: Session Description
  844. Protocol", RFC 2327.
  845. [6] Mogul et al., J., "Path MTU Discovery", RFC 1063.
  846. [7] McCann et al., J., "Path MTU Discovery for IP version 6", RFC
  847. 1981.
  848. [8] Ott, J., Wenger, S., Sato, N., Burmeister, C. and J. Rey,
  849. "Extended RTP Profile for RTCP-based Feedback (RTP/AVPF)",
  850. Internet Draft (draft-ietf-avt-rtcp-feedback-11: Work in
  851. progress).
  852. [9] Kerr, P., "RTP Payload Format for Vorbis Encoded Audio -
  853. draft-ietf-avt-vorbis-rtp-00", Internet Draft (Work in
  854. progress).
  855. Kerr Expires August 1, 2005 [Page 25]
  856. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  857. 9.2 Informative References
  858. [10] "libTheora: Available from the Xiph website,
  859. http://www.xiph.org".
  860. [11] "Ogg Theora I spec: Codec setup and packet decode.
  861. http://www.xiph.org/ogg/Theora/doc/Theora-spec-ref.html".
  862. Author's Address
  863. Phil Kerr
  864. Xiph.Org
  865. EMail: phil@plus24.com
  866. URI: http://www.xiph.org/
  867. Kerr Expires August 1, 2005 [Page 26]
  868. Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005
  869. Intellectual Property Statement
  870. The IETF takes no position regarding the validity or scope of any
  871. Intellectual Property Rights or other rights that might be claimed to
  872. pertain to the implementation or use of the technology described in
  873. this document or the extent to which any license under such rights
  874. might or might not be available; nor does it represent that it has
  875. made any independent effort to identify any such rights. Information
  876. on the procedures with respect to rights in RFC documents can be
  877. found in BCP 78 and BCP 79.
  878. Copies of IPR disclosures made to the IETF Secretariat and any
  879. assurances of licenses to be made available, or the result of an
  880. attempt made to obtain a general license or permission for the use of
  881. such proprietary rights by implementers or users of this
  882. specification can be obtained from the IETF on-line IPR repository at
  883. http://www.ietf.org/ipr.
  884. The IETF invites any interested party to bring to its attention any
  885. copyrights, patents or patent applications, or other proprietary
  886. rights that may cover technology that may be required to implement
  887. this standard. Please address the information to the IETF at
  888. ietf-ipr@ietf.org.
  889. Disclaimer of Validity
  890. This document and the information contained herein are provided on an
  891. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  892. OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
  893. ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
  894. INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
  895. INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  896. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  897. Copyright Statement
  898. Copyright (C) The Internet Society (2005). This document is subject
  899. to the rights, licenses and restrictions contained in BCP 78, and
  900. except as set forth therein, the authors retain all their rights.
  901. Acknowledgment
  902. Funding for the RFC Editor function is currently provided by the
  903. Internet Society.
  904. Kerr Expires August 1, 2005 [Page 27]