v-comment.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <HTML><HEAD><TITLE>xiph.org: Ogg Vorbis documentation</TITLE>
  2. <BODY bgcolor="#ffffff" text="#202020" link="#006666" vlink="#000000">
  3. <nobr><img src="white-ogg.png"><img src="vorbisword2.png"></nobr><p>
  4. <h1><font color=#000070>
  5. Ogg Vorbis comment field specification
  6. </font></h1>
  7. <em>Last update to this document: October 2, 2001</em><p>
  8. <p>The text comment header is the second (of three) header packets that
  9. begin a Vorbis bitstream. It is meant for short, text comments,
  10. not arbitrary metadata; arbitrary metadata belongs in a separate
  11. logical bitream (usually an XML stream type) that provides greater
  12. structure and machine parseability.</p>
  13. <h2>Comment use rationale</h2>
  14. The comment field is meant to be used much like someone jotting a
  15. quick note on the bottom of a CDR. It should be a little information to
  16. remember the disc by and explain it to others; a short, to-the-point
  17. text note that need not only be a couple words, but isn't going to be
  18. more than a short paragraph. The essentials, in other words, whatever
  19. they turn out to be, eg:
  20. <blockquote>
  21. "Honest Bob and the Factory-to-Dealer-Incentives, _I'm Still Around_,
  22. opening for Moxy Fruvous, 1997"
  23. </blockquote>
  24. <h2>Structure</h2>
  25. The comment header logically is a list of eight-bit-clean vectors; the
  26. number of vectors is bounded to 2^32-1 and the length of each vector
  27. is limited to 2^32-1 bytes. The vector length is encoded; the vector
  28. is not null terminated. In addition to the vector list, there is a
  29. single vector for vendor name (also 8 bit clean, length encoded in 32
  30. bits). Libvorbis currently sets the vendor string to "Xiphophorus
  31. libVorbis I 20010910".<p>
  32. The comment vectors are structured similarly to a UNIX environment variable.
  33. That is, comment fields consist of a field name and a field value and
  34. look like:
  35. <pre>
  36. comment[0]="ARTIST=me";
  37. comment[1]="TITLE=the sound of vorbis";
  38. </pre>
  39. <h2>Content vector format</h2>
  40. <ul>
  41. <li>A case-insensitive field name that may consist of ASCII 0x20 through
  42. 0x7D, 0x3D ('=') excluded. ASCII 0x41 through 0x5A inclusive (A-Z) is
  43. to be considered equivalent to ASCII 0x61 through 0x7A inclusive
  44. (a-z).
  45. <li>The field name is immediately followed by ASCII 0x3D ('='); this
  46. equals sign is used to terminate the field name.
  47. <li>0x3D is followed by 8 bit clean UTF-8 encoded field contents
  48. to the end of the field.
  49. </ul>
  50. <h3>Field names</h3>
  51. Below is a proposed, minimal list of standard filed names with a
  52. description of intended use. No single or group of field names is
  53. mandatory; a comment header may contain one, all or none of the names
  54. in this list.
  55. <dl>
  56. <dt>TITLE<dd>Track name
  57. <dt>VERSION<dd>The version field may be used to differentiate multiple
  58. versions of the same track title in a single collection. (e.g. remix info)
  59. <dt>ALBUM<dd>The collection name to which this track belongs
  60. <dt>TRACKNUMBER<dd>The track number of this piece if part of a specific larger collection or album
  61. <dt>ARTIST<dd>The artist generally considered responsible for the work. In popular music this is usually the performing band or singer. For classical music it would be the composer. For an audio book it would be the author of the original text.
  62. <dt>PERFORMER<dd>The artist(s) who performed the work. In classical music this would be the conductor, orchestra, soloists. In an audio book it would be the actor who did the reading. In popular music this is typically the same as the ARTIST and is ommitted.
  63. <dt>ORGANIZATION<dd>Name of the organization producing the track (i.e.
  64. the 'record label')
  65. <dt>DESCRIPTION<dd>A short text description of the contents
  66. <dt>GENRE<dd>A short text indication of music genre
  67. <dt>DATE<dd>Date the track was recorded
  68. <dt>LOCATION<dd>Location where track was recorded
  69. <dt>COPYRIGHT<dd>Copyright and license information (e.g. '(c) 2001 Nobody's Band. All rights reserved' or '(c) 1999 Jack Moffit, distributed under the terms of the Open Audio License. see http://www.eff.org/IP/Open_licenses/eff_oal.html for details')
  70. <dt>CONTACT<dd>Contact information for the creators or distributors of the track. This could be a URL, an email address, the physical address of the producing label.
  71. <dt>ISRC<dd>ISRC number for the track; see <a href="http://www.ifpi.org/site-content/online/isrc_intro.html">the ISRC intro page</a> for more information on ISRC numbers.
  72. <dt>DISCID<dd>Table of contents hash from an associated disc, generally used to index the track in published music databases. See <a href="http://freedb.org/">http://freedb.org/</a> for and example of such a hash.
  73. </dl>
  74. <h3>Implications</h3>
  75. <ul>
  76. <li>
  77. Field names should not be 'internationalized'; this is a
  78. concession to simplicity not an attempt to exclude the majority of
  79. the world that doesn't speak English. Field *contents*, however,
  80. are represented in UTF-8 to allow easy representation of any language.
  81. <li>
  82. We have the length of the entirety of the field and restrictions on
  83. the field name so that the field name is bounded in a known way. Thus
  84. we also have the length of the field contents.
  85. <li>
  86. Individual 'vendors' may use non-standard field names within
  87. reason. The proper use of comment fields should be clear through
  88. context at this point. Abuse will be discouraged.
  89. <li>
  90. There is no vendor-specific prefix to 'nonstandard' field names.
  91. Vendors should make some effort to avoid arbitrarily polluting the
  92. common namespace. We will generally collect the more useful tags
  93. here to help with standardization.
  94. <li>
  95. Field names are not required to be unique (occur once) within a
  96. comment header. As an example, assume a track was recorded by three
  97. well know artists; the following is permissible, and encouraged:
  98. <pre>
  99. ARTIST=Dizzy Gillespie
  100. ARTIST=Sonny Rollins
  101. ARTIST=Sonny Stitt
  102. </pre>
  103. </ul>
  104. <h2>Encoding</h2>
  105. The comment header comprises the entirety of the second bitstream
  106. header packet. Unlike the first bitstream header packet, it is not
  107. generally the only packet on the second page and may not be restricted
  108. to within the second bitstream page. The length of the comment header
  109. packet is [practically] unbounded. The comment header packet is not
  110. optional; it must be present in the bitstream even if it is
  111. effectively empty.<p>
  112. The comment header is encoded as follows (as per Ogg's standard
  113. bitstream mapping which renders least-significant-bit of the word to be
  114. coded into the least significant available bit of the current
  115. bitstream octet first):
  116. <ol>
  117. <li>
  118. Vendor string length (32 bit unsigned quantity specifying number of octets)
  119. <li>
  120. Vendor string ([vendor string length] octets coded from beginning of string to end of string, not null terminated)
  121. <li>Number of comment fields (32 bit unsigned quantity specifying number of fields)
  122. <li>Comment field 0 length (if [Number of comment fields]>0; 32 bit unsigned quantity specifying number of octets)
  123. <li>
  124. Comment field 0 ([Comment field 0 length] octets coded from beginning of string to end of string, not null terminated)
  125. <li>Comment field 1 length (if [Number of comment fields]>1...)...
  126. </ol>
  127. This is actually somewhat easier to describe in code; implementation of the above can be found in vorbis/lib/info.c:_vorbis_pack_comment(),_vorbis_unpack_comment()
  128. <hr>
  129. <a href="http://www.xiph.org/">
  130. <img src="white-xifish.png" align=left border=0>
  131. </a>
  132. <font size=-2 color=#505050>
  133. Ogg is a <a href="http://www.xiph.org">Xiphophorus</a> effort to
  134. protect essential tenets of Internet multimedia from corporate
  135. hostage-taking; Open Source is the net's greatest tool to keep
  136. everyone honest. See <a href="http://www.xiph.org/about.html">About
  137. Xiphophorus</a> for details.
  138. <p>
  139. Ogg Vorbis is the first Ogg audio CODEC. Anyone may
  140. freely use and distribute the Ogg and Vorbis specification,
  141. whether in a private, public or corporate capacity. However,
  142. Xiphophorus and the Ogg project (xiph.org) reserve the right to set
  143. the Ogg/Vorbis specification and certify specification compliance.<p>
  144. Xiphophorus's Vorbis software CODEC implementation is distributed
  145. under the Lesser/Library GNU Public License. This does not restrict
  146. third parties from distributing independent implementations of Vorbis
  147. software under other licenses.<p>
  148. OggSquish, Vorbis, Xiphophorus and their logos are trademarks (tm) of
  149. <a href="http://www.xiph.org/">Xiphophorus</a>. These pages are
  150. copyright (C) 1994-2001 Xiphophorus. All rights reserved.<p>
  151. </body>