animation 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  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. # SGI and Apple formats
  8. 0 string MOVI Silicon Graphics movie file
  9. 4 string moov Apple QuickTime
  10. >12 string mvhd \b movie (fast start)
  11. >12 string mdra \b URL
  12. >12 string cmov \b movie (fast start, compressed header)
  13. >12 string rmra \b multiple URLs
  14. 4 string mdat Apple QuickTime movie (unoptimized)
  15. 4 string wide Apple QuickTime movie (unoptimized)
  16. 4 string skip Apple QuickTime movie (modified)
  17. 4 string free Apple QuickTime movie (modified)
  18. 4 string idsc Apple QuickTime image (fast start)
  19. 4 string idat Apple QuickTime image (unoptimized)
  20. 4 string pckg Apple QuickTime compressed archive
  21. 4 string/B jP JPEG 2000 image
  22. 4 string ftyp ISO Media
  23. >8 string isom \b, MPEG v4 system, version 1
  24. >8 string iso2 \b, MPEG v4 system, part 12 revision
  25. >8 string mp41 \b, MPEG v4 system, version 1
  26. >8 string mp42 \b, MPEG v4 system, version 2
  27. >8 string mp7t \b, MPEG v4 system, MPEG v7 XML
  28. >8 string mp7b \b, MPEG v4 system, MPEG v7 binary XML
  29. >8 string/B jp2 \b, JPEG 2000
  30. >8 string 3gp \b, MPEG v4 system, 3GPP
  31. >>11 byte 4 \b v4 (H.263/AMR GSM 6.10)
  32. >>11 byte 5 \b v5 (H.263/AMR GSM 6.10)
  33. >>11 byte 6 \b v6 (ITU H.264/AMR GSM 6.10)
  34. >8 string mmp4 \b, MPEG v4 system, 3GPP Mobile
  35. >8 string avc1 \b, MPEG v4 system, 3GPP JVT AVC
  36. >8 string/B M4A \b, MPEG v4 system, iTunes AAC-LC
  37. >8 string/B M4P \b, MPEG v4 system, iTunes AES encrypted
  38. >8 string/B M4B \b, MPEG v4 system, iTunes bookmarked
  39. >8 string/B qt \b, Apple QuickTime movie
  40. # MPEG sequences
  41. # Scans for all common MPEG header start codes
  42. 0 belong 0x00000001 JVT NAL sequence
  43. >4 byte&0x1F 0x07 \b, H.264 video
  44. >>5 byte 66 \b, baseline
  45. >>5 byte 77 \b, main
  46. >>5 byte 88 \b, extended
  47. >>7 byte x \b @ L %u
  48. 0 belong&0xFFFFFF00 0x00000100 MPEG sequence
  49. >3 byte 0xBA
  50. >>4 byte &0x40 \b, v2, program multiplex
  51. >>4 byte ^0x40 \b, v1, system multiplex
  52. >3 byte 0xBB \b, v1/2, multiplex (missing pack header)
  53. >3 byte&0x1F 0x07 \b, H.264 video
  54. >>4 byte 66 \b, baseline
  55. >>4 byte 77 \b, main
  56. >>4 byte 88 \b, extended
  57. >>6 byte x \b @ L %u
  58. >3 byte 0xB0 \b, v4
  59. >>5 belong 0x000001B5
  60. >>>9 byte &0x80
  61. >>>>10 byte&0xF0 16 \b, video
  62. >>>>10 byte&0xF0 32 \b, still texture
  63. >>>>10 byte&0xF0 48 \b, mesh
  64. >>>>10 byte&0xF0 64 \b, face
  65. >>>9 byte&0xF8 8 \b, video
  66. >>>9 byte&0xF8 16 \b, still texture
  67. >>>9 byte&0xF8 24 \b, mesh
  68. >>>9 byte&0xF8 32 \b, face
  69. >>4 byte 1 \b, simple @ L1
  70. >>4 byte 2 \b, simple @ L2
  71. >>4 byte 3 \b, simple @ L3
  72. >>4 byte 4 \b, simple @ L0
  73. >>4 byte 17 \b, simple scalable @ L1
  74. >>4 byte 18 \b, simple scalable @ L2
  75. >>4 byte 33 \b, core @ L1
  76. >>4 byte 34 \b, core @ L2
  77. >>4 byte 50 \b, main @ L2
  78. >>4 byte 51 \b, main @ L3
  79. >>4 byte 53 \b, main @ L4
  80. >>4 byte 66 \b, n-bit @ L2
  81. >>4 byte 81 \b, scalable texture @ L1
  82. >>4 byte 97 \b, simple face animation @ L1
  83. >>4 byte 98 \b, simple face animation @ L2
  84. >>4 byte 99 \b, simple face basic animation @ L1
  85. >>4 byte 100 \b, simple face basic animation @ L2
  86. >>4 byte 113 \b, basic animation text @ L1
  87. >>4 byte 114 \b, basic animation text @ L2
  88. >>4 byte 129 \b, hybrid @ L1
  89. >>4 byte 130 \b, hybrid @ L2
  90. >>4 byte 145 \b, advanced RT simple @ L!
  91. >>4 byte 146 \b, advanced RT simple @ L2
  92. >>4 byte 147 \b, advanced RT simple @ L3
  93. >>4 byte 148 \b, advanced RT simple @ L4
  94. >>4 byte 161 \b, core scalable @ L1
  95. >>4 byte 162 \b, core scalable @ L2
  96. >>4 byte 163 \b, core scalable @ L3
  97. >>4 byte 177 \b, advanced coding efficiency @ L1
  98. >>4 byte 178 \b, advanced coding efficiency @ L2
  99. >>4 byte 179 \b, advanced coding efficiency @ L3
  100. >>4 byte 180 \b, advanced coding efficiency @ L4
  101. >>4 byte 193 \b, advanced core @ L1
  102. >>4 byte 194 \b, advanced core @ L2
  103. >>4 byte 209 \b, advanced scalable texture @ L1
  104. >>4 byte 210 \b, advanced scalable texture @ L2
  105. >>4 byte 211 \b, advanced scalable texture @ L3
  106. >>4 byte 225 \b, simple studio @ L1
  107. >>4 byte 226 \b, simple studio @ L2
  108. >>4 byte 227 \b, simple studio @ L3
  109. >>4 byte 228 \b, simple studio @ L4
  110. >>4 byte 229 \b, core studio @ L1
  111. >>4 byte 230 \b, core studio @ L2
  112. >>4 byte 231 \b, core studio @ L3
  113. >>4 byte 232 \b, core studio @ L4
  114. >>4 byte 240 \b, advanced simple @ L0
  115. >>4 byte 241 \b, advanced simple @ L1
  116. >>4 byte 242 \b, advanced simple @ L2
  117. >>4 byte 243 \b, advanced simple @ L3
  118. >>4 byte 244 \b, advanced simple @ L4
  119. >>4 byte 245 \b, advanced simple @ L5
  120. >>4 byte 247 \b, advanced simple @ L3b
  121. >>4 byte 248 \b, FGS @ L0
  122. >>4 byte 249 \b, FGS @ L1
  123. >>4 byte 250 \b, FGS @ L2
  124. >>4 byte 251 \b, FGS @ L3
  125. >>4 byte 252 \b, FGS @ L4
  126. >>4 byte 253 \b, FGS @ L5
  127. >3 byte 0xB5 \b, v4
  128. >>4 byte &0x80
  129. >>>5 byte&0xF0 16 \b, video (missing profile header)
  130. >>>5 byte&0xF0 32 \b, still texture (missing profile header)
  131. >>>5 byte&0xF0 48 \b, mesh (missing profile header)
  132. >>>5 byte&0xF0 64 \b, face (missing profile header)
  133. >>4 byte&0xF8 8 \b, video (missing profile header)
  134. >>4 byte&0xF8 16 \b, still texture (missing profile header)
  135. >>4 byte&0xF8 24 \b, mesh (missing profile header)
  136. >>4 byte&0xF8 32 \b, face (missing profile header)
  137. >3 byte 0xB3
  138. >>12 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
  139. >>12 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
  140. >>12 belong 0x000001B5 \b, v2,
  141. >>>16 byte&0x0F 1 \b HP
  142. >>>16 byte&0x0F 2 \b Spt
  143. >>>16 byte&0x0F 3 \b SNR
  144. >>>16 byte&0x0F 4 \b MP
  145. >>>16 byte&0x0F 5 \b SP
  146. >>>17 byte&0xF0 64 \b@HL
  147. >>>17 byte&0xF0 96 \b@H-14
  148. >>>17 byte&0xF0 128 \b@ML
  149. >>>17 byte&0xF0 160 \b@LL
  150. >>>17 byte &0x08 \b progressive
  151. >>>17 byte ^0x08 \b interlaced
  152. >>>17 byte&0x06 2 \b Y'CbCr 4:2:0 video
  153. >>>17 byte&0x06 4 \b Y'CbCr 4:2:2 video
  154. >>>17 byte&0x06 6 \b Y'CbCr 4:4:4 video
  155. >>11 byte &0x02
  156. >>>75 byte &0x01
  157. >>>>140 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
  158. >>>>140 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
  159. >>>>140 belong 0x000001B5 \b, v2,
  160. >>>>>144 byte&0x0F 1 \b HP
  161. >>>>>144 byte&0x0F 2 \b Spt
  162. >>>>>144 byte&0x0F 3 \b SNR
  163. >>>>>144 byte&0x0F 4 \b MP
  164. >>>>>144 byte&0x0F 5 \b SP
  165. >>>>>145 byte&0xF0 64 \b@HL
  166. >>>>>145 byte&0xF0 96 \b@H-14
  167. >>>>>145 byte&0xF0 128 \b@ML
  168. >>>>>145 byte&0xF0 160 \b@LL
  169. >>>>>145 byte &0x08 \b progressive
  170. >>>>>145 byte ^0x08 \b interlaced
  171. >>>>>145 byte&0x06 2 \b Y'CbCr 4:2:0 video
  172. >>>>>145 byte&0x06 4 \b Y'CbCr 4:2:2 video
  173. >>>>>145 byte&0x06 6 \b Y'CbCr 4:4:4 video
  174. >>76 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
  175. >>76 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
  176. >>76 belong 0x000001B5 \b, v2,
  177. >>>80 byte&0x0F 1 \b HP
  178. >>>80 byte&0x0F 2 \b Spt
  179. >>>80 byte&0x0F 3 \b SNR
  180. >>>80 byte&0x0F 4 \b MP
  181. >>>80 byte&0x0F 5 \b SP
  182. >>>81 byte&0xF0 64 \b@HL
  183. >>>81 byte&0xF0 96 \b@H-14
  184. >>>81 byte&0xF0 128 \b@ML
  185. >>>81 byte&0xF0 160 \b@LL
  186. >>>81 byte &0x08 \b progressive
  187. >>>81 byte ^0x08 \b interlaced
  188. >>>81 byte&0x06 2 \b Y'CbCr 4:2:0 video
  189. >>>81 byte&0x06 4 \b Y'CbCr 4:2:2 video
  190. >>>81 byte&0x06 6 \b Y'CbCr 4:4:4 video
  191. >>4 belong&0xFFFFFF00 0x78043800 \b, HD-TV 1920P
  192. >>>7 byte&0xF0 0x10 \b, 16:9
  193. >>4 belong&0xFFFFFF00 0x50002D00 \b, SD-TV 1280I
  194. >>>7 byte&0xF0 0x10 \b, 16:9
  195. >>4 belong&0xFFFFFF00 0x30024000 \b, PAL Capture
  196. >>>7 byte&0xF0 0x10 \b, 4:3
  197. >>4 beshort&0xFFF0 0x2C00 \b, 4CIF
  198. >>>5 beshort&0x0FFF 0x01E0 \b NTSC
  199. >>>5 beshort&0x0FFF 0x0240 \b PAL
  200. >>>7 byte&0xF0 0x20 \b, 4:3
  201. >>>7 byte&0xF0 0x30 \b, 16:9
  202. >>>7 byte&0xF0 0x40 \b, 11:5
  203. >>>7 byte&0xF0 0x80 \b, PAL 4:3
  204. >>>7 byte&0xF0 0xC0 \b, NTSC 4:3
  205. >>4 belong&0xFFFFFF00 0x2801E000 \b, LD-TV 640P
  206. >>>7 byte&0xF0 0x10 \b, 4:3
  207. >>4 belong&0xFFFFFF00 0x1400F000 \b, 320x240
  208. >>>7 byte&0xF0 0x10 \b, 4:3
  209. >>4 belong&0xFFFFFF00 0x0F00A000 \b, 240x160
  210. >>>7 byte&0xF0 0x10 \b, 4:3
  211. >>4 belong&0xFFFFFF00 0x0A007800 \b, 160x120
  212. >>>7 byte&0xF0 0x10 \b, 4:3
  213. >>4 beshort&0xFFF0 0x1600 \b, CIF
  214. >>>5 beshort&0x0FFF 0x00F0 \b NTSC
  215. >>>5 beshort&0x0FFF 0x0120 \b PAL
  216. >>>7 byte&0xF0 0x20 \b, 4:3
  217. >>>7 byte&0xF0 0x30 \b, 16:9
  218. >>>7 byte&0xF0 0x40 \b, 11:5
  219. >>>7 byte&0xF0 0x80 \b, PAL 4:3
  220. >>>7 byte&0xF0 0xC0 \b, NTSC 4:3
  221. >>>5 beshort&0x0FFF 0x0240 \b PAL 625
  222. >>>>7 byte&0xF0 0x20 \b, 4:3
  223. >>>>7 byte&0xF0 0x30 \b, 16:9
  224. >>>>7 byte&0xF0 0x40 \b, 11:5
  225. >>4 beshort&0xFFF0 0x2D00 \b, CCIR/ITU
  226. >>>5 beshort&0x0FFF 0x01E0 \b NTSC 525
  227. >>>5 beshort&0x0FFF 0x0240 \b PAL 625
  228. >>>7 byte&0xF0 0x20 \b, 4:3
  229. >>>7 byte&0xF0 0x30 \b, 16:9
  230. >>>7 byte&0xF0 0x40 \b, 11:5
  231. >>4 beshort&0xFFF0 0x1E00 \b, SVCD
  232. >>>5 beshort&0x0FFF 0x01E0 \b NTSC 525
  233. >>>5 beshort&0x0FFF 0x0240 \b PAL 625
  234. >>>7 byte&0xF0 0x20 \b, 4:3
  235. >>>7 byte&0xF0 0x30 \b, 16:9
  236. >>>7 byte&0xF0 0x40 \b, 11:5
  237. >>7 byte&0x0F 1 \b, 23.976 fps
  238. >>7 byte&0x0F 2 \b, 24 fps
  239. >>7 byte&0x0F 3 \b, 25 fps
  240. >>7 byte&0x0F 4 \b, 29.97 fps
  241. >>7 byte&0x0F 5 \b, 30 fps
  242. >>7 byte&0x0F 6 \b, 50 fps
  243. >>7 byte&0x0F 7 \b, 59.94 fps
  244. >>7 byte&0x0F 8 \b, 60 fps
  245. >>11 byte &0x04 \b, Constrained
  246. # MPEG ADTS Audio (*.mpx/mxa/aac)
  247. # from dreesen@math.fu-berlin.de
  248. # modified to fully support MPEG ADTS
  249. # MP3, M1A
  250. 0 beshort&0xFFFE 0xFFFA MPEG ADTS, layer III, v1
  251. # rates
  252. >2 byte&0xF0 0x10 \b, 32 kBits
  253. >2 byte&0xF0 0x20 \b, 40 kBits
  254. >2 byte&0xF0 0x30 \b, 48 kBits
  255. >2 byte&0xF0 0x40 \b, 56 kBits
  256. >2 byte&0xF0 0x50 \b, 64 kBits
  257. >2 byte&0xF0 0x60 \b, 80 kBits
  258. >2 byte&0xF0 0x70 \b, 96 kBits
  259. >2 byte&0xF0 0x80 \b, 112 kBits
  260. >2 byte&0xF0 0x90 \b, 128 kBits
  261. >2 byte&0xF0 0xA0 \b, 160 kBits
  262. >2 byte&0xF0 0xB0 \b, 192 kBits
  263. >2 byte&0xF0 0xC0 \b, 224 kBits
  264. >2 byte&0xF0 0xD0 \b, 256 kBits
  265. >2 byte&0xF0 0xE0 \b, 320 kBits
  266. # timing
  267. >2 byte&0x0C 0x00 \b, 44.1 kHz
  268. >2 byte&0x0C 0x04 \b, 48 kHz
  269. >2 byte&0x0C 0x08 \b, 32 kHz
  270. # channels/options
  271. >3 byte&0xC0 0x00 \b, Stereo
  272. >3 byte&0xC0 0x40 \b, JntStereo
  273. >3 byte&0xC0 0x80 \b, 2x Monaural
  274. >3 byte&0xC0 0xC0 \b, Monaural
  275. #>1 byte ^0x01 \b, Data Verify
  276. #>2 byte &0x02 \b, Packet Pad
  277. #>2 byte &0x01 \b, Custom Flag
  278. #>3 byte &0x08 \b, Copyrighted
  279. #>3 byte &0x04 \b, Original Source
  280. #>3 byte&0x03 1 \b, NR: 50/15 ms
  281. #>3 byte&0x03 3 \b, NR: CCIT J.17
  282. # MP2, M1A
  283. 0 beshort&0xFFFE 0xFFFC MPEG ADTS, layer II, v1
  284. # rates
  285. >2 byte&0xF0 0x10 \b, 32 kBits
  286. >2 byte&0xF0 0x20 \b, 48 kBits
  287. >2 byte&0xF0 0x30 \b, 56 kBits
  288. >2 byte&0xF0 0x40 \b, 64 kBits
  289. >2 byte&0xF0 0x50 \b, 80 kBits
  290. >2 byte&0xF0 0x60 \b, 96 kBits
  291. >2 byte&0xF0 0x70 \b, 112 kBits
  292. >2 byte&0xF0 0x80 \b, 128 kBits
  293. >2 byte&0xF0 0x90 \b, 160 kBits
  294. >2 byte&0xF0 0xA0 \b, 192 kBits
  295. >2 byte&0xF0 0xB0 \b, 224 kBits
  296. >2 byte&0xF0 0xC0 \b, 256 kBits
  297. >2 byte&0xF0 0xD0 \b, 320 kBits
  298. >2 byte&0xF0 0xE0 \b, 384 kBits
  299. # timing
  300. >2 byte&0x0C 0x00 \b, 44.1 kHz
  301. >2 byte&0x0C 0x04 \b, 48 kHz
  302. >2 byte&0x0C 0x08 \b, 32 kHz
  303. # channels/options
  304. >3 byte&0xC0 0x00 \b, Stereo
  305. >3 byte&0xC0 0x40 \b, JntStereo
  306. >3 byte&0xC0 0x80 \b, 2x Monaural
  307. >3 byte&0xC0 0xC0 \b, Monaural
  308. #>1 byte ^0x01 \b, Data Verify
  309. #>2 byte &0x02 \b, Packet Pad
  310. #>2 byte &0x01 \b, Custom Flag
  311. #>3 byte &0x08 \b, Copyrighted
  312. #>3 byte &0x04 \b, Original Source
  313. #>3 byte&0x03 1 \b, NR: 50/15 ms
  314. #>3 byte&0x03 3 \b, NR: CCIT J.17
  315. # MPA, M1A
  316. # modified by Joerg Jenderek
  317. # GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
  318. 0 beshort&0xFFFE 0xFFFE
  319. >2 byte&0xF0 >0x0F
  320. >>2 byte&0xF0 <0xE1 MPEG ADTS, layer I, v1
  321. # rate
  322. >>>2 byte&0xF0 0x10 \b, 32 kBits
  323. >>>2 byte&0xF0 0x20 \b, 64 kBits
  324. >>>2 byte&0xF0 0x30 \b, 96 kBits
  325. >>>2 byte&0xF0 0x40 \b, 128 kBits
  326. >>>2 byte&0xF0 0x50 \b, 160 kBits
  327. >>>2 byte&0xF0 0x60 \b, 192 kBits
  328. >>>2 byte&0xF0 0x70 \b, 224 kBits
  329. >>>2 byte&0xF0 0x80 \b, 256 kBits
  330. >>>2 byte&0xF0 0x90 \b, 288 kBits
  331. >>>2 byte&0xF0 0xA0 \b, 320 kBits
  332. >>>2 byte&0xF0 0xB0 \b, 352 kBits
  333. >>>2 byte&0xF0 0xC0 \b, 384 kBits
  334. >>>2 byte&0xF0 0xD0 \b, 416 kBits
  335. >>>2 byte&0xF0 0xE0 \b, 448 kBits
  336. # timing
  337. >>>2 byte&0x0C 0x00 \b, 44.1 kHz
  338. >>>2 byte&0x0C 0x04 \b, 48 kHz
  339. >>>2 byte&0x0C 0x08 \b, 32 kHz
  340. # channels/options
  341. >>>3 byte&0xC0 0x00 \b, Stereo
  342. >>>3 byte&0xC0 0x40 \b, JntStereo
  343. >>>3 byte&0xC0 0x80 \b, 2x Monaural
  344. >>>3 byte&0xC0 0xC0 \b, Monaural
  345. #>1 byte ^0x01 \b, Data Verify
  346. #>2 byte &0x02 \b, Packet Pad
  347. #>2 byte &0x01 \b, Custom Flag
  348. #>3 byte &0x08 \b, Copyrighted
  349. #>3 byte &0x04 \b, Original Source
  350. #>3 byte&0x03 1 \b, NR: 50/15 ms
  351. #>3 byte&0x03 3 \b, NR: CCIT J.17
  352. # MP3, M2A
  353. 0 beshort&0xFFFE 0xFFF2 MPEG ADTS, layer III, v2
  354. # rate
  355. >2 byte&0xF0 0x10 \b, 8 kBits
  356. >2 byte&0xF0 0x20 \b, 16 kBits
  357. >2 byte&0xF0 0x30 \b, 24 kBits
  358. >2 byte&0xF0 0x40 \b, 32 kBits
  359. >2 byte&0xF0 0x50 \b, 40 kBits
  360. >2 byte&0xF0 0x60 \b, 48 kBits
  361. >2 byte&0xF0 0x70 \b, 56 kBits
  362. >2 byte&0xF0 0x80 \b, 64 kBits
  363. >2 byte&0xF0 0x90 \b, 80 kBits
  364. >2 byte&0xF0 0xA0 \b, 96 kBits
  365. >2 byte&0xF0 0xB0 \b, 112 kBits
  366. >2 byte&0xF0 0xC0 \b, 128 kBits
  367. >2 byte&0xF0 0xD0 \b, 144 kBits
  368. >2 byte&0xF0 0xE0 \b, 160 kBits
  369. # timing
  370. >2 byte&0x0C 0x00 \b, 22.05 kHz
  371. >2 byte&0x0C 0x04 \b, 24 kHz
  372. >2 byte&0x0C 0x08 \b, 16 kHz
  373. # channels/options
  374. >3 byte&0xC0 0x00 \b, Stereo
  375. >3 byte&0xC0 0x40 \b, JntStereo
  376. >3 byte&0xC0 0x80 \b, 2x Monaural
  377. >3 byte&0xC0 0xC0 \b, Monaural
  378. #>1 byte ^0x01 \b, Data Verify
  379. #>2 byte &0x02 \b, Packet Pad
  380. #>2 byte &0x01 \b, Custom Flag
  381. #>3 byte &0x08 \b, Copyrighted
  382. #>3 byte &0x04 \b, Original Source
  383. #>3 byte&0x03 1 \b, NR: 50/15 ms
  384. #>3 byte&0x03 3 \b, NR: CCIT J.17
  385. # MP2, M2A
  386. 0 beshort&0xFFFE 0xFFF4 MPEG ADTS, layer II, v2
  387. # rate
  388. >2 byte&0xF0 0x10 \b, 8 kBits
  389. >2 byte&0xF0 0x20 \b, 16 kBits
  390. >2 byte&0xF0 0x30 \b, 24 kBits
  391. >2 byte&0xF0 0x40 \b, 32 kBits
  392. >2 byte&0xF0 0x50 \b, 40 kBits
  393. >2 byte&0xF0 0x60 \b, 48 kBits
  394. >2 byte&0xF0 0x70 \b, 56 kBits
  395. >2 byte&0xF0 0x80 \b, 64 kBits
  396. >2 byte&0xF0 0x90 \b, 80 kBits
  397. >2 byte&0xF0 0xA0 \b, 96 kBits
  398. >2 byte&0xF0 0xB0 \b, 112 kBits
  399. >2 byte&0xF0 0xC0 \b, 128 kBits
  400. >2 byte&0xF0 0xD0 \b, 144 kBits
  401. >2 byte&0xF0 0xE0 \b, 160 kBits
  402. # timing
  403. >2 byte&0x0C 0x00 \b, 22.05 kHz
  404. >2 byte&0x0C 0x04 \b, 24 kHz
  405. >2 byte&0x0C 0x08 \b, 16 kHz
  406. # channels/options
  407. >3 byte&0xC0 0x00 \b, Stereo
  408. >3 byte&0xC0 0x40 \b, JntStereo
  409. >3 byte&0xC0 0x80 \b, 2x Monaural
  410. >3 byte&0xC0 0xC0 \b, Monaural
  411. #>1 byte ^0x01 \b, Data Verify
  412. #>2 byte &0x02 \b, Packet Pad
  413. #>2 byte &0x01 \b, Custom Flag
  414. #>3 byte &0x08 \b, Copyrighted
  415. #>3 byte &0x04 \b, Original Source
  416. #>3 byte&0x03 1 \b, NR: 50/15 ms
  417. #>3 byte&0x03 3 \b, NR: CCIT J.17
  418. # MPA, M2A
  419. 0 beshort&0xFFFE 0xFFF6 MPEG ADTS, layer I, v2
  420. # rate
  421. >2 byte&0xF0 0x10 \b, 32 kBits
  422. >2 byte&0xF0 0x20 \b, 48 kBits
  423. >2 byte&0xF0 0x30 \b, 56 kBits
  424. >2 byte&0xF0 0x40 \b, 64 kBits
  425. >2 byte&0xF0 0x50 \b, 80 kBits
  426. >2 byte&0xF0 0x60 \b, 96 kBits
  427. >2 byte&0xF0 0x70 \b, 112 kBits
  428. >2 byte&0xF0 0x80 \b, 128 kBits
  429. >2 byte&0xF0 0x90 \b, 144 kBits
  430. >2 byte&0xF0 0xA0 \b, 160 kBits
  431. >2 byte&0xF0 0xB0 \b, 176 kBits
  432. >2 byte&0xF0 0xC0 \b, 192 kBits
  433. >2 byte&0xF0 0xD0 \b, 224 kBits
  434. >2 byte&0xF0 0xE0 \b, 256 kBits
  435. # timing
  436. >2 byte&0x0C 0x00 \b, 22.05 kHz
  437. >2 byte&0x0C 0x04 \b, 24 kHz
  438. >2 byte&0x0C 0x08 \b, 16 kHz
  439. # channels/options
  440. >3 byte&0xC0 0x00 \b, Stereo
  441. >3 byte&0xC0 0x40 \b, JntStereo
  442. >3 byte&0xC0 0x80 \b, 2x Monaural
  443. >3 byte&0xC0 0xC0 \b, Monaural
  444. #>1 byte ^0x01 \b, Data Verify
  445. #>2 byte &0x02 \b, Packet Pad
  446. #>2 byte &0x01 \b, Custom Flag
  447. #>3 byte &0x08 \b, Copyrighted
  448. #>3 byte &0x04 \b, Original Source
  449. #>3 byte&0x03 1 \b, NR: 50/15 ms
  450. #>3 byte&0x03 3 \b, NR: CCIT J.17
  451. # MP3, M25A
  452. 0 beshort&0xFFFE 0xFFE2 MPEG ADTS, layer III, v2.5
  453. # rate
  454. >2 byte&0xF0 0x10 \b, 8 kBits
  455. >2 byte&0xF0 0x20 \b, 16 kBits
  456. >2 byte&0xF0 0x30 \b, 24 kBits
  457. >2 byte&0xF0 0x40 \b, 32 kBits
  458. >2 byte&0xF0 0x50 \b, 40 kBits
  459. >2 byte&0xF0 0x60 \b, 48 kBits
  460. >2 byte&0xF0 0x70 \b, 56 kBits
  461. >2 byte&0xF0 0x80 \b, 64 kBits
  462. >2 byte&0xF0 0x90 \b, 80 kBits
  463. >2 byte&0xF0 0xA0 \b, 96 kBits
  464. >2 byte&0xF0 0xB0 \b, 112 kBits
  465. >2 byte&0xF0 0xC0 \b, 128 kBits
  466. >2 byte&0xF0 0xD0 \b, 144 kBits
  467. >2 byte&0xF0 0xE0 \b, 160 kBits
  468. # timing
  469. >2 byte&0x0C 0x00 \b, 11.025 kHz
  470. >2 byte&0x0C 0x04 \b, 12 kHz
  471. >2 byte&0x0C 0x08 \b, 8 kHz
  472. # channels/options
  473. >3 byte&0xC0 0x00 \b, Stereo
  474. >3 byte&0xC0 0x40 \b, JntStereo
  475. >3 byte&0xC0 0x80 \b, 2x Monaural
  476. >3 byte&0xC0 0xC0 \b, Monaural
  477. #>1 byte ^0x01 \b, Data Verify
  478. #>2 byte &0x02 \b, Packet Pad
  479. #>2 byte &0x01 \b, Custom Flag
  480. #>3 byte &0x08 \b, Copyrighted
  481. #>3 byte &0x04 \b, Original Source
  482. #>3 byte&0x03 1 \b, NR: 50/15 ms
  483. #>3 byte&0x03 3 \b, NR: CCIT J.17
  484. # AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
  485. # Stored AAC streams (instead of the MP4 format)
  486. 0 string ADIF MPEG ADIF, AAC
  487. >4 byte &0x80
  488. >>13 byte &0x10 \b, VBR
  489. >>13 byte ^0x10 \b, CBR
  490. >>16 byte&0x1E 0x02 \b, single stream
  491. >>16 byte&0x1E 0x04 \b, 2 streams
  492. >>16 byte&0x1E 0x06 \b, 3 streams
  493. >>16 byte &0x08 \b, 4 or more streams
  494. >>16 byte &0x10 \b, 8 or more streams
  495. >>4 byte &0x80 \b, Copyrighted
  496. >>13 byte &0x40 \b, Original Source
  497. >>13 byte &0x20 \b, Home Flag
  498. >4 byte ^0x80
  499. >>4 byte &0x10 \b, VBR
  500. >>4 byte ^0x10 \b, CBR
  501. >>7 byte&0x1E 0x02 \b, single stream
  502. >>7 byte&0x1E 0x04 \b, 2 streams
  503. >>7 byte&0x1E 0x06 \b, 3 streams
  504. >>7 byte &0x08 \b, 4 or more streams
  505. >>7 byte &0x10 \b, 8 or more streams
  506. >>4 byte &0x40 \b, Original Stream(s)
  507. >>4 byte &0x20 \b, Home Source
  508. # Live or stored single AAC stream (used with MPEG-2 systems)
  509. 0 beshort&0xFFF6 0xFFF0 MPEG ADTS, AAC
  510. >1 byte &0x08 \b, v2
  511. >1 byte ^0x08 \b, v4
  512. # profile
  513. >>2 byte &0xC0 \b LTP
  514. >2 byte&0xc0 0x00 \b Main
  515. >2 byte&0xc0 0x40 \b LC
  516. >2 byte&0xc0 0x80 \b SSR
  517. # timing
  518. >2 byte&0x3c 0x00 \b, 96 kHz
  519. >2 byte&0x3c 0x04 \b, 88.2 kHz
  520. >2 byte&0x3c 0x08 \b, 64 kHz
  521. >2 byte&0x3c 0x0c \b, 48 kHz
  522. >2 byte&0x3c 0x10 \b, 44.1 kHz
  523. >2 byte&0x3c 0x14 \b, 32 kHz
  524. >2 byte&0x3c 0x18 \b, 24 kHz
  525. >2 byte&0x3c 0x1c \b, 22.05 kHz
  526. >2 byte&0x3c 0x20 \b, 16 kHz
  527. >2 byte&0x3c 0x24 \b, 12 kHz
  528. >2 byte&0x3c 0x28 \b, 11.025 kHz
  529. >2 byte&0x3c 0x2c \b, 8 kHz
  530. # channels
  531. >2 beshort&0x01c0 0x0040 \b, monaural
  532. >2 beshort&0x01c0 0x0080 \b, stereo
  533. >2 beshort&0x01c0 0x00c0 \b, stereo + center
  534. >2 beshort&0x01c0 0x0100 \b, stereo+center+LFE
  535. >2 beshort&0x01c0 0x0140 \b, surround
  536. >2 beshort&0x01c0 0x0180 \b, surround + LFE
  537. >2 beshort &0x01C0 \b, surround + side
  538. #>1 byte ^0x01 \b, Data Verify
  539. #>2 byte &0x02 \b, Custom Flag
  540. #>3 byte &0x20 \b, Original Stream
  541. #>3 byte &0x10 \b, Home Source
  542. #>3 byte &0x08 \b, Copyrighted
  543. # Live MPEG-4 audio streams (instead of RTP FlexMux)
  544. 0 beshort&0xFFE0 0x56E0 MPEG-4 LOAS
  545. #>1 beshort&0x1FFF x \b, %u byte packet
  546. >3 byte&0xE0 0x40
  547. >>4 byte&0x3C 0x04 \b, single stream
  548. >>4 byte&0x3C 0x08 \b, 2 streams
  549. >>4 byte&0x3C 0x0C \b, 3 streams
  550. >>4 byte &0x08 \b, 4 or more streams
  551. >>4 byte &0x20 \b, 8 or more streams
  552. >3 byte&0xC0 0
  553. >>4 byte&0x78 0x08 \b, single stream
  554. >>4 byte&0x78 0x10 \b, 2 streams
  555. >>4 byte&0x78 0x18 \b, 3 streams
  556. >>4 byte &0x20 \b, 4 or more streams
  557. >>4 byte &0x40 \b, 8 or more streams
  558. 0 beshort 0x4DE1 MPEG-4 LO-EP audio stream
  559. # FLI animation format
  560. 4 leshort 0xAF11 FLI file
  561. >6 leshort x - %d frames,
  562. >8 leshort x width=%d pixels,
  563. >10 leshort x height=%d pixels,
  564. >12 leshort x depth=%d,
  565. >16 leshort x ticks/frame=%d
  566. # FLC animation format
  567. 4 leshort 0xAF12 FLC file
  568. >6 leshort x - %d frames
  569. >8 leshort x width=%d pixels,
  570. >10 leshort x height=%d pixels,
  571. >12 leshort x depth=%d,
  572. >16 leshort x ticks/frame=%d
  573. # DL animation format
  574. # XXX - collision with most `mips' magic
  575. #
  576. # I couldn't find a real magic number for these, however, this
  577. # -appears- to work. Note that it might catch other files, too, so be
  578. # careful!
  579. #
  580. # Note that title and author appear in the two 20-byte chunks
  581. # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
  582. # 255 (hex FF)! The DL format is really bad.
  583. #
  584. #0 byte 1 DL version 1, medium format (160x100, 4 images/screen)
  585. #>42 byte x - %d screens,
  586. #>43 byte x %d commands
  587. #0 byte 2 DL version 2
  588. #>1 byte 1 - large format (320x200,1 image/screen),
  589. #>1 byte 2 - medium format (160x100,4 images/screen),
  590. #>1 byte >2 - unknown format,
  591. #>42 byte x %d screens,
  592. #>43 byte x %d commands
  593. # Based on empirical evidence, DL version 3 have several nulls following the
  594. # \003. Most of them start with non-null values at hex offset 0x34 or so.
  595. #0 string \3\0\0\0\0\0\0\0\0\0\0\0 DL version 3
  596. # iso 13818 transport stream
  597. #
  598. # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
  599. # (the following is a little bit restrictive and works fine for a stream
  600. # that starts with PAT properly. it won't work for stream data, that is
  601. # cut from an input device data right in the middle, but this shouldn't
  602. # disturb)
  603. # syncbyte 8 bit 0x47
  604. # error_ind 1 bit -
  605. # payload_start 1 bit 1
  606. # priority 1 bit -
  607. # PID 13 bit 0x0000
  608. # scrambling 2 bit -
  609. # adaptfld_ctrl 2 bit 1 or 3
  610. # conti_count 4 bit 0
  611. 0 belong&0xFF5FFF1F 0x47400010 MPEG transport stream data
  612. >188 byte !0x47 CORRUPTED
  613. # DIF digital video file format <mpruett@sgi.com>
  614. 0 belong&0xffffff00 0x1f070000 DIF
  615. >4 byte &0x01 (DVCPRO) movie file
  616. >4 byte ^0x01 (DV) movie file
  617. >3 byte &0x80 (PAL)
  618. >3 byte ^0x80 (NTSC)
  619. # Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
  620. 0 belong 0x3026b275 Microsoft ASF
  621. # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
  622. 0 string \x8aMNG MNG video data,
  623. >4 belong !0x0d0a1a0a CORRUPTED,
  624. >4 belong 0x0d0a1a0a
  625. >>16 belong x %ld x
  626. >>20 belong x %ld
  627. # JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
  628. 0 string \x8bJNG JNG video data,
  629. >4 belong !0x0d0a1a0a CORRUPTED,
  630. >4 belong 0x0d0a1a0a
  631. >>16 belong x %ld x
  632. >>20 belong x %ld
  633. # Vivo video (Wolfram Kleff)
  634. 3 string \x0D\x0AVersion:Vivo Vivo video data
  635. # VRML (Virtual Reality Modelling Language)
  636. 0 string/b #VRML\ V1.0\ ascii VRML 1 file
  637. 0 string/b #VRML\ V2.0\ utf8 ISO/IEC 14772 VRML 97 file
  638. #---------------------------------------------------------------------------
  639. # HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
  640. # From Mark Sheppard <msheppard@climax.co.uk>, 2002-10-03
  641. #
  642. 0 string HVQM4 %s
  643. >6 string >\0 v%s
  644. >0 byte x GameCube movie,
  645. >0x34 ubeshort x %d x
  646. >0x36 ubeshort x %d,
  647. >0x26 ubeshort x %dµs,
  648. >0x42 ubeshort 0 no audio
  649. >0x42 ubeshort >0 %dHz audio
  650. # From: "Stefan A. Haubenthal" <polluks@web.de>
  651. 0 string DVDVIDEO-VTS Video title set,
  652. >0x21 byte x v%x
  653. 0 string DVDVIDEO-VMG Video manager,
  654. >0x21 byte x v%x