animation 45 KB

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