animation 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. #------------------------------------------------------------------------------
  2. # animation: file(1) magic for animation/movie formats
  3. #
  4. # animation formats
  5. # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
  6. # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
  7. # MPEG animation format
  8. 0 belong 0x000001b3 MPEG video stream data
  9. #>4 beshort&0xfff0 x (%d x
  10. #>5 beshort&0x0fff x %d)
  11. 0 belong 0x000001ba MPEG system stream data
  12. # MPEG Audio (*.mpx)
  13. # from dreesen@math.fu-berlin.de
  14. 0 beshort &0xffe0 MPEG
  15. # MPEG 1.0
  16. >1 byte&0x08 =0x08 \b 1.0
  17. # Layer 3
  18. >>1 byte &0x02 \b layer 3 audio stream data
  19. >>>2 byte&0xf0 =0x10 \b, 32 kBit/s
  20. >>>2 byte&0xf0 =0x20 \b, 40 kBit/s
  21. >>>2 byte&0xf0 =0x30 \b, 48 kBit/s
  22. >>>2 byte&0xf0 =0x40 \b, 56 kBit/s
  23. >>>2 byte&0xf0 =0x50 \b, 64 kBit/s
  24. >>>2 byte&0xf0 =0x60 \b, 80 kBit/s
  25. >>>2 byte&0xf0 =0x70 \b, 96 kBit/s
  26. >>>2 byte&0xf0 =0x80 \b, 112 kBit/s
  27. >>>2 byte&0xf0 =0x90 \b, 128 kBit/s
  28. >>>2 byte&0xf0 =0xA0 \b, 160 kBit/s
  29. >>>2 byte&0xf0 =0xB0 \b, 192 kBit/s
  30. >>>2 byte&0xf0 =0xC0 \b, 224 kBit/s
  31. >>>2 byte&0xf0 =0xD0 \b, 256 kBit/s
  32. >>>2 byte&0xf0 =0xE0 \b, 320 kBit/s
  33. # Layer 2
  34. >>1 byte &0x04 \b layer 2 audio stream data
  35. >>>2 byte&0xf0 =0x10 \b, 32 kBit/s
  36. >>>2 byte&0xf0 =0x20 \b, 48 kBit/s
  37. >>>2 byte&0xf0 =0x30 \b, 56 kBit/s
  38. >>>2 byte&0xf0 =0x40 \b, 64 kBit/s
  39. >>>2 byte&0xf0 =0x50 \b, 80 kBit/s
  40. >>>2 byte&0xf0 =0x60 \b, 96 kBit/s
  41. >>>2 byte&0xf0 =0x70 \b, 112 kBit/s
  42. >>>2 byte&0xf0 =0x80 \b, 128 kBit/s
  43. >>>2 byte&0xf0 =0x90 \b, 160 kBit/s
  44. >>>2 byte&0xf0 =0xA0 \b, 192 kBit/s
  45. >>>2 byte&0xf0 =0xB0 \b, 224 kBit/s
  46. >>>2 byte&0xf0 =0xC0 \b, 256 kBit/s
  47. >>>2 byte&0xf0 =0xD0 \b, 320 kBit/s
  48. >>>2 byte&0xf0 =0xE0 \b, 384 kBit/s
  49. # freq
  50. >>2 byte&0x0C =0x00 \b, 44.1 kHz
  51. >>2 byte&0x0C =0x04 \b, 48 kHz
  52. >>2 byte&0x0C =0x08 \b, 32 kHz
  53. # MPEG 2.5
  54. >1 byte&0x18 =0x00 \b 2.5
  55. # Layer 3
  56. >>1 byte &0x02 \b layer 3 audio stream data
  57. # Layer 2
  58. >>1 byte &0x04 \b layer 2 audio stream data
  59. # MPEG 2.0
  60. >1 byte&0x18 =0x10 \b 2.0
  61. # Layer 3
  62. >>1 byte &0x02 \b layer 3 audio stream data
  63. # Layer 2
  64. >>1 byte &0x04 \b layer 2 audio stream data
  65. >>2 byte&0xf0 =0x10 \b, 8 kBit/s
  66. >>2 byte&0xf0 =0x20 \b, 16 kBit/s
  67. >>2 byte&0xf0 =0x30 \b, 24 kBit/s
  68. >>2 byte&0xf0 =0x40 \b, 32 kBit/s
  69. >>2 byte&0xf0 =0x50 \b, 40 kBit/s
  70. >>2 byte&0xf0 =0x60 \b, 48 kBit/s
  71. >>2 byte&0xf0 =0x70 \b, 56 kBit/s
  72. >>2 byte&0xf0 =0x80 \b, 64 kBit/s
  73. >>2 byte&0xf0 =0x90 \b, 80 kBit/s
  74. >>2 byte&0xf0 =0xA0 \b, 96 kBit/s
  75. >>2 byte&0xf0 =0xB0 \b, 112 kBit/s
  76. >>2 byte&0xf0 =0xC0 \b, 128 kBit/s
  77. >>2 byte&0xf0 =0xD0 \b, 144 kBit/s
  78. >>2 byte&0xf0 =0xE0 \b, 160 kBit/s
  79. # freq
  80. >>2 byte&0x0C =0x00 \b, 22.05 kHz
  81. >>2 byte&0x0C =0x04 \b, 24 kHz
  82. >>2 byte&0x0C =0x08 \b, 16 kHz
  83. # misc
  84. >3 byte&0xC0 =0x00 \b, stereo
  85. >3 byte&0xC0 =0x40 \b, jstereo
  86. >3 byte&0xC0 =0x80 \b, dual-ch
  87. >3 byte&0xC0 =0xC0 \b, mono
  88. #>1 byte&0x01 =0x00 \b, Error Protection
  89. #>2 byte&0x02 =0x02 \b, Padding
  90. #>2 byte&0x01 =0x01 \b, Private
  91. #>3 byte&0x08 =0x08 \b, Copyright
  92. #>3 byte&0x04 =0x04 \b, Original
  93. #>3 byte&0x03 1 \b, Emphasis 5
  94. #>3 byte&0x03 3 \b, Emphasis c
  95. # FLI animation format
  96. 4 leshort 0xAF11 FLI file
  97. >6 leshort x - %d frames,
  98. >8 leshort x width=%d pixels,
  99. >10 leshort x height=%d pixels,
  100. >12 leshort x depth=%d,
  101. >16 leshort x ticks/frame=%d
  102. # FLC animation format
  103. 4 leshort 0xAF12 FLC file
  104. >6 leshort x - %d frames
  105. >8 leshort x width=%d pixels,
  106. >10 leshort x height=%d pixels,
  107. >12 leshort x depth=%d,
  108. >16 leshort x ticks/frame=%d
  109. # DL animation format
  110. # XXX - collision with most `mips' magic
  111. #
  112. # I couldn't find a real magic number for these, however, this
  113. # -appears- to work. Note that it might catch other files, too, so be
  114. # careful!
  115. #
  116. # Note that title and author appear in the two 20-byte chunks
  117. # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
  118. # 255 (hex FF)! The DL format is really bad.
  119. #
  120. #0 byte 1 DL version 1, medium format (160x100, 4 images/screen)
  121. #>42 byte x - %d screens,
  122. #>43 byte x %d commands
  123. #0 byte 2 DL version 2
  124. #>1 byte 1 - large format (320x200,1 image/screen),
  125. #>1 byte 2 - medium format (160x100,4 images/screen),
  126. #>1 byte >2 - unknown format,
  127. #>42 byte x %d screens,
  128. #>43 byte x %d commands
  129. # Based on empirical evidence, DL version 3 have several nulls following the
  130. # \003. Most of them start with non-null values at hex offset 0x34 or so.
  131. #0 string \3\0\0\0\0\0\0\0\0\0\0\0 DL version 3
  132. # SGI and Apple formats
  133. 0 string MOVI Silicon Graphics movie file
  134. 4 string moov Apple QuickTime movie file (moov)
  135. 4 string mdat Apple QuickTime movie file (mdat)
  136. # iso 13818 transport stream
  137. #
  138. # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
  139. # (the following is a little bit restrictive and works fine for a stream
  140. # that starts with PAT properly. it won't work for stream data, that is
  141. # cut from an input device data right in the middle, but this shouldn't
  142. # disturb)
  143. # syncbyte 8 bit 0x47
  144. # error_ind 1 bit -
  145. # payload_start 1 bit 1
  146. # priority 1 bit -
  147. # PID 13 bit 0x0000
  148. # scrambling 2 bit -
  149. # adaptfld_ctrl 2 bit 1 or 3
  150. # conti_count 4 bit 0
  151. 0 belong&0xFF5FFF1F 0x47400010 MPEG transport stream data
  152. >188 byte !0x47 CORRUPTED
  153. # DIF digital video file format <mpruett@sgi.com>
  154. 0 belong&0xffffff00 0x1f070000 DIF
  155. >4 byte &0x01 (DVCPRO) movie file
  156. >4 byte ^0x01 (DV) movie file
  157. >3 byte &0x80 (PAL)
  158. >3 byte ^0x80 (NTSC)
  159. # Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
  160. 0 belong 0x3026b275 Microsoft ASF
  161. # Vivo video (Wolfram Kleff)
  162. 3 string \x0D\x0AVersion:Vivo Vivo video data