vorbis 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #------------------------------------------------------------------------------
  2. # vorbis: file(1) magic for Ogg/Vorbis files
  3. #
  4. # From Felix von Leitner <leitner@fefe.de>
  5. # Extended by Beni Cherniavsky <cben@crosswinds.net>
  6. # Further extended by Greg Wooledge <greg@wooledge.org>
  7. #
  8. # Most (everything but the number of channels and bitrate) is commented
  9. # out with `##' as it's not interesting to the average user. The most
  10. # probable things advanced users would want to uncomment are probably
  11. # the number of comments and the encoder version.
  12. #
  13. # --- Ogg Framing ---
  14. 0 string OggS Ogg data
  15. >4 byte !0 UNKNOWN REVISION %u
  16. ##>4 byte 0 revision 0
  17. >4 byte 0
  18. ##>>14 lelong x (Serial %lX)
  19. # non-Vorbis content: FLAC (Free Lossless Audio Codec, http://flac.sourceforge.net)
  20. >>28 string fLaC \b, FLAC audio
  21. # non-Vorbis content: Theora
  22. >>28 string \x80theora \b, Theora video
  23. # non-Vorbis content: Speex
  24. >>28 string Speex\ \ \ \b, Speex audio
  25. # non-Vorbis content: OGM
  26. >>28 string \x01video\0\0\0 \b, OGM video
  27. >>>37 string/c div3 (DivX 3)
  28. >>>37 string/c divx (DivX 4)
  29. >>>37 string/c dx50 (DivX 5)
  30. >>>37 string/c xvid (XviD)
  31. # --- First vorbis packet - general header ---
  32. >>28 string \x01vorbis \b, Vorbis audio,
  33. >>>35 lelong !0 UNKNOWN VERSION %lu,
  34. ##>>>35 lelong 0 version 0,
  35. >>>35 lelong 0
  36. >>>>39 ubyte 1 mono,
  37. >>>>39 ubyte 2 stereo,
  38. >>>>39 ubyte >2 %u channels,
  39. >>>>40 lelong x %lu Hz
  40. # Minimal, nominal and maximal bitrates specified when encoding
  41. >>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff \b,
  42. # The above tests if at least one of these is specified:
  43. >>>>>52 lelong !-1
  44. # Vorbis RC2 has a bug which puts -1000 in the min/max bitrate fields
  45. # instead of -1.
  46. # Vorbis 1.0 uses 0 instead of -1.
  47. >>>>>>52 lelong !0
  48. >>>>>>>52 lelong !-1000
  49. >>>>>>>>52 lelong x <%lu
  50. >>>>>48 lelong !-1
  51. >>>>>>48 lelong x ~%lu
  52. >>>>>44 lelong !-1
  53. >>>>>>44 lelong !-1000
  54. >>>>>>>44 lelong !0
  55. >>>>>>>>44 lelong x >%lu
  56. >>>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff bps
  57. # -- Second vorbis header packet - the comments
  58. # A kludge to read the vendor string. It's a counted string, not a
  59. # zero-terminated one, so file(1) can't read it in a generic way.
  60. # libVorbis is the only one existing currently, so I detect specifically
  61. # it. The interesting value is the cvs date (8 digits decimal).
  62. # Post-RC1 Ogg files have the second header packet (and thus the version)
  63. # in a different place, so we must use an indirect offset.
  64. >>>(84.b+85) string \x03vorbis
  65. >>>>(84.b+96) string/c Xiphophorus\ libVorbis\ I \b, created by: Xiphophorus libVorbis I
  66. >>>>>(84.b+120) string >00000000
  67. # Map to beta version numbers:
  68. >>>>>>(84.b+120) string <20000508 (<beta1, prepublic)
  69. >>>>>>(84.b+120) string 20000508 (1.0 beta 1 or beta 2)
  70. >>>>>>(84.b+120) string >20000508
  71. >>>>>>>(84.b+120) string <20001031 (beta2-3)
  72. >>>>>>(84.b+120) string 20001031 (1.0 beta 3)
  73. >>>>>>(84.b+120) string >20001031
  74. >>>>>>>(84.b+120) string <20010225 (beta3-4)
  75. >>>>>>(84.b+120) string 20010225 (1.0 beta 4)
  76. >>>>>>(84.b+120) string >20010225
  77. >>>>>>>(84.b+120) string <20010615 (beta4-RC1)
  78. >>>>>>(84.b+120) string 20010615 (1.0 RC1)
  79. >>>>>>(84.b+120) string 20010813 (1.0 RC2)
  80. >>>>>>(84.b+120) string 20010816 (RC2 - Garf tuned v1)
  81. >>>>>>(84.b+120) string 20011014 (RC2 - Garf tuned v2)
  82. >>>>>>(84.b+120) string 20011217 (1.0 RC3)
  83. >>>>>>(84.b+120) string 20011231 (1.0 RC3)
  84. # Some pre-1.0 CVS snapshots still had "Xiphphorus"...
  85. >>>>>>(84.b+120) string >20011231 (pre-1.0 CVS)
  86. # For the 1.0 release, Xiphophorus is replaced by Xiph.Org
  87. >>>>(84.b+96) string/c Xiph.Org\ libVorbis\ I \b, created by: Xiph.Org libVorbis I
  88. >>>>>(84.b+117) string >00000000
  89. >>>>>>(84.b+117) string <20020717 (pre-1.0 CVS)
  90. >>>>>>(84.b+117) string 20020717 (1.0)
  91. >>>>>>(84.b+117) string 20030909 (1.0.1)
  92. >>>>>>(84.b+117) string 20040629 (1.1.0 RC1)