animation 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008
  1. #------------------------------------------------------------------------------
  2. # $File: animation,v 1.55 2014/09/13 14:29:51 christos Exp $
  3. # animation: file(1) magic for animation/movie formats
  4. #
  5. # animation formats
  6. # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
  7. # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
  8. # SGI and Apple formats
  9. 0 string MOVI Silicon Graphics movie file
  10. !:mime video/x-sgi-movie
  11. 4 string moov Apple QuickTime
  12. !:mime video/quicktime
  13. >12 string mvhd \b movie (fast start)
  14. >12 string mdra \b URL
  15. >12 string cmov \b movie (fast start, compressed header)
  16. >12 string rmra \b multiple URLs
  17. 4 string mdat Apple QuickTime movie (unoptimized)
  18. !:mime video/quicktime
  19. #4 string wide Apple QuickTime movie (unoptimized)
  20. #!:mime video/quicktime
  21. #4 string skip Apple QuickTime movie (modified)
  22. #!:mime video/quicktime
  23. #4 string free Apple QuickTime movie (modified)
  24. #!:mime video/quicktime
  25. 4 string idsc Apple QuickTime image (fast start)
  26. !:mime image/x-quicktime
  27. #4 string idat Apple QuickTime image (unoptimized)
  28. #!:mime image/x-quicktime
  29. 4 string pckg Apple QuickTime compressed archive
  30. !:mime application/x-quicktime-player
  31. 4 string/W jP JPEG 2000 image
  32. !:mime image/jp2
  33. # http://www.ftyps.com/ with local additions
  34. 4 string ftyp ISO Media
  35. >8 string 3g2 \b, MPEG v4 system, 3GPP2
  36. !:mime video/3gpp2
  37. >>11 byte 4 \b v4 (H.263/AMR GSM 6.10)
  38. >>11 byte 5 \b v5 (H.263/AMR GSM 6.10)
  39. >>11 byte 6 \b v6 (ITU H.264/AMR GSM 6.10)
  40. >>11 byte a \b C.S0050-0 V1.0
  41. >>11 byte b \b C.S0050-0-A V1.0.0
  42. >>11 byte c \b C.S0050-0-B V1.0
  43. >8 string 3ge \b, MPEG v4 system, 3GPP
  44. !:mime video/3gpp
  45. >>11 byte 6 \b, Release 6 MBMS Extended Presentations
  46. >>11 byte 7 \b, Release 7 MBMS Extended Presentations
  47. >8 string 3gg \b, MPEG v4 system, 3GPP
  48. >11 byte 6 \b, Release 6 General Profile
  49. !:mime video/3gpp
  50. >8 string 3gp \b, MPEG v4 system, 3GPP
  51. >11 byte 1 \b, Release %d (non existent)
  52. >11 byte 2 \b, Release %d (non existent)
  53. >11 byte 3 \b, Release %d (non existent)
  54. >11 byte 4 \b, Release %d
  55. >11 byte 5 \b, Release %d
  56. >11 byte 6 \b, Release %d
  57. >11 byte 7 \b, Release %d Streaming Servers
  58. !:mime video/3gpp
  59. >8 string 3gs \b, MPEG v4 system, 3GPP
  60. >11 byte 7 \b, Release %d Streaming Servers
  61. !:mime video/3gpp
  62. >8 string avc1 \b, MPEG v4 system, 3GPP JVT AVC [ISO 14496-12:2005]
  63. !:mime video/mp4
  64. >8 string/W qt \b, Apple QuickTime movie
  65. !:mime video/quicktime
  66. >8 string CAEP \b, Canon Digital Camera
  67. >8 string caqv \b, Casio Digital Camera
  68. >8 string CDes \b, Convergent Design
  69. >8 string da0a \b, DMB MAF w/ MPEG Layer II aud, MOT slides, DLS, JPG/PNG/MNG
  70. >8 string da0b \b, DMB MAF, ext DA0A, with 3GPP timed text, DID, TVA, REL, IPMP
  71. >8 string da1a \b, DMB MAF audio with ER-BSAC audio, JPG/PNG/MNG images
  72. >8 string da1b \b, DMB MAF, ext da1a, with 3GPP timed text, DID, TVA, REL, IPMP
  73. >8 string da2a \b, DMB MAF aud w/ HE-AAC v2 aud, MOT slides, DLS, JPG/PNG/MNG
  74. >8 string da2b \b, DMB MAF, ext da2a, with 3GPP timed text, DID, TVA, REL, IPMP
  75. >8 string da3a \b, DMB MAF aud with HE-AAC aud, JPG/PNG/MNG images
  76. >8 string da3b \b, DMB MAF, ext da3a w/ BIFS, 3GPP, DID, TVA, REL, IPMP
  77. >8 string dmb1 \b, DMB MAF supporting all the components defined in the spec
  78. >8 string dmpf \b, Digital Media Project
  79. >8 string drc1 \b, Dirac (wavelet compression), encap in ISO base media (MP4)
  80. >8 string dv1a \b, DMB MAF vid w/ AVC vid, ER-BSAC aud, BIFS, JPG/PNG/MNG, TS
  81. >8 string dv1b \b, DMB MAF, ext dv1a, with 3GPP timed text, DID, TVA, REL, IPMP
  82. >8 string dv2a \b, DMB MAF vid w/ AVC vid, HE-AAC v2 aud, BIFS, JPG/PNG/MNG, TS
  83. >8 string dv2b \b, DMB MAF, ext dv2a, with 3GPP timed text, DID, TVA, REL, IPMP
  84. >8 string dv3a \b, DMB MAF vid w/ AVC vid, HE-AAC aud, BIFS, JPG/PNG/MNG, TS
  85. >8 string dv3b \b, DMB MAF, ext dv3a, with 3GPP timed text, DID, TVA, REL, IPMP
  86. >8 string dvr1 \b, DVB (.DVB) over RTP
  87. !:mime video/vnd.dvb.file
  88. >8 string dvt1 \b, DVB (.DVB) over MPEG-2 Transport Stream
  89. !:mime video/vnd.dvb.file
  90. >8 string F4V \b, Video for Adobe Flash Player 9+ (.F4V)
  91. !:mime video/mp4
  92. >8 string F4P \b, Protected Video for Adobe Flash Player 9+ (.F4P)
  93. !:mime video/mp4
  94. >8 string F4A \b, Audio for Adobe Flash Player 9+ (.F4A)
  95. !:mime audio/mp4
  96. >8 string F4B \b, Audio Book for Adobe Flash Player 9+ (.F4B)
  97. !:mime audio/mp4
  98. >8 string isc2 \b, ISMACryp 2.0 Encrypted File
  99. # ?/enc-isoff-generic
  100. >8 string iso2 \b, MP4 Base Media v2 [ISO 14496-12:2005]
  101. !:mime video/mp4
  102. >8 string isom \b, MP4 Base Media v1 [IS0 14496-12:2003]
  103. !:mime video/mp4
  104. >8 string/W jp2 \b, JPEG 2000
  105. !:mime image/jp2
  106. >8 string JP2 \b, JPEG 2000 Image (.JP2) [ISO 15444-1 ?]
  107. !:mime image/jp2
  108. >8 string JP20 \b, Unknown, from GPAC samples (prob non-existent)
  109. >8 string jpm \b, JPEG 2000 Compound Image (.JPM) [ISO 15444-6]
  110. !:mime image/jpm
  111. >8 string jpx \b, JPEG 2000 w/ extensions (.JPX) [ISO 15444-2]
  112. !:mime image/jpx
  113. >8 string KDDI \b, 3GPP2 EZmovie for KDDI 3G cellphones
  114. !:mime video/3gpp2
  115. >8 string M4A \b, Apple iTunes ALAC/AAC-LC (.M4A) Audio
  116. !:mime audio/x-m4a
  117. >8 string M4B \b, Apple iTunes ALAC/AAC-LC (.M4B) Audio Book
  118. !:mime audio/mp4
  119. >8 string M4P \b, Apple iTunes ALAC/AAC-LC (.M4P) AES Protected Audio
  120. !:mime video/mp4
  121. >8 string M4V \b, Apple iTunes Video (.M4V) Video
  122. !:mime video/x-m4v
  123. >8 string M4VH \b, Apple TV (.M4V)
  124. !:mime video/x-m4v
  125. >8 string M4VP \b, Apple iPhone (.M4V)
  126. !:mime video/x-m4v
  127. >8 string mj2s \b, Motion JPEG 2000 [ISO 15444-3] Simple Profile
  128. !:mime video/mj2
  129. >8 string mjp2 \b, Motion JPEG 2000 [ISO 15444-3] General Profile
  130. !:mime video/mj2
  131. >8 string mmp4 \b, MPEG-4/3GPP Mobile Profile (.MP4 / .3GP) (for NTT)
  132. !:mime video/mp4
  133. >8 string mobi \b, MPEG-4, MOBI format
  134. !:mime video/mp4
  135. >8 string mp21 \b, MPEG-21 [ISO/IEC 21000-9]
  136. >8 string mp41 \b, MP4 v1 [ISO 14496-1:ch13]
  137. !:mime video/mp4
  138. >8 string mp42 \b, MP4 v2 [ISO 14496-14]
  139. !:mime video/mp4
  140. >8 string mp71 \b, MP4 w/ MPEG-7 Metadata [per ISO 14496-12]
  141. >8 string mp7t \b, MPEG v4 system, MPEG v7 XML
  142. >8 string mp7b \b, MPEG v4 system, MPEG v7 binary XML
  143. >8 string mmp4 \b, MPEG v4 system, 3GPP Mobile
  144. !:mime video/mp4
  145. >8 string MPPI \b, Photo Player, MAF [ISO/IEC 23000-3]
  146. >8 string mqt \b, Sony / Mobile QuickTime (.MQV) US Pat 7,477,830
  147. !:mime video/quicktime
  148. >8 string MSNV \b, MPEG-4 (.MP4) for SonyPSP
  149. !:mime audio/mp4
  150. >8 string NDAS \b, MP4 v2 [ISO 14496-14] Nero Digital AAC Audio
  151. !:mime audio/mp4
  152. >8 string NDSC \b, MPEG-4 (.MP4) Nero Cinema Profile
  153. !:mime video/mp4
  154. >8 string NDSH \b, MPEG-4 (.MP4) Nero HDTV Profile
  155. !:mime video/mp4
  156. >8 string NDSM \b, MPEG-4 (.MP4) Nero Mobile Profile
  157. !:mime video/mp4
  158. >8 string NDSP \b, MPEG-4 (.MP4) Nero Portable Profile
  159. !:mime video/mp4
  160. >8 string NDSS \b, MPEG-4 (.MP4) Nero Standard Profile
  161. !:mime video/mp4
  162. >8 string NDXC \b, H.264/MPEG-4 AVC (.MP4) Nero Cinema Profile
  163. !:mime video/mp4
  164. >8 string NDXH \b, H.264/MPEG-4 AVC (.MP4) Nero HDTV Profile
  165. !:mime video/mp4
  166. >8 string NDXM \b, H.264/MPEG-4 AVC (.MP4) Nero Mobile Profile
  167. !:mime video/mp4
  168. >8 string NDXP \b, H.264/MPEG-4 AVC (.MP4) Nero Portable Profile
  169. !:mime video/mp4
  170. >8 string NDXS \b, H.264/MPEG-4 AVC (.MP4) Nero Standard Profile
  171. !:mime video/mp4
  172. >8 string odcf \b, OMA DCF DRM Format 2.0 (OMA-TS-DRM-DCF-V2_0-20060303-A)
  173. >8 string opf2 \b, OMA PDCF DRM Format 2.1 (OMA-TS-DRM-DCF-V2_1-20070724-C)
  174. >8 string opx2 \b, OMA PDCF DRM + XBS ext (OMA-TS-DRM_XBS-V1_0-20070529-C)
  175. >8 string pana \b, Panasonic Digital Camera
  176. >8 string qt \b, Apple QuickTime (.MOV/QT)
  177. !:mime video/quicktime
  178. >8 string ROSS \b, Ross Video
  179. >8 string sdv \b, SD Memory Card Video
  180. >8 string ssc1 \b, Samsung stereo, single stream (patent pending)
  181. >8 string ssc2 \b, Samsung stereo, dual stream (patent pending)
  182. # MPEG sequences
  183. # Scans for all common MPEG header start codes
  184. 0 belong 0x00000001
  185. >4 byte&0x1F 0x07 JVT NAL sequence, H.264 video
  186. >>5 byte 66 \b, baseline
  187. >>5 byte 77 \b, main
  188. >>5 byte 88 \b, extended
  189. >>7 byte x \b @ L %u
  190. 0 belong&0xFFFFFF00 0x00000100
  191. >3 byte 0xBA MPEG sequence
  192. !:mime video/mpeg
  193. >>4 byte &0x40 \b, v2, program multiplex
  194. >>4 byte ^0x40 \b, v1, system multiplex
  195. >3 byte 0xBB MPEG sequence, v1/2, multiplex (missing pack header)
  196. >3 byte&0x1F 0x07 MPEG sequence, H.264 video
  197. >>4 byte 66 \b, baseline
  198. >>4 byte 77 \b, main
  199. >>4 byte 88 \b, extended
  200. >>6 byte x \b @ L %u
  201. # GRR too general as it catches also FoxPro Memo example NG.FPT
  202. >3 byte 0xB0 MPEG sequence, v4
  203. # TODO: maybe this extra line exclude FoxPro Memo example NG.FPT starting with 000001b0 00000100 00000000
  204. #>>4 byte !0 MPEG sequence, v4
  205. !:mime video/mpeg4-generic
  206. >>5 belong 0x000001B5
  207. >>>9 byte &0x80
  208. >>>>10 byte&0xF0 16 \b, video
  209. >>>>10 byte&0xF0 32 \b, still texture
  210. >>>>10 byte&0xF0 48 \b, mesh
  211. >>>>10 byte&0xF0 64 \b, face
  212. >>>9 byte&0xF8 8 \b, video
  213. >>>9 byte&0xF8 16 \b, still texture
  214. >>>9 byte&0xF8 24 \b, mesh
  215. >>>9 byte&0xF8 32 \b, face
  216. >>4 byte 1 \b, simple @ L1
  217. >>4 byte 2 \b, simple @ L2
  218. >>4 byte 3 \b, simple @ L3
  219. >>4 byte 4 \b, simple @ L0
  220. >>4 byte 17 \b, simple scalable @ L1
  221. >>4 byte 18 \b, simple scalable @ L2
  222. >>4 byte 33 \b, core @ L1
  223. >>4 byte 34 \b, core @ L2
  224. >>4 byte 50 \b, main @ L2
  225. >>4 byte 51 \b, main @ L3
  226. >>4 byte 53 \b, main @ L4
  227. >>4 byte 66 \b, n-bit @ L2
  228. >>4 byte 81 \b, scalable texture @ L1
  229. >>4 byte 97 \b, simple face animation @ L1
  230. >>4 byte 98 \b, simple face animation @ L2
  231. >>4 byte 99 \b, simple face basic animation @ L1
  232. >>4 byte 100 \b, simple face basic animation @ L2
  233. >>4 byte 113 \b, basic animation text @ L1
  234. >>4 byte 114 \b, basic animation text @ L2
  235. >>4 byte 129 \b, hybrid @ L1
  236. >>4 byte 130 \b, hybrid @ L2
  237. >>4 byte 145 \b, advanced RT simple @ L!
  238. >>4 byte 146 \b, advanced RT simple @ L2
  239. >>4 byte 147 \b, advanced RT simple @ L3
  240. >>4 byte 148 \b, advanced RT simple @ L4
  241. >>4 byte 161 \b, core scalable @ L1
  242. >>4 byte 162 \b, core scalable @ L2
  243. >>4 byte 163 \b, core scalable @ L3
  244. >>4 byte 177 \b, advanced coding efficiency @ L1
  245. >>4 byte 178 \b, advanced coding efficiency @ L2
  246. >>4 byte 179 \b, advanced coding efficiency @ L3
  247. >>4 byte 180 \b, advanced coding efficiency @ L4
  248. >>4 byte 193 \b, advanced core @ L1
  249. >>4 byte 194 \b, advanced core @ L2
  250. >>4 byte 209 \b, advanced scalable texture @ L1
  251. >>4 byte 210 \b, advanced scalable texture @ L2
  252. >>4 byte 211 \b, advanced scalable texture @ L3
  253. >>4 byte 225 \b, simple studio @ L1
  254. >>4 byte 226 \b, simple studio @ L2
  255. >>4 byte 227 \b, simple studio @ L3
  256. >>4 byte 228 \b, simple studio @ L4
  257. >>4 byte 229 \b, core studio @ L1
  258. >>4 byte 230 \b, core studio @ L2
  259. >>4 byte 231 \b, core studio @ L3
  260. >>4 byte 232 \b, core studio @ L4
  261. >>4 byte 240 \b, advanced simple @ L0
  262. >>4 byte 241 \b, advanced simple @ L1
  263. >>4 byte 242 \b, advanced simple @ L2
  264. >>4 byte 243 \b, advanced simple @ L3
  265. >>4 byte 244 \b, advanced simple @ L4
  266. >>4 byte 245 \b, advanced simple @ L5
  267. >>4 byte 247 \b, advanced simple @ L3b
  268. >>4 byte 248 \b, FGS @ L0
  269. >>4 byte 249 \b, FGS @ L1
  270. >>4 byte 250 \b, FGS @ L2
  271. >>4 byte 251 \b, FGS @ L3
  272. >>4 byte 252 \b, FGS @ L4
  273. >>4 byte 253 \b, FGS @ L5
  274. >3 byte 0xB5 MPEG sequence, v4
  275. !:mime video/mpeg4-generic
  276. >>4 byte &0x80
  277. >>>5 byte&0xF0 16 \b, video (missing profile header)
  278. >>>5 byte&0xF0 32 \b, still texture (missing profile header)
  279. >>>5 byte&0xF0 48 \b, mesh (missing profile header)
  280. >>>5 byte&0xF0 64 \b, face (missing profile header)
  281. >>4 byte&0xF8 8 \b, video (missing profile header)
  282. >>4 byte&0xF8 16 \b, still texture (missing profile header)
  283. >>4 byte&0xF8 24 \b, mesh (missing profile header)
  284. >>4 byte&0xF8 32 \b, face (missing profile header)
  285. >3 byte 0xB3 MPEG sequence
  286. !:mime video/mpeg
  287. >>12 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
  288. >>12 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
  289. >>12 belong 0x000001B5 \b, v2,
  290. >>>16 byte&0x0F 1 \b HP
  291. >>>16 byte&0x0F 2 \b Spt
  292. >>>16 byte&0x0F 3 \b SNR
  293. >>>16 byte&0x0F 4 \b MP
  294. >>>16 byte&0x0F 5 \b SP
  295. >>>17 byte&0xF0 64 \b@HL
  296. >>>17 byte&0xF0 96 \b@H-14
  297. >>>17 byte&0xF0 128 \b@ML
  298. >>>17 byte&0xF0 160 \b@LL
  299. >>>17 byte &0x08 \b progressive
  300. >>>17 byte ^0x08 \b interlaced
  301. >>>17 byte&0x06 2 \b Y'CbCr 4:2:0 video
  302. >>>17 byte&0x06 4 \b Y'CbCr 4:2:2 video
  303. >>>17 byte&0x06 6 \b Y'CbCr 4:4:4 video
  304. >>11 byte &0x02
  305. >>>75 byte &0x01
  306. >>>>140 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
  307. >>>>140 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
  308. >>>>140 belong 0x000001B5 \b, v2,
  309. >>>>>144 byte&0x0F 1 \b HP
  310. >>>>>144 byte&0x0F 2 \b Spt
  311. >>>>>144 byte&0x0F 3 \b SNR
  312. >>>>>144 byte&0x0F 4 \b MP
  313. >>>>>144 byte&0x0F 5 \b SP
  314. >>>>>145 byte&0xF0 64 \b@HL
  315. >>>>>145 byte&0xF0 96 \b@H-14
  316. >>>>>145 byte&0xF0 128 \b@ML
  317. >>>>>145 byte&0xF0 160 \b@LL
  318. >>>>>145 byte &0x08 \b progressive
  319. >>>>>145 byte ^0x08 \b interlaced
  320. >>>>>145 byte&0x06 2 \b Y'CbCr 4:2:0 video
  321. >>>>>145 byte&0x06 4 \b Y'CbCr 4:2:2 video
  322. >>>>>145 byte&0x06 6 \b Y'CbCr 4:4:4 video
  323. >>76 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
  324. >>76 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
  325. >>76 belong 0x000001B5 \b, v2,
  326. >>>80 byte&0x0F 1 \b HP
  327. >>>80 byte&0x0F 2 \b Spt
  328. >>>80 byte&0x0F 3 \b SNR
  329. >>>80 byte&0x0F 4 \b MP
  330. >>>80 byte&0x0F 5 \b SP
  331. >>>81 byte&0xF0 64 \b@HL
  332. >>>81 byte&0xF0 96 \b@H-14
  333. >>>81 byte&0xF0 128 \b@ML
  334. >>>81 byte&0xF0 160 \b@LL
  335. >>>81 byte &0x08 \b progressive
  336. >>>81 byte ^0x08 \b interlaced
  337. >>>81 byte&0x06 2 \b Y'CbCr 4:2:0 video
  338. >>>81 byte&0x06 4 \b Y'CbCr 4:2:2 video
  339. >>>81 byte&0x06 6 \b Y'CbCr 4:4:4 video
  340. >>4 belong&0xFFFFFF00 0x78043800 \b, HD-TV 1920P
  341. >>>7 byte&0xF0 0x10 \b, 16:9
  342. >>4 belong&0xFFFFFF00 0x50002D00 \b, SD-TV 1280I
  343. >>>7 byte&0xF0 0x10 \b, 16:9
  344. >>4 belong&0xFFFFFF00 0x30024000 \b, PAL Capture
  345. >>>7 byte&0xF0 0x10 \b, 4:3
  346. >>4 beshort&0xFFF0 0x2C00 \b, 4CIF
  347. >>>5 beshort&0x0FFF 0x01E0 \b NTSC
  348. >>>5 beshort&0x0FFF 0x0240 \b PAL
  349. >>>7 byte&0xF0 0x20 \b, 4:3
  350. >>>7 byte&0xF0 0x30 \b, 16:9
  351. >>>7 byte&0xF0 0x40 \b, 11:5
  352. >>>7 byte&0xF0 0x80 \b, PAL 4:3
  353. >>>7 byte&0xF0 0xC0 \b, NTSC 4:3
  354. >>4 belong&0xFFFFFF00 0x2801E000 \b, LD-TV 640P
  355. >>>7 byte&0xF0 0x10 \b, 4:3
  356. >>4 belong&0xFFFFFF00 0x1400F000 \b, 320x240
  357. >>>7 byte&0xF0 0x10 \b, 4:3
  358. >>4 belong&0xFFFFFF00 0x0F00A000 \b, 240x160
  359. >>>7 byte&0xF0 0x10 \b, 4:3
  360. >>4 belong&0xFFFFFF00 0x0A007800 \b, 160x120
  361. >>>7 byte&0xF0 0x10 \b, 4:3
  362. >>4 beshort&0xFFF0 0x1600 \b, CIF
  363. >>>5 beshort&0x0FFF 0x00F0 \b NTSC
  364. >>>5 beshort&0x0FFF 0x0120 \b PAL
  365. >>>7 byte&0xF0 0x20 \b, 4:3
  366. >>>7 byte&0xF0 0x30 \b, 16:9
  367. >>>7 byte&0xF0 0x40 \b, 11:5
  368. >>>7 byte&0xF0 0x80 \b, PAL 4:3
  369. >>>7 byte&0xF0 0xC0 \b, NTSC 4:3
  370. >>>5 beshort&0x0FFF 0x0240 \b PAL 625
  371. >>>>7 byte&0xF0 0x20 \b, 4:3
  372. >>>>7 byte&0xF0 0x30 \b, 16:9
  373. >>>>7 byte&0xF0 0x40 \b, 11:5
  374. >>4 beshort&0xFFF0 0x2D00 \b, CCIR/ITU
  375. >>>5 beshort&0x0FFF 0x01E0 \b NTSC 525
  376. >>>5 beshort&0x0FFF 0x0240 \b PAL 625
  377. >>>7 byte&0xF0 0x20 \b, 4:3
  378. >>>7 byte&0xF0 0x30 \b, 16:9
  379. >>>7 byte&0xF0 0x40 \b, 11:5
  380. >>4 beshort&0xFFF0 0x1E00 \b, SVCD
  381. >>>5 beshort&0x0FFF 0x01E0 \b NTSC 525
  382. >>>5 beshort&0x0FFF 0x0240 \b PAL 625
  383. >>>7 byte&0xF0 0x20 \b, 4:3
  384. >>>7 byte&0xF0 0x30 \b, 16:9
  385. >>>7 byte&0xF0 0x40 \b, 11:5
  386. >>7 byte&0x0F 1 \b, 23.976 fps
  387. >>7 byte&0x0F 2 \b, 24 fps
  388. >>7 byte&0x0F 3 \b, 25 fps
  389. >>7 byte&0x0F 4 \b, 29.97 fps
  390. >>7 byte&0x0F 5 \b, 30 fps
  391. >>7 byte&0x0F 6 \b, 50 fps
  392. >>7 byte&0x0F 7 \b, 59.94 fps
  393. >>7 byte&0x0F 8 \b, 60 fps
  394. >>11 byte &0x04 \b, Constrained
  395. # MPEG ADTS Audio (*.mpx/mxa/aac)
  396. # from dreesen@math.fu-berlin.de
  397. # modified to fully support MPEG ADTS
  398. # MP3, M1A
  399. # modified by Joerg Jenderek
  400. # GRR the original test are too common for many DOS files
  401. # so don't accept as MP3 until we've tested the rate
  402. 0 beshort&0xFFFE 0xFFFA
  403. # rates
  404. >2 byte&0xF0 0x10 MPEG ADTS, layer III, v1, 32 kbps
  405. !:mime audio/mpeg
  406. >2 byte&0xF0 0x20 MPEG ADTS, layer III, v1, 40 kbps
  407. !:mime audio/mpeg
  408. >2 byte&0xF0 0x30 MPEG ADTS, layer III, v1, 48 kbps
  409. !:mime audio/mpeg
  410. >2 byte&0xF0 0x40 MPEG ADTS, layer III, v1, 56 kbps
  411. !:mime audio/mpeg
  412. >2 byte&0xF0 0x50 MPEG ADTS, layer III, v1, 64 kbps
  413. !:mime audio/mpeg
  414. >2 byte&0xF0 0x60 MPEG ADTS, layer III, v1, 80 kbps
  415. !:mime audio/mpeg
  416. >2 byte&0xF0 0x70 MPEG ADTS, layer III, v1, 96 kbps
  417. !:mime audio/mpeg
  418. >2 byte&0xF0 0x80 MPEG ADTS, layer III, v1, 112 kbps
  419. !:mime audio/mpeg
  420. >2 byte&0xF0 0x90 MPEG ADTS, layer III, v1, 128 kbps
  421. !:mime audio/mpeg
  422. >2 byte&0xF0 0xA0 MPEG ADTS, layer III, v1, 160 kbps
  423. !:mime audio/mpeg
  424. >2 byte&0xF0 0xB0 MPEG ADTS, layer III, v1, 192 kbps
  425. !:mime audio/mpeg
  426. >2 byte&0xF0 0xC0 MPEG ADTS, layer III, v1, 224 kbps
  427. !:mime audio/mpeg
  428. >2 byte&0xF0 0xD0 MPEG ADTS, layer III, v1, 256 kbps
  429. !:mime audio/mpeg
  430. >2 byte&0xF0 0xE0 MPEG ADTS, layer III, v1, 320 kbps
  431. !:mime audio/mpeg
  432. # timing
  433. >2 byte&0x0C 0x00 \b, 44.1 kHz
  434. >2 byte&0x0C 0x04 \b, 48 kHz
  435. >2 byte&0x0C 0x08 \b, 32 kHz
  436. # channels/options
  437. >3 byte&0xC0 0x00 \b, Stereo
  438. >3 byte&0xC0 0x40 \b, JntStereo
  439. >3 byte&0xC0 0x80 \b, 2x Monaural
  440. >3 byte&0xC0 0xC0 \b, Monaural
  441. #>1 byte ^0x01 \b, Data Verify
  442. #>2 byte &0x02 \b, Packet Pad
  443. #>2 byte &0x01 \b, Custom Flag
  444. #>3 byte &0x08 \b, Copyrighted
  445. #>3 byte &0x04 \b, Original Source
  446. #>3 byte&0x03 1 \b, NR: 50/15 ms
  447. #>3 byte&0x03 3 \b, NR: CCIT J.17
  448. # MP2, M1A
  449. 0 beshort&0xFFFE 0xFFFC MPEG ADTS, layer II, v1
  450. !:mime audio/mpeg
  451. # rates
  452. >2 byte&0xF0 0x10 \b, 32 kbps
  453. >2 byte&0xF0 0x20 \b, 48 kbps
  454. >2 byte&0xF0 0x30 \b, 56 kbps
  455. >2 byte&0xF0 0x40 \b, 64 kbps
  456. >2 byte&0xF0 0x50 \b, 80 kbps
  457. >2 byte&0xF0 0x60 \b, 96 kbps
  458. >2 byte&0xF0 0x70 \b, 112 kbps
  459. >2 byte&0xF0 0x80 \b, 128 kbps
  460. >2 byte&0xF0 0x90 \b, 160 kbps
  461. >2 byte&0xF0 0xA0 \b, 192 kbps
  462. >2 byte&0xF0 0xB0 \b, 224 kbps
  463. >2 byte&0xF0 0xC0 \b, 256 kbps
  464. >2 byte&0xF0 0xD0 \b, 320 kbps
  465. >2 byte&0xF0 0xE0 \b, 384 kbps
  466. # timing
  467. >2 byte&0x0C 0x00 \b, 44.1 kHz
  468. >2 byte&0x0C 0x04 \b, 48 kHz
  469. >2 byte&0x0C 0x08 \b, 32 kHz
  470. # channels/options
  471. >3 byte&0xC0 0x00 \b, Stereo
  472. >3 byte&0xC0 0x40 \b, JntStereo
  473. >3 byte&0xC0 0x80 \b, 2x Monaural
  474. >3 byte&0xC0 0xC0 \b, Monaural
  475. #>1 byte ^0x01 \b, Data Verify
  476. #>2 byte &0x02 \b, Packet Pad
  477. #>2 byte &0x01 \b, Custom Flag
  478. #>3 byte &0x08 \b, Copyrighted
  479. #>3 byte &0x04 \b, Original Source
  480. #>3 byte&0x03 1 \b, NR: 50/15 ms
  481. #>3 byte&0x03 3 \b, NR: CCIT J.17
  482. # MPA, M1A
  483. # updated by Joerg Jenderek
  484. # GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
  485. # GRR this test is still too general as it catches a BOM of UTF-16 files (0xFFFE)
  486. # FIXME: Almost all little endian UTF-16 text with BOM are clobbered by these entries
  487. #0 beshort&0xFFFE 0xFFFE
  488. #>2 ubyte&0xF0 >0x0F
  489. #>>2 ubyte&0xF0 <0xE1 MPEG ADTS, layer I, v1
  490. ## rate
  491. #>>>2 byte&0xF0 0x10 \b, 32 kbps
  492. #>>>2 byte&0xF0 0x20 \b, 64 kbps
  493. #>>>2 byte&0xF0 0x30 \b, 96 kbps
  494. #>>>2 byte&0xF0 0x40 \b, 128 kbps
  495. #>>>2 byte&0xF0 0x50 \b, 160 kbps
  496. #>>>2 byte&0xF0 0x60 \b, 192 kbps
  497. #>>>2 byte&0xF0 0x70 \b, 224 kbps
  498. #>>>2 byte&0xF0 0x80 \b, 256 kbps
  499. #>>>2 byte&0xF0 0x90 \b, 288 kbps
  500. #>>>2 byte&0xF0 0xA0 \b, 320 kbps
  501. #>>>2 byte&0xF0 0xB0 \b, 352 kbps
  502. #>>>2 byte&0xF0 0xC0 \b, 384 kbps
  503. #>>>2 byte&0xF0 0xD0 \b, 416 kbps
  504. #>>>2 byte&0xF0 0xE0 \b, 448 kbps
  505. ## timing
  506. #>>>2 byte&0x0C 0x00 \b, 44.1 kHz
  507. #>>>2 byte&0x0C 0x04 \b, 48 kHz
  508. #>>>2 byte&0x0C 0x08 \b, 32 kHz
  509. ## channels/options
  510. #>>>3 byte&0xC0 0x00 \b, Stereo
  511. #>>>3 byte&0xC0 0x40 \b, JntStereo
  512. #>>>3 byte&0xC0 0x80 \b, 2x Monaural
  513. #>>>3 byte&0xC0 0xC0 \b, Monaural
  514. ##>1 byte ^0x01 \b, Data Verify
  515. ##>2 byte &0x02 \b, Packet Pad
  516. ##>2 byte &0x01 \b, Custom Flag
  517. ##>3 byte &0x08 \b, Copyrighted
  518. ##>3 byte &0x04 \b, Original Source
  519. ##>3 byte&0x03 1 \b, NR: 50/15 ms
  520. ##>3 byte&0x03 3 \b, NR: CCIT J.17
  521. # MP3, M2A
  522. 0 beshort&0xFFFE 0xFFF2 MPEG ADTS, layer III, v2
  523. !:mime audio/mpeg
  524. # rate
  525. >2 byte&0xF0 0x10 \b, 8 kbps
  526. >2 byte&0xF0 0x20 \b, 16 kbps
  527. >2 byte&0xF0 0x30 \b, 24 kbps
  528. >2 byte&0xF0 0x40 \b, 32 kbps
  529. >2 byte&0xF0 0x50 \b, 40 kbps
  530. >2 byte&0xF0 0x60 \b, 48 kbps
  531. >2 byte&0xF0 0x70 \b, 56 kbps
  532. >2 byte&0xF0 0x80 \b, 64 kbps
  533. >2 byte&0xF0 0x90 \b, 80 kbps
  534. >2 byte&0xF0 0xA0 \b, 96 kbps
  535. >2 byte&0xF0 0xB0 \b, 112 kbps
  536. >2 byte&0xF0 0xC0 \b, 128 kbps
  537. >2 byte&0xF0 0xD0 \b, 144 kbps
  538. >2 byte&0xF0 0xE0 \b, 160 kbps
  539. # timing
  540. >2 byte&0x0C 0x00 \b, 22.05 kHz
  541. >2 byte&0x0C 0x04 \b, 24 kHz
  542. >2 byte&0x0C 0x08 \b, 16 kHz
  543. # channels/options
  544. >3 byte&0xC0 0x00 \b, Stereo
  545. >3 byte&0xC0 0x40 \b, JntStereo
  546. >3 byte&0xC0 0x80 \b, 2x Monaural
  547. >3 byte&0xC0 0xC0 \b, Monaural
  548. #>1 byte ^0x01 \b, Data Verify
  549. #>2 byte &0x02 \b, Packet Pad
  550. #>2 byte &0x01 \b, Custom Flag
  551. #>3 byte &0x08 \b, Copyrighted
  552. #>3 byte &0x04 \b, Original Source
  553. #>3 byte&0x03 1 \b, NR: 50/15 ms
  554. #>3 byte&0x03 3 \b, NR: CCIT J.17
  555. # MP2, M2A
  556. 0 beshort&0xFFFE 0xFFF4 MPEG ADTS, layer II, v2
  557. !:mime audio/mpeg
  558. # rate
  559. >2 byte&0xF0 0x10 \b, 8 kbps
  560. >2 byte&0xF0 0x20 \b, 16 kbps
  561. >2 byte&0xF0 0x30 \b, 24 kbps
  562. >2 byte&0xF0 0x40 \b, 32 kbps
  563. >2 byte&0xF0 0x50 \b, 40 kbps
  564. >2 byte&0xF0 0x60 \b, 48 kbps
  565. >2 byte&0xF0 0x70 \b, 56 kbps
  566. >2 byte&0xF0 0x80 \b, 64 kbps
  567. >2 byte&0xF0 0x90 \b, 80 kbps
  568. >2 byte&0xF0 0xA0 \b, 96 kbps
  569. >2 byte&0xF0 0xB0 \b, 112 kbps
  570. >2 byte&0xF0 0xC0 \b, 128 kbps
  571. >2 byte&0xF0 0xD0 \b, 144 kbps
  572. >2 byte&0xF0 0xE0 \b, 160 kbps
  573. # timing
  574. >2 byte&0x0C 0x00 \b, 22.05 kHz
  575. >2 byte&0x0C 0x04 \b, 24 kHz
  576. >2 byte&0x0C 0x08 \b, 16 kHz
  577. # channels/options
  578. >3 byte&0xC0 0x00 \b, Stereo
  579. >3 byte&0xC0 0x40 \b, JntStereo
  580. >3 byte&0xC0 0x80 \b, 2x Monaural
  581. >3 byte&0xC0 0xC0 \b, Monaural
  582. #>1 byte ^0x01 \b, Data Verify
  583. #>2 byte &0x02 \b, Packet Pad
  584. #>2 byte &0x01 \b, Custom Flag
  585. #>3 byte &0x08 \b, Copyrighted
  586. #>3 byte &0x04 \b, Original Source
  587. #>3 byte&0x03 1 \b, NR: 50/15 ms
  588. #>3 byte&0x03 3 \b, NR: CCIT J.17
  589. # MPA, M2A
  590. 0 beshort&0xFFFE 0xFFF6 MPEG ADTS, layer I, v2
  591. !:mime audio/mpeg
  592. # rate
  593. >2 byte&0xF0 0x10 \b, 32 kbps
  594. >2 byte&0xF0 0x20 \b, 48 kbps
  595. >2 byte&0xF0 0x30 \b, 56 kbps
  596. >2 byte&0xF0 0x40 \b, 64 kbps
  597. >2 byte&0xF0 0x50 \b, 80 kbps
  598. >2 byte&0xF0 0x60 \b, 96 kbps
  599. >2 byte&0xF0 0x70 \b, 112 kbps
  600. >2 byte&0xF0 0x80 \b, 128 kbps
  601. >2 byte&0xF0 0x90 \b, 144 kbps
  602. >2 byte&0xF0 0xA0 \b, 160 kbps
  603. >2 byte&0xF0 0xB0 \b, 176 kbps
  604. >2 byte&0xF0 0xC0 \b, 192 kbps
  605. >2 byte&0xF0 0xD0 \b, 224 kbps
  606. >2 byte&0xF0 0xE0 \b, 256 kbps
  607. # timing
  608. >2 byte&0x0C 0x00 \b, 22.05 kHz
  609. >2 byte&0x0C 0x04 \b, 24 kHz
  610. >2 byte&0x0C 0x08 \b, 16 kHz
  611. # channels/options
  612. >3 byte&0xC0 0x00 \b, Stereo
  613. >3 byte&0xC0 0x40 \b, JntStereo
  614. >3 byte&0xC0 0x80 \b, 2x Monaural
  615. >3 byte&0xC0 0xC0 \b, Monaural
  616. #>1 byte ^0x01 \b, Data Verify
  617. #>2 byte &0x02 \b, Packet Pad
  618. #>2 byte &0x01 \b, Custom Flag
  619. #>3 byte &0x08 \b, Copyrighted
  620. #>3 byte &0x04 \b, Original Source
  621. #>3 byte&0x03 1 \b, NR: 50/15 ms
  622. #>3 byte&0x03 3 \b, NR: CCIT J.17
  623. # MP3, M25A
  624. 0 beshort&0xFFFE 0xFFE2 MPEG ADTS, layer III, v2.5
  625. !:mime audio/mpeg
  626. # rate
  627. >2 byte&0xF0 0x10 \b, 8 kbps
  628. >2 byte&0xF0 0x20 \b, 16 kbps
  629. >2 byte&0xF0 0x30 \b, 24 kbps
  630. >2 byte&0xF0 0x40 \b, 32 kbps
  631. >2 byte&0xF0 0x50 \b, 40 kbps
  632. >2 byte&0xF0 0x60 \b, 48 kbps
  633. >2 byte&0xF0 0x70 \b, 56 kbps
  634. >2 byte&0xF0 0x80 \b, 64 kbps
  635. >2 byte&0xF0 0x90 \b, 80 kbps
  636. >2 byte&0xF0 0xA0 \b, 96 kbps
  637. >2 byte&0xF0 0xB0 \b, 112 kbps
  638. >2 byte&0xF0 0xC0 \b, 128 kbps
  639. >2 byte&0xF0 0xD0 \b, 144 kbps
  640. >2 byte&0xF0 0xE0 \b, 160 kbps
  641. # timing
  642. >2 byte&0x0C 0x00 \b, 11.025 kHz
  643. >2 byte&0x0C 0x04 \b, 12 kHz
  644. >2 byte&0x0C 0x08 \b, 8 kHz
  645. # channels/options
  646. >3 byte&0xC0 0x00 \b, Stereo
  647. >3 byte&0xC0 0x40 \b, JntStereo
  648. >3 byte&0xC0 0x80 \b, 2x Monaural
  649. >3 byte&0xC0 0xC0 \b, Monaural
  650. #>1 byte ^0x01 \b, Data Verify
  651. #>2 byte &0x02 \b, Packet Pad
  652. #>2 byte &0x01 \b, Custom Flag
  653. #>3 byte &0x08 \b, Copyrighted
  654. #>3 byte &0x04 \b, Original Source
  655. #>3 byte&0x03 1 \b, NR: 50/15 ms
  656. #>3 byte&0x03 3 \b, NR: CCIT J.17
  657. # AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
  658. # Stored AAC streams (instead of the MP4 format)
  659. 0 string ADIF MPEG ADIF, AAC
  660. !:mime audio/x-hx-aac-adif
  661. >4 byte &0x80
  662. >>13 byte &0x10 \b, VBR
  663. >>13 byte ^0x10 \b, CBR
  664. >>16 byte&0x1E 0x02 \b, single stream
  665. >>16 byte&0x1E 0x04 \b, 2 streams
  666. >>16 byte&0x1E 0x06 \b, 3 streams
  667. >>16 byte &0x08 \b, 4 or more streams
  668. >>16 byte &0x10 \b, 8 or more streams
  669. >>4 byte &0x80 \b, Copyrighted
  670. >>13 byte &0x40 \b, Original Source
  671. >>13 byte &0x20 \b, Home Flag
  672. >4 byte ^0x80
  673. >>4 byte &0x10 \b, VBR
  674. >>4 byte ^0x10 \b, CBR
  675. >>7 byte&0x1E 0x02 \b, single stream
  676. >>7 byte&0x1E 0x04 \b, 2 streams
  677. >>7 byte&0x1E 0x06 \b, 3 streams
  678. >>7 byte &0x08 \b, 4 or more streams
  679. >>7 byte &0x10 \b, 8 or more streams
  680. >>4 byte &0x40 \b, Original Stream(s)
  681. >>4 byte &0x20 \b, Home Source
  682. # Live or stored single AAC stream (used with MPEG-2 systems)
  683. 0 beshort&0xFFF6 0xFFF0 MPEG ADTS, AAC
  684. !:mime audio/x-hx-aac-adts
  685. >1 byte &0x08 \b, v2
  686. >1 byte ^0x08 \b, v4
  687. # profile
  688. >>2 byte &0xC0 \b LTP
  689. >2 byte&0xc0 0x00 \b Main
  690. >2 byte&0xc0 0x40 \b LC
  691. >2 byte&0xc0 0x80 \b SSR
  692. # timing
  693. >2 byte&0x3c 0x00 \b, 96 kHz
  694. >2 byte&0x3c 0x04 \b, 88.2 kHz
  695. >2 byte&0x3c 0x08 \b, 64 kHz
  696. >2 byte&0x3c 0x0c \b, 48 kHz
  697. >2 byte&0x3c 0x10 \b, 44.1 kHz
  698. >2 byte&0x3c 0x14 \b, 32 kHz
  699. >2 byte&0x3c 0x18 \b, 24 kHz
  700. >2 byte&0x3c 0x1c \b, 22.05 kHz
  701. >2 byte&0x3c 0x20 \b, 16 kHz
  702. >2 byte&0x3c 0x24 \b, 12 kHz
  703. >2 byte&0x3c 0x28 \b, 11.025 kHz
  704. >2 byte&0x3c 0x2c \b, 8 kHz
  705. # channels
  706. >2 beshort&0x01c0 0x0040 \b, monaural
  707. >2 beshort&0x01c0 0x0080 \b, stereo
  708. >2 beshort&0x01c0 0x00c0 \b, stereo + center
  709. >2 beshort&0x01c0 0x0100 \b, stereo+center+LFE
  710. >2 beshort&0x01c0 0x0140 \b, surround
  711. >2 beshort&0x01c0 0x0180 \b, surround + LFE
  712. >2 beshort &0x01C0 \b, surround + side
  713. #>1 byte ^0x01 \b, Data Verify
  714. #>2 byte &0x02 \b, Custom Flag
  715. #>3 byte &0x20 \b, Original Stream
  716. #>3 byte &0x10 \b, Home Source
  717. #>3 byte &0x08 \b, Copyrighted
  718. # Live MPEG-4 audio streams (instead of RTP FlexMux)
  719. 0 beshort&0xFFE0 0x56E0 MPEG-4 LOAS
  720. !:mime audio/x-mp4a-latm
  721. #>1 beshort&0x1FFF x \b, %hu byte packet
  722. >3 byte&0xE0 0x40
  723. >>4 byte&0x3C 0x04 \b, single stream
  724. >>4 byte&0x3C 0x08 \b, 2 streams
  725. >>4 byte&0x3C 0x0C \b, 3 streams
  726. >>4 byte &0x08 \b, 4 or more streams
  727. >>4 byte &0x20 \b, 8 or more streams
  728. >3 byte&0xC0 0
  729. >>4 byte&0x78 0x08 \b, single stream
  730. >>4 byte&0x78 0x10 \b, 2 streams
  731. >>4 byte&0x78 0x18 \b, 3 streams
  732. >>4 byte &0x20 \b, 4 or more streams
  733. >>4 byte &0x40 \b, 8 or more streams
  734. # This magic isn't strong enough (matches plausible ISO-8859-1 text)
  735. #0 beshort 0x4DE1 MPEG-4 LO-EP audio stream
  736. #!:mime audio/x-mp4a-latm
  737. # Summary: FLI animation format
  738. # Created by: Daniel Quinlan <quinlan@yggdrasil.com>
  739. # Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
  740. 4 leshort 0xAF11
  741. # standard FLI always has 320x200 resolution and 8 bit color
  742. >8 leshort 320
  743. >>10 leshort 200
  744. >>>12 leshort 8 FLI animation, 320x200x8
  745. !:mime video/x-fli
  746. >>>>6 leshort x \b, %d frames
  747. # frame speed is multiple of 1/70s
  748. >>>>16 leshort x \b, %d/70s per frame
  749. # Summary: FLC animation format
  750. # Created by: Daniel Quinlan <quinlan@yggdrasil.com>
  751. # Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
  752. 4 leshort 0xAF12
  753. # standard FLC always use 8 bit color
  754. >12 leshort 8 FLC animation
  755. !:mime video/x-flc
  756. >>8 leshort x \b, %d
  757. >>10 leshort x \bx%dx8
  758. >>6 uleshort x \b, %d frames
  759. >>16 uleshort x \b, %dms per frame
  760. # DL animation format
  761. # XXX - collision with most `mips' magic
  762. #
  763. # I couldn't find a real magic number for these, however, this
  764. # -appears- to work. Note that it might catch other files, too, so be
  765. # careful!
  766. #
  767. # Note that title and author appear in the two 20-byte chunks
  768. # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
  769. # 255 (hex FF)! The DL format is really bad.
  770. #
  771. #0 byte 1 DL version 1, medium format (160x100, 4 images/screen)
  772. #!:mime video/x-unknown
  773. #>42 byte x - %d screens,
  774. #>43 byte x %d commands
  775. #0 byte 2 DL version 2
  776. #!:mime video/x-unknown
  777. #>1 byte 1 - large format (320x200,1 image/screen),
  778. #>1 byte 2 - medium format (160x100,4 images/screen),
  779. #>1 byte >2 - unknown format,
  780. #>42 byte x %d screens,
  781. #>43 byte x %d commands
  782. # Based on empirical evidence, DL version 3 have several nulls following the
  783. # \003. Most of them start with non-null values at hex offset 0x34 or so.
  784. #0 string \3\0\0\0\0\0\0\0\0\0\0\0 DL version 3
  785. # iso 13818 transport stream
  786. #
  787. # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
  788. # syncbyte 8 bit 0x47
  789. # error_ind 1 bit -
  790. # payload_start 1 bit 1
  791. # priority 1 bit -
  792. # PID 13 bit 0x0000
  793. # scrambling 2 bit -
  794. # adaptfld_ctrl 2 bit 1 or 3
  795. # conti_count 4 bit -
  796. 0 belong&0xFF5FFF10 0x47400010
  797. >188 byte 0x47 MPEG transport stream data
  798. # DIF digital video file format <mpruett@sgi.com>
  799. 0 belong&0xffffff00 0x1f070000 DIF
  800. >4 byte &0x01 (DVCPRO) movie file
  801. >4 byte ^0x01 (DV) movie file
  802. >3 byte &0x80 (PAL)
  803. >3 byte ^0x80 (NTSC)
  804. # Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
  805. 0 belong 0x3026b275 Microsoft ASF
  806. !:mime video/x-ms-asf
  807. # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
  808. 0 string \x8aMNG MNG video data,
  809. !:mime video/x-mng
  810. >4 belong !0x0d0a1a0a CORRUPTED,
  811. >4 belong 0x0d0a1a0a
  812. >>16 belong x %d x
  813. >>20 belong x %d
  814. # JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
  815. 0 string \x8bJNG JNG video data,
  816. !:mime video/x-jng
  817. >4 belong !0x0d0a1a0a CORRUPTED,
  818. >4 belong 0x0d0a1a0a
  819. >>16 belong x %d x
  820. >>20 belong x %d
  821. # Vivo video (Wolfram Kleff)
  822. 3 string \x0D\x0AVersion:Vivo Vivo video data
  823. # VRML (Virtual Reality Modelling Language)
  824. 0 string/w #VRML\ V1.0\ ascii VRML 1 file
  825. !:mime model/vrml
  826. 0 string/w #VRML\ V2.0\ utf8 ISO/IEC 14772 VRML 97 file
  827. !:mime model/vrml
  828. # X3D (Extensible 3D) [http://www.web3d.org/specifications/x3d-3.0.dtd]
  829. # From Michel Briand <michelbriand@free.fr>
  830. 0 string/t \<?xml\ version="
  831. !:strength +1
  832. >20 search/1000/cw \<!DOCTYPE\ X3D X3D (Extensible 3D) model xml text
  833. !:mime model/x3d
  834. #---------------------------------------------------------------------------
  835. # HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
  836. # From Mark Sheppard <msheppard@climax.co.uk>, 2002-10-03
  837. #
  838. 0 string HVQM4 %s
  839. >6 string >\0 v%s
  840. >0 byte x GameCube movie,
  841. >0x34 ubeshort x %d x
  842. >0x36 ubeshort x %d,
  843. >0x26 ubeshort x %dus,
  844. >0x42 ubeshort 0 no audio
  845. >0x42 ubeshort >0 %dHz audio
  846. # From: "Stefan A. Haubenthal" <polluks@web.de>
  847. 0 string DVDVIDEO-VTS Video title set,
  848. >0x21 byte x v%x
  849. 0 string DVDVIDEO-VMG Video manager,
  850. >0x21 byte x v%x
  851. # From: Behan Webster <behanw@websterwood.com>
  852. # NuppelVideo used by Mythtv (*.nuv)
  853. # Note: there are two identical stanzas here differing only in the
  854. # initial string matched. It used to be done with a regex, but we're
  855. # trying to get rid of those.
  856. 0 string NuppelVideo MythTV NuppelVideo
  857. >12 string x v%s
  858. >20 lelong x (%d
  859. >24 lelong x \bx%d),
  860. >36 string P \bprogressive,
  861. >36 string I \binterlaced,
  862. >40 ledouble x \baspect:%.2f,
  863. >48 ledouble x \bfps:%.2f
  864. 0 string MythTV MythTV NuppelVideo
  865. >12 string x v%s
  866. >20 lelong x (%d
  867. >24 lelong x \bx%d),
  868. >36 string P \bprogressive,
  869. >36 string I \binterlaced,
  870. >40 ledouble x \baspect:%.2f,
  871. >48 ledouble x \bfps:%.2f
  872. # MPEG file
  873. # MPEG sequences
  874. # FIXME: This section is from the old magic.mime file and needs
  875. # integrating with the rest
  876. #0 belong 0x000001BA
  877. #>4 byte &0x40
  878. #!:mime video/mp2p
  879. #>4 byte ^0x40
  880. #!:mime video/mpeg
  881. #0 belong 0x000001BB
  882. #!:mime video/mpeg
  883. #0 belong 0x000001B0
  884. #!:mime video/mp4v-es
  885. #0 belong 0x000001B5
  886. #!:mime video/mp4v-es
  887. #0 belong 0x000001B3
  888. #!:mime video/mpv
  889. #0 belong&0xFF5FFF10 0x47400010
  890. #!:mime video/mp2t
  891. #0 belong 0x00000001
  892. #>4 byte&0x1F 0x07
  893. #!:mime video/h264
  894. # Type: Bink Video
  895. # Extension: .bik
  896. # URL: http://wiki.multimedia.cx/index.php?title=Bink_Container
  897. # From: <hoehle@users.sourceforge.net> 2008-07-18
  898. 0 string BIK Bink Video
  899. >3 regex =[a-z] rev.%s
  900. #>4 ulelong x size %d
  901. >20 ulelong x \b, %d
  902. >24 ulelong x \bx%d
  903. >8 ulelong x \b, %d frames
  904. >32 ulelong x at rate %d/
  905. >28 ulelong >1 \b%d
  906. >40 ulelong =0 \b, no audio
  907. >40 ulelong !0 \b, %d audio track
  908. >>40 ulelong !1 \bs
  909. # follow properties of the first audio track only
  910. >>48 uleshort x %dHz
  911. >>51 byte&0x20 0 mono
  912. >>51 byte&0x20 !0 stereo
  913. #>>51 byte&0x10 0 FFT
  914. #>>51 byte&0x10 !0 DCT
  915. # Type: NUT Container
  916. # URL: http://wiki.multimedia.cx/index.php?title=NUT
  917. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  918. 0 string nut/multimedia\ container\0 NUT multimedia container
  919. # Type: Nullsoft Video (NSV)
  920. # URL: http://wiki.multimedia.cx/index.php?title=Nullsoft_Video
  921. # From: Mike Melanson <mike@multimedia.cx>
  922. 0 string NSVf Nullsoft Video
  923. # Type: REDCode Video
  924. # URL: http://www.red.com/ ; http://wiki.multimedia.cx/index.php?title=REDCode
  925. # From: Mike Melanson <mike@multimedia.cx>
  926. 4 string RED1 REDCode Video
  927. # Type: MTV Multimedia File
  928. # URL: http://wiki.multimedia.cx/index.php?title=MTV
  929. # From: Mike Melanson <mike@multimedia.cx>
  930. 0 string AMVS MTV Multimedia File
  931. # Type: ARMovie
  932. # URL: http://wiki.multimedia.cx/index.php?title=ARMovie
  933. # From: Mike Melanson <mike@multimedia.cx>
  934. 0 string ARMovie\012 ARMovie
  935. # Type: Interplay MVE Movie
  936. # URL: http://wiki.multimedia.cx/index.php?title=Interplay_MVE
  937. # From: Mike Melanson <mike@multimedia.cx>
  938. 0 string Interplay\040MVE\040File\032 Interplay MVE Movie
  939. # Type: Windows Television DVR File
  940. # URL: http://wiki.multimedia.cx/index.php?title=WTV
  941. # From: Mike Melanson <mike@mutlimedia.cx>
  942. # This takes the form of a Windows-style GUID
  943. 0 bequad 0xB7D800203749DA11
  944. >8 bequad 0xA64E0007E95EAD8D Windows Television DVR Media
  945. # Type: Sega FILM/CPK Multimedia
  946. # URL: http://wiki.multimedia.cx/index.php?title=Sega_FILM
  947. # From: Mike Melanson <mike@multimedia.cx>
  948. 0 string FILM Sega FILM/CPK Multimedia,
  949. >32 belong x %d x
  950. >28 belong x %d
  951. # Type: Nintendo THP Multimedia
  952. # URL: http://wiki.multimedia.cx/index.php?title=THP
  953. # From: Mike Melanson <mike@multimedia.cx>
  954. 0 string THP\0 Nintendo THP Multimedia
  955. # Type: BBC Dirac Video
  956. # URL: http://wiki.multimedia.cx/index.php?title=Dirac
  957. # From: Mike Melanson <mike@multimedia.cx>
  958. 0 string BBCD BBC Dirac Video
  959. # Type: RAD Game Tools Smacker Multimedia
  960. # URL: http://wiki.multimedia.cx/index.php?title=Smacker
  961. # From: Mike Melanson <mike@multimedia.cx>
  962. 0 string SMK RAD Game Tools Smacker Multimedia
  963. >3 byte x version %c,
  964. >4 lelong x %d x
  965. >8 lelong x %d,
  966. >12 lelong x %d frames