animation 46 KB

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