animation 44 KB

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