riff 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. #------------------------------------------------------------------------------
  2. # $File: riff,v 1.43 2021/04/26 15:56:00 christos Exp $
  3. # riff: file(1) magic for RIFF format
  4. # See
  5. #
  6. # https://www.seanet.com/users/matts/riffmci/riffmci.htm
  7. # http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf
  8. # https://www.iana.org/assignments/wave-avi-codec-registry/wave-avi-codec-registry.xml
  9. #
  10. # audio format tag. Assume limits: max 1024 bit, 128 channels, 1 MHz
  11. 0 name riff-wave
  12. >0 leshort 0x01 \b, Microsoft PCM
  13. >>14 leshort >0
  14. >>>14 leshort <1024 \b, %d bit
  15. >0 leshort 0x02 \b, Microsoft ADPCM
  16. >0 leshort 0x03 \b, IEEE Float
  17. >0 leshort 0x04 \b, Compaq VSELP
  18. >0 leshort 0x05 \b, IBM CVSD
  19. >0 leshort 0x06 \b, ITU G.711 A-law
  20. >0 leshort 0x07 \b, ITU G.711 mu-law
  21. >0 leshort 0x08 \b, Microsoft DTS
  22. >0 leshort 0x10 \b, OKI ADPCM
  23. >0 leshort 0x11 \b, IMA ADPCM
  24. >0 leshort 0x12 \b, MediaSpace ADPCM
  25. >0 leshort 0x13 \b, Sierra ADPCM
  26. >0 leshort 0x14 \b, ITU G.723 ADPCM (Yamaha)
  27. >0 leshort 0x15 \b, DSP Solutions DIGISTD
  28. >0 leshort 0x16 \b, DSP Solutions DIGIFIX
  29. >0 leshort 0x17 \b, Dialogic OKI ADPCM
  30. >0 leshort 0x18 \b, MediaVision ADPCM
  31. >0 leshort 0x19 \b, HP CU
  32. >0 leshort 0x20 \b, Yamaha ADPCM
  33. >0 leshort 0x21 \b, Speech Compression SONARC
  34. >0 leshort 0x22 \b, DSP Group True Speech
  35. >0 leshort 0x23 \b, Echo Speech EchoSC1
  36. >0 leshort 0x24 \b, AudioFile AF36
  37. >0 leshort 0x25 \b, APTX
  38. >0 leshort 0x26 \b, AudioFile AF10
  39. >0 leshort 0x27 \b, Prosody 1612
  40. >0 leshort 0x28 \b, LRC
  41. >0 leshort 0x30 \b, Dolby AC2
  42. >0 leshort 0x31 \b, GSM 6.10
  43. >0 leshort 0x32 \b, MSN Audio
  44. >0 leshort 0x33 \b, Antex ADPCME
  45. >0 leshort 0x34 \b, Control Res VQLPC
  46. >0 leshort 0x35 \b, Digireal
  47. >0 leshort 0x36 \b, DigiADPCM
  48. >0 leshort 0x37 \b, Control Res CR10
  49. >0 leshort 0x38 \b, NMS VBXADPCM
  50. >0 leshort 0x39 \b, Roland RDAC
  51. >0 leshort 0x3A \b, Echo Speech EchoSC3
  52. >0 leshort 0x3B \b, Rockwell ADPCM
  53. >0 leshort 0x3C \b, Rockwell Digitalk
  54. >0 leshort 0x3D \b, Xebec
  55. >0 leshort 0x40 \b, ITU G.721 ADPCM
  56. >0 leshort 0x41 \b, ITU G.728 CELP
  57. >0 leshort 0x42 \b, MSG723
  58. >0 leshort 0x50 \b, MPEG
  59. >0 leshort 0x52 \b, RT24
  60. >0 leshort 0x53 \b, PAC
  61. >0 leshort 0x55 \b, MPEG Layer 3
  62. >0 leshort 0x59 \b, Lucent G.723
  63. >0 leshort 0x60 \b, Cirrus
  64. >0 leshort 0x61 \b, ESPCM
  65. >0 leshort 0x62 \b, Voxware
  66. >0 leshort 0x63 \b, Canopus Atrac
  67. >0 leshort 0x64 \b, ITU G.726 ADPCM
  68. >0 leshort 0x65 \b, ITU G.722 ADPCM
  69. >0 leshort 0x66 \b, DSAT
  70. >0 leshort 0x67 \b, DSAT Display
  71. >0 leshort 0x69 \b, Voxware Byte Aligned
  72. >0 leshort 0x70 \b, Voxware AC8
  73. >0 leshort 0x71 \b, Voxware AC10
  74. >0 leshort 0x72 \b, Voxware AC16
  75. >0 leshort 0x73 \b, Voxware AC20
  76. >0 leshort 0x74 \b, Voxware MetaVoice
  77. >0 leshort 0x75 \b, Voxware MetaSound
  78. >0 leshort 0x76 \b, Voxware RT29HW
  79. >0 leshort 0x77 \b, Voxware VR12
  80. >0 leshort 0x78 \b, Voxware VR18
  81. >0 leshort 0x79 \b, Voxware TQ40
  82. >0 leshort 0x80 \b, Softsound
  83. >0 leshort 0x81 \b, Voxware TQ60
  84. >0 leshort 0x82 \b, MSRT24
  85. >0 leshort 0x83 \b, ITU G.729A
  86. >0 leshort 0x84 \b, MVI MV12
  87. >0 leshort 0x85 \b, DF G.726
  88. >0 leshort 0x86 \b, DF GSM610
  89. >0 leshort 0x88 \b, ISIAudio
  90. >0 leshort 0x89 \b, Onlive
  91. >0 leshort 0x91 \b, SBC24
  92. >0 leshort 0x92 \b, Dolby AC3 S/PDIF
  93. >0 leshort 0x97 \b, ZyXEL ADPCM
  94. >0 leshort 0x98 \b, Philips LPCBB
  95. >0 leshort 0x99 \b, Packed
  96. >0 leshort 0x100 \b, Rhetorex ADPCM
  97. >0 leshort 0x101 \b, BeCubed Software IRAT
  98. >0 leshort 0x111 \b, Vivo G.723
  99. >0 leshort 0x112 \b, Vivo Siren
  100. >0 leshort 0x123 \b, Digital G.723
  101. >0 leshort 0x200 \b, Creative ADPCM
  102. >0 leshort 0x202 \b, Creative FastSpeech8
  103. >0 leshort 0x203 \b, Creative FastSpeech10
  104. >0 leshort 0x220 \b, Quarterdeck
  105. >0 leshort 0x300 \b, FM Towns Snd
  106. >0 leshort 0x400 \b, BTV Digital
  107. >0 leshort 0x680 \b, VME VMPCM
  108. >0 leshort 0x1000 \b, OLIGSM
  109. >0 leshort 0x1001 \b, OLIADPCM
  110. >0 leshort 0x1002 \b, OLICELP
  111. >0 leshort 0x1003 \b, OLISBC
  112. >0 leshort 0x1004 \b, OLIOPR
  113. >0 leshort 0x1100 \b, LH Codec
  114. >0 leshort 0x1400 \b, Norris
  115. >0 leshort 0x1401 \b, ISIAudio
  116. >0 leshort 0x1500 \b, Soundspace Music Compression
  117. >0 leshort 0x2000 \b, AC3 DVM
  118. >0 leshort 0x2001 \b, DTS
  119. >2 leshort =1 \b, mono
  120. >2 leshort =2 \b, stereo
  121. >2 leshort >2
  122. >>2 leshort <128 \b, %d channels
  123. >4 lelong >0
  124. >>4 lelong <1000000 %d Hz
  125. # try to find "fmt "
  126. 0 name riff-walk
  127. >0 string fmt\x20
  128. >>4 lelong >15
  129. >>>8 use riff-wave
  130. >0 string LIST
  131. >>&(4.l+4) use riff-walk
  132. >0 string DISP
  133. >>&(4.l+4) use riff-walk
  134. >0 string bext
  135. >>&(4.l+4) use riff-walk
  136. >0 string Fake
  137. >>&(4.l+4) use riff-walk
  138. >0 string fact
  139. >>&(4.l+4) use riff-walk
  140. >0 string VP8
  141. >>11 byte 0x9d
  142. >>>12 byte 0x01
  143. >>>>13 byte 0x2a \b, VP8 encoding
  144. >>>>>14 leshort&0x3fff x \b, %d
  145. >>>>>16 leshort&0x3fff x \bx%d, Scaling:
  146. >>>>>14 leshort&0xc000 0x0000 \b [none]
  147. >>>>>14 leshort&0xc000 0x1000 \b [5/4]
  148. >>>>>14 leshort&0xc000 0x2000 \b [5/3]
  149. >>>>>14 leshort&0xc000 0x3000 \b [2]
  150. >>>>>14 leshort&0xc000 0x0000 \bx[none]
  151. >>>>>14 leshort&0xc000 0x1000 \bx[5/4]
  152. >>>>>14 leshort&0xc000 0x2000 \bx[5/3]
  153. >>>>>14 leshort&0xc000 0x3000 \bx[2]
  154. >>>>>15 byte&0x80 =0x00 \b, YUV color
  155. >>>>>15 byte&0x80 =0x80 \b, bad color specification
  156. >>>>>15 byte&0x40 =0x40 \b, no clamping required
  157. >>>>>15 byte&0x40 =0x00 \b, decoders should clamp
  158. #>0 string x we got %s
  159. #>>&(4.l+4) use riff-walk
  160. # AVI section extended by Patrik Radman <patrik+file-magic@iki.fi>
  161. #
  162. 0 string RIFF RIFF (little-endian) data
  163. # RIFF Palette format
  164. # Update: Joerg Jenderek
  165. # URL: https://en.wikipedia.org/wiki/Resource_Interchange_File_Format
  166. # Reference: https://worms2d.info/Palette_file
  167. # WAVE/AVI codec registry: https://www.iana.org/assignments/wave-avi-codec-registry/wave-avi-codec-registry.xml
  168. >8 string PAL\ \b, palette
  169. !:mime application/x-riff
  170. # color palette by Microsoft Corporation
  171. !:ext pal
  172. # file size = chunk size + 8 in most cases
  173. >>4 ulelong+8 x \b, %u bytes
  174. # Extended PAL Format
  175. >>12 string plth \b, extended
  176. # Simple PAL Format
  177. >>12 string data
  178. # data chunk size = color entries * 4 + 4 + sometimes extra (4) appended bytes
  179. >>>16 ulelong x \b, data size %u
  180. # palVersion is always 0x0300
  181. #>>>20 leshort x \b, version %#4.4x
  182. # palNumEntries specifies the number of palette color entries
  183. >>>22 uleshort x \b, %u entries
  184. # after palPalEntry sized (number of color entries * 4 ) vector
  185. >>>(22.s*4) ubequad x
  186. # jump relative 22 ( 8 + 16) bytes forward points after end of file or to
  187. # appended extra bytes like in http://safecolours.rigdenage.com/set(ms).zip/Protan(MS).pal
  188. >>>>&16 ubelong x \b, extra bytes
  189. >>>>>&-4 ubelong >0 %#8.8x
  190. # RIFF Device Independent Bitmap format
  191. # URL: http://fileformats.archiveteam.org/wiki/RDIB
  192. >8 string RDIB \b, device-independent bitmap
  193. !:ext rdi/dib
  194. >>16 string BM
  195. >>>30 leshort 12 \b, OS/2 1.x format
  196. >>>>34 leshort x \b, %d x
  197. >>>>36 leshort x %d
  198. >>>30 leshort 64 \b, OS/2 2.x format
  199. >>>>34 leshort x \b, %d x
  200. >>>>36 leshort x %d
  201. >>>30 leshort 40 \b, Windows 3.x format
  202. >>>>34 lelong x \b, %d x
  203. >>>>38 lelong x %d x
  204. >>>>44 leshort x %d
  205. # RIFF MIDI format
  206. # URL: http://fileformats.archiveteam.org/wiki/RIFF_MIDI
  207. >8 string RMID \b, MIDI
  208. # http://extension.nirsoft.net/rmi
  209. !:mime audio/mid
  210. #!:mime audio/x-rmid
  211. !:ext rmi
  212. # RIFF Multimedia Movie File format
  213. # URL: http://fileformats.archiveteam.org/wiki/RIFF_Multimedia_Movie
  214. >8 string RMMP \b, multimedia movie
  215. !:mime video/x-mmm
  216. !:ext mmm
  217. # RIFF wrapper for MP3
  218. >8 string RMP3 \b, MPEG Layer 3 audio
  219. #!:mime audio/x-rmp3
  220. # Microsoft WAVE format (*.wav)
  221. # URL: http://fileformats.archiveteam.org/wiki/WAV
  222. >8 string WAVE \b, WAVE audio
  223. #!:mime audio/vnd.wave
  224. !:mime audio/x-wav
  225. # https://www.macdisk.com/macsigen.php
  226. #!:apple ????WAVE
  227. !:ext wav/wave
  228. >>12 string >\0
  229. >>>12 use riff-walk
  230. # Update: Joerg Jenderek
  231. # lower case for Corel Draw version 8 Bidi
  232. >8 string/c cdr
  233. # skip Corel CCX Clipart
  234. >>8 string !CDRXcont
  235. # Corel Draw Picture
  236. >>>0 use corel-draw
  237. # URL: http://fileformats.archiveteam.org/wiki/CCX_(Corel)
  238. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/c/ccx-corel.trid.xml
  239. >>8 string =CDRXcont \b, Corel Clipart
  240. !:mime application/x-corel-ccx
  241. !:ext ccx
  242. # 3rd chunk data {Corel\040Binary\040Meta\040File}
  243. #>>>20 string x \b, 3rd '%-s'
  244. >>>4 ulelong+8 x \b, %u bytes
  245. # From: Joerg Jenderek
  246. # URL: https://en.wikipedia.org/wiki/CorelDRAW
  247. # Reference: http://fileformats.archiveteam.org/wiki/CorelDRAW
  248. # Picture templates created by newer software start with RIFF type CDT
  249. >8 string CDT
  250. >>0 use corel-draw
  251. # Picture templates with version 4.4
  252. >8 string CDST
  253. >>0 use corel-draw
  254. # pattern created by newer software start with RIFF type PAT
  255. >8 string PAT
  256. >>0 use corel-draw
  257. # From: Joerg Jenderek
  258. # URL: https://en.wikipedia.org/wiki/Corel_Designer
  259. # Reference: http://fileformats.archiveteam.org/wiki/Corel_Designer
  260. >8 string DES
  261. >>8 string !DESC
  262. >>>0 use corel-des
  263. # Corel Draw templates with version 12.5 or Corel Designer illustration 12
  264. >>8 string =DESC
  265. # MORE TESTS NEEDED HERE!
  266. #>>>0 use corel-des
  267. #>>>0 use corel-draw
  268. >8 string NUNDROOT \b, Steinberg CuBase
  269. # AVI == Audio Video Interleave
  270. # Reference: http://fileformats.archiveteam.org/wiki/AVI
  271. >8 string AVI\040 \b, AVI
  272. # https://reposcope.com/mimetype/video/x-msvideo
  273. !:mime video/x-msvideo
  274. # https://www.iana.org/assignments/wave-avi-codec-registry/wave-avi-codec-registry.xml
  275. #!:mime video/vnd.avi
  276. !:ext avi/divx
  277. >>12 string LIST
  278. >>>20 string hdrlavih
  279. >>>>&36 lelong x \b, %u x
  280. >>>>&40 lelong x %u,
  281. >>>>&4 lelong >1000000 <1 fps,
  282. >>>>&4 lelong 1000000 1.00 fps,
  283. >>>>&4 lelong 500000 2.00 fps,
  284. >>>>&4 lelong 333333 3.00 fps,
  285. >>>>&4 lelong 250000 4.00 fps,
  286. >>>>&4 lelong 200000 5.00 fps,
  287. >>>>&4 lelong 166667 6.00 fps,
  288. >>>>&4 lelong 142857 7.00 fps,
  289. >>>>&4 lelong 125000 8.00 fps,
  290. >>>>&4 lelong 111111 9.00 fps,
  291. >>>>&4 lelong 100000 10.00 fps,
  292. # ]9.9,10.1[
  293. >>>>&4 lelong <101010
  294. >>>>>&-4 lelong >99010
  295. >>>>>>&-4 lelong !100000 ~10 fps,
  296. >>>>&4 lelong 83333 12.00 fps,
  297. # ]11.9,12.1[
  298. >>>>&4 lelong <84034
  299. >>>>>&-4 lelong >82645
  300. >>>>>>&-4 lelong !83333 ~12 fps,
  301. >>>>&4 lelong 66667 15.00 fps,
  302. # ]14.9,15.1[
  303. >>>>&4 lelong <67114
  304. >>>>>&-4 lelong >66225
  305. >>>>>>&-4 lelong !66667 ~15 fps,
  306. >>>>&4 lelong 50000 20.00 fps,
  307. >>>>&4 lelong 41708 23.98 fps,
  308. >>>>&4 lelong 41667 24.00 fps,
  309. # ]23.9,24.1[
  310. >>>>&4 lelong <41841
  311. >>>>>&-4 lelong >41494
  312. >>>>>>&-4 lelong !41708
  313. >>>>>>>&-4 lelong !41667 ~24 fps,
  314. >>>>&4 lelong 40000 25.00 fps,
  315. # ]24.9,25.1[
  316. >>>>&4 lelong <40161
  317. >>>>>&-4 lelong >39841
  318. >>>>>>&-4 lelong !40000 ~25 fps,
  319. >>>>&4 lelong 33367 29.97 fps,
  320. >>>>&4 lelong 33333 30.00 fps,
  321. # ]29.9,30.1[
  322. >>>>&4 lelong <33445
  323. >>>>>&-4 lelong >33223
  324. >>>>>>&-4 lelong !33367
  325. >>>>>>>&-4 lelong !33333 ~30 fps,
  326. >>>>&4 lelong <32224 >30 fps,
  327. ##>>>>&4 lelong x (%lu)
  328. ##>>>>&20 lelong x %lu frames,
  329. # Note: The tests below assume that the AVI has 1 or 2 streams,
  330. # "vids" optionally followed by "auds".
  331. # (Should cover 99.9% of all AVIs.)
  332. # assuming avih length = 56
  333. >>>88 string LIST
  334. >>>>96 string strlstrh
  335. >>>>>108 string vids video:
  336. >>>>>>&0 lelong 0 uncompressed
  337. # skip past vids strh
  338. >>>>>>(104.l+108) string strf
  339. >>>>>>>(104.l+132) lelong 1 RLE 8bpp
  340. >>>>>>>(104.l+132) string/c anim Intel RDX
  341. >>>>>>>(104.l+132) string/c aur2 AuraVision Aura 2
  342. >>>>>>>(104.l+132) string/c aura AuraVision Aura
  343. >>>>>>>(104.l+132) string/c bt20 Brooktree MediaStream
  344. >>>>>>>(104.l+132) string/c btcv Brooktree Composite Video
  345. >>>>>>>(104.l+132) string/c cc12 Intel YUV12
  346. >>>>>>>(104.l+132) string/c cdvc Canopus DV
  347. >>>>>>>(104.l+132) string/c cham Winnov Caviara Cham
  348. >>>>>>>(104.l+132) string/c cljr Proprietary YUV 4 pixels
  349. >>>>>>>(104.l+132) string/c cmyk Common Data Format in Printing
  350. >>>>>>>(104.l+132) string/c cpla Weitek 4:2:0 YUV Planar
  351. >>>>>>>(104.l+132) string/c cvid Cinepak
  352. >>>>>>>(104.l+132) string/c cwlt Microsoft Color WLT DIB
  353. >>>>>>>(104.l+132) string/c cyuv Creative Labs YUV
  354. >>>>>>>(104.l+132) string/c d261 H.261
  355. >>>>>>>(104.l+132) string/c d263 H.263
  356. >>>>>>>(104.l+132) string/c duck TrueMotion 1.0
  357. >>>>>>>(104.l+132) string/c dve2 DVE-2 Videoconferencing
  358. >>>>>>>(104.l+132) string/c fljp Field Encoded Motion JPEG
  359. >>>>>>>(104.l+132) string/c fvf1 Fractal Video Frame
  360. >>>>>>>(104.l+132) string/c gwlt Microsoft Greyscale WLT DIB
  361. >>>>>>>(104.l+132) string/c h260 H.260
  362. >>>>>>>(104.l+132) string/c h261 H.261
  363. >>>>>>>(104.l+132) string/c h262 H.262
  364. >>>>>>>(104.l+132) string/c h263 H.263
  365. >>>>>>>(104.l+132) string/c h264 H.264
  366. >>>>>>>(104.l+132) string/c h265 H.265
  367. >>>>>>>(104.l+132) string/c h266 H.266
  368. >>>>>>>(104.l+132) string/c h267 H.267
  369. >>>>>>>(104.l+132) string/c h268 H.268
  370. >>>>>>>(104.l+132) string/c h269 H.269
  371. >>>>>>>(104.l+132) string/c i263 Intel I.263
  372. >>>>>>>(104.l+132) string/c i420 Intel Indeo 4
  373. >>>>>>>(104.l+132) string/c ian Intel RDX
  374. >>>>>>>(104.l+132) string/c iclb CellB Videoconferencing Codec
  375. >>>>>>>(104.l+132) string/c ilvc Intel Layered Video
  376. >>>>>>>(104.l+132) string/c ilvr ITU-T H.263+
  377. >>>>>>>(104.l+132) string/c iraw Intel YUV Uncompressed
  378. >>>>>>>(104.l+132) string/c iv30 Intel Indeo 3
  379. >>>>>>>(104.l+132) string/c iv31 Intel Indeo 3.1
  380. >>>>>>>(104.l+132) string/c iv32 Intel Indeo 3.2
  381. >>>>>>>(104.l+132) string/c iv33 Intel Indeo 3.3
  382. >>>>>>>(104.l+132) string/c iv34 Intel Indeo 3.4
  383. >>>>>>>(104.l+132) string/c iv35 Intel Indeo 3.5
  384. >>>>>>>(104.l+132) string/c iv36 Intel Indeo 3.6
  385. >>>>>>>(104.l+132) string/c iv37 Intel Indeo 3.7
  386. >>>>>>>(104.l+132) string/c iv38 Intel Indeo 3.8
  387. >>>>>>>(104.l+132) string/c iv39 Intel Indeo 3.9
  388. >>>>>>>(104.l+132) string/c iv40 Intel Indeo 4.0
  389. >>>>>>>(104.l+132) string/c iv41 Intel Indeo 4.1
  390. >>>>>>>(104.l+132) string/c iv42 Intel Indeo 4.2
  391. >>>>>>>(104.l+132) string/c iv43 Intel Indeo 4.3
  392. >>>>>>>(104.l+132) string/c iv44 Intel Indeo 4.4
  393. >>>>>>>(104.l+132) string/c iv45 Intel Indeo 4.5
  394. >>>>>>>(104.l+132) string/c iv46 Intel Indeo 4.6
  395. >>>>>>>(104.l+132) string/c iv47 Intel Indeo 4.7
  396. >>>>>>>(104.l+132) string/c iv48 Intel Indeo 4.8
  397. >>>>>>>(104.l+132) string/c iv49 Intel Indeo 4.9
  398. >>>>>>>(104.l+132) string/c iv50 Intel Indeo 5.0
  399. >>>>>>>(104.l+132) string/c mpeg MPEG 1 Video Frame
  400. >>>>>>>(104.l+132) string/c mjpg Motion JPEG
  401. >>>>>>>(104.l+132) string/c mp42 Microsoft MPEG-4 v2
  402. >>>>>>>(104.l+132) string/c mp43 Microsoft MPEG-4 v3
  403. >>>>>>>(104.l+132) string/c mrca MR Codec
  404. >>>>>>>(104.l+132) string/c mrle Run Length Encoding
  405. >>>>>>>(104.l+132) string/c msvc Microsoft Video 1
  406. >>>>>>>(104.l+132) string/c phmo Photomotion
  407. >>>>>>>(104.l+132) string/c qpeq QPEG 1.1 Format Video
  408. >>>>>>>(104.l+132) string/c rgbt RGBT
  409. >>>>>>>(104.l+132) string/c rle4 Run Length Encoded 4
  410. >>>>>>>(104.l+132) string/c rle8 Run Length Encoded 8
  411. >>>>>>>(104.l+132) string/c rt21 Intel Indeo 2.1
  412. >>>>>>>(104.l+132) string/c rvx Intel RDX
  413. >>>>>>>(104.l+132) string/c sdcc Sun Digital Camera Codec
  414. >>>>>>>(104.l+132) string/c sfmc Crystal Net SFM Codec
  415. >>>>>>>(104.l+132) string/c smsc SMSC
  416. >>>>>>>(104.l+132) string/c smsd SMSD
  417. >>>>>>>(104.l+132) string/c splc Splash Studios ACM Audio Codec
  418. >>>>>>>(104.l+132) string/c sqz2 Microsoft VXtreme Video Codec
  419. >>>>>>>(104.l+132) string/c sv10 Sorenson Video R1
  420. >>>>>>>(104.l+132) string/c tlms TeraLogic Motion Intraframe Codec A
  421. >>>>>>>(104.l+132) string/c tlst TeraLogic Motion Intraframe Codec B
  422. >>>>>>>(104.l+132) string/c tm20 TrueMotion 2.0
  423. >>>>>>>(104.l+132) string/c tmic TeraLogic Motion Intraframe Codec 2
  424. >>>>>>>(104.l+132) string/c tmot TrueMotion Video Compression
  425. >>>>>>>(104.l+132) string/c tr20 TrueMotion RT 2.0
  426. >>>>>>>(104.l+132) string/c ulti Ultimotion
  427. >>>>>>>(104.l+132) string/c uyvy UYVY 4:2:2 byte ordering
  428. >>>>>>>(104.l+132) string/c v422 24-bit YUV 4:2:2 format
  429. >>>>>>>(104.l+132) string/c v655 16-bit YUV 4:2:2 format
  430. >>>>>>>(104.l+132) string/c vcr1 ATI VCR 1.0
  431. >>>>>>>(104.l+132) string/c vcr2 ATI VCR 2.0
  432. >>>>>>>(104.l+132) string/c vcr3 ATI VCR 3.0
  433. >>>>>>>(104.l+132) string/c vcr4 ATI VCR 4.0
  434. >>>>>>>(104.l+132) string/c vcr5 ATI VCR 5.0
  435. >>>>>>>(104.l+132) string/c vcr6 ATI VCR 6.0
  436. >>>>>>>(104.l+132) string/c vcr7 ATI VCR 7.0
  437. >>>>>>>(104.l+132) string/c vcr8 ATI VCR 8.0
  438. >>>>>>>(104.l+132) string/c vcr9 ATI VCR 9.0
  439. >>>>>>>(104.l+132) string/c vdct Video Maker Pro DIB
  440. >>>>>>>(104.l+132) string/c vids YUV 4:2:2 CCIR 601 for V422
  441. >>>>>>>(104.l+132) string/c vivo Vivo H.263
  442. >>>>>>>(104.l+132) string/c vixl VIXL
  443. >>>>>>>(104.l+132) string/c vlv1 VLCAP.DRV
  444. >>>>>>>(104.l+132) string/c wbvc W9960
  445. >>>>>>>(104.l+132) string/c x263 mmioFOURCC('X','2','6','3')
  446. >>>>>>>(104.l+132) string/c xlv0 XL Video Decoder
  447. >>>>>>>(104.l+132) string/c y211 YUV 2:1:1 Packed
  448. >>>>>>>(104.l+132) string/c y411 YUV 4:1:1 Packed
  449. >>>>>>>(104.l+132) string/c y41b YUV 4:1:1 Planar
  450. >>>>>>>(104.l+132) string/c y41p PC1 4:1:1
  451. >>>>>>>(104.l+132) string/c y41t PC1 4:1:1 with transparency
  452. >>>>>>>(104.l+132) string/c y42b YUV 4:2:2 Planar
  453. >>>>>>>(104.l+132) string/c y42t PC1 4:2:2 with transparency
  454. >>>>>>>(104.l+132) string/c yc12 Intel YUV12 Codec
  455. >>>>>>>(104.l+132) string/c yuv8 Winnov Caviar YUV8
  456. >>>>>>>(104.l+132) string/c yuv9 YUV9
  457. >>>>>>>(104.l+132) string/c yuy2 YUY2 4:2:2 byte ordering packed
  458. >>>>>>>(104.l+132) string/c yuyv BI_YUYV, Canopus
  459. >>>>>>>(104.l+132) string/c fmp4 FFMpeg MPEG-4
  460. >>>>>>>(104.l+132) string/c div3 DivX 3
  461. >>>>>>>>112 string/c div3 Low-Motion
  462. >>>>>>>>112 string/c div4 Fast-Motion
  463. >>>>>>>(104.l+132) string/c divx DivX 4
  464. >>>>>>>(104.l+132) string/c dx50 DivX 5
  465. >>>>>>>(104.l+132) string/c xvid XviD
  466. >>>>>>>(104.l+132) string/c h264 H.264
  467. >>>>>>>(104.l+132) string/c wmv3 Windows Media Video 9
  468. >>>>>>>(104.l+132) string/c h264 X.264 or H.264
  469. >>>>>>>(104.l+132) lelong 0
  470. ##>>>>>>>(104.l+132) string x (%.4s)
  471. # skip past first (video) LIST
  472. >>>>(92.l+96) string LIST
  473. >>>>>(92.l+104) string strlstrh
  474. >>>>>>(92.l+116) string auds \b, audio:
  475. # auds strh length = 56:
  476. >>>>>>>(92.l+172) string strf
  477. >>>>>>>>(92.l+180) leshort 0x0001 uncompressed PCM
  478. >>>>>>>>(92.l+180) leshort 0x0002 ADPCM
  479. >>>>>>>>(92.l+180) leshort 0x0006 aLaw
  480. >>>>>>>>(92.l+180) leshort 0x0007 uLaw
  481. >>>>>>>>(92.l+180) leshort 0x0050 MPEG-1 Layer 1 or 2
  482. >>>>>>>>(92.l+180) leshort 0x0055 MPEG-1 Layer 3
  483. >>>>>>>>(92.l+180) leshort 0x2000 Dolby AC3
  484. >>>>>>>>(92.l+180) leshort 0x0161 DivX
  485. ##>>>>>>>>(92.l+180) leshort x (%#.4x)
  486. >>>>>>>>(92.l+182) leshort 1 (mono,
  487. >>>>>>>>(92.l+182) leshort 2 (stereo,
  488. >>>>>>>>(92.l+182) leshort >2 (%d channels,
  489. >>>>>>>>(92.l+184) lelong x %d Hz)
  490. # auds strh length = 64:
  491. >>>>>>>(92.l+180) string strf
  492. >>>>>>>>(92.l+188) leshort 0x0001 uncompressed PCM
  493. >>>>>>>>(92.l+188) leshort 0x0002 ADPCM
  494. >>>>>>>>(92.l+188) leshort 0x0055 MPEG-1 Layer 3
  495. >>>>>>>>(92.l+188) leshort 0x2000 Dolby AC3
  496. >>>>>>>>(92.l+188) leshort 0x0161 DivX
  497. ##>>>>>>>>(92.l+188) leshort x (%#.4x)
  498. >>>>>>>>(92.l+190) leshort 1 (mono,
  499. >>>>>>>>(92.l+190) leshort 2 (stereo,
  500. >>>>>>>>(92.l+190) leshort >2 (%d channels,
  501. >>>>>>>>(92.l+192) lelong x %d Hz)
  502. # From: Joerg Jenderek
  503. # URL: http://fileformats.archiveteam.org/wiki/VDR_(VirtualDub)
  504. # Reference: http://sourceforge.net/projects/virtualdub/files/virtualdub-win/
  505. # 1.10.4.35491/VirtualDub-1.10.4-src.7z/src/vdremote/Main.cpp
  506. # VirtualDub link handler
  507. >8 string VDRM \b, VirtualDub link
  508. !:mime video/x-vdr
  509. !:ext vdr
  510. >>12 string PATH \b, PATH
  511. # remote-path to video file
  512. >>16 pstring/l x %s
  513. # Animated Cursor format
  514. # Update: Joerg Jenderek
  515. # URL: http://fileformats.archiveteam.org/wiki/Windows_Animated_Cursor
  516. # Reference: https://www.gdgsoft.com/anituner/help/aniformat.htm
  517. >8 string ACON \b, animated cursor
  518. !:mime application/x-navi-animation
  519. # http://extension.nirsoft.net/ani
  520. #!:mime image/ani
  521. !:ext ani
  522. # INAM tag followed by length of title
  523. >>24 string INAM
  524. >>>28 pstring/l x "%s"
  525. # IART tag followed by length of author
  526. >>>(28.l+32) ubelong 0x49415254
  527. >>>>&0 pstring/l x %s
  528. # SoundFont 2 <mpruett@sgi.com>
  529. # URL: http://fileformats.archiveteam.org/wiki/SoundFont_2.0
  530. >8 string sfbk \b, SoundFont/Bank
  531. !:mime audio/x-sfbk
  532. !:ext sf2
  533. # MPEG-1 wrapped in a RIFF, apparently
  534. # URL: http://file.fyicenter.com/17_Video_.DAT_File_Extension_for_VCD_Files.html
  535. >8 string CDXA \b, wrapped MPEG-1 (CDXA)
  536. !:mime video/x-cdxa
  537. !:ext mpg/dat
  538. # URL: http://fileformats.archiveteam.org/wiki/4X_IMA_ADPCM
  539. >8 string 4XMV \b, 4X Movie file
  540. !:mime video/x-4xmv
  541. !:ext 4xm/4xa
  542. # AMV-type AVI file: https://wiki.multimedia.cx/index.php?title=AMV
  543. >8 string AMV\040 \b, AMV
  544. # http://fileformats.archiveteam.org/wiki/MTV_Video_(.AMV)
  545. !:mime video/x-amv
  546. !:ext amv
  547. #!:ext amv/mtv
  548. # URL: http://fileformats.archiveteam.org/wiki/WebP
  549. >8 string WEBP \b, Web/P image
  550. !:mime image/webp
  551. !:ext webp
  552. >>12 use riff-walk
  553. # From: Joerg Jenderek
  554. # URL: http://fileformats.archiveteam.org/wiki/RIFF_MIDS
  555. >8 string MIDS \b, MIDI Stream
  556. !:mime audio/x-mids
  557. !:ext mds
  558. # From: Joerg Jenderek
  559. # URL: http://mark0.net/soft-trid-e.html
  560. # Reference: http://fileformats.archiveteam.org/wiki/Trd_(TRID)
  561. >8 string TRID \b, TrID defs package
  562. !:mime application/x-trid-trd
  563. !:ext trd
  564. # From: Joerg Jenderek
  565. # URL: https://en.wikipedia.org/wiki/CorelDRAW
  566. # Reference: http://fileformats.archiveteam.org/wiki/CorelDRAW
  567. # Note: Since version 3 CorelDraw Pictures are RIFF based
  568. # but data chunks remain proprietary.
  569. # Since version 14 til 15 packed as "content/riffData.cdr" and
  570. # since 16 "content/root.dat" in ZIP container
  571. # TODO: distinguish templates with version 12.5 from Designer illustration 12
  572. # display information of RIFF based Corel Draw pictures, templates and patterns
  573. 0 name corel-draw
  574. # display second chunk for debugging
  575. #>8 string x \b, [8]=%.8s
  576. >0 string x \b, Corel Draw
  577. #!:mime image/x-coreldraw
  578. !:mime application/vnd.corel-draw
  579. # used by newer pictures templates
  580. >>8 string CDT
  581. # used by templates with newer versions since 16
  582. >>>12 string =fver Picture template (root.dat)
  583. !:ext dat
  584. # used by templates with older versions with vrsn tag
  585. >>>12 string !fver
  586. # used by templates with older versions 14-15
  587. >>>>11 string >E Picture template (riffData.cdr)
  588. !:ext cdr
  589. # used by templates with older versions 11-13
  590. >>>>11 string <F Picture template
  591. !:ext cdt/cdrt
  592. # used by older templates with version 4.4
  593. >>8 string CDST Picture template
  594. !:ext cdt
  595. # used by templates with version 12.5
  596. >>8 string DESC Picture template
  597. !:ext cdt
  598. # used by newer patterns with version 22
  599. >>8 string PAT Pattern
  600. !:ext dat
  601. # remaining older templates, patterns, drawings
  602. >>8 default x
  603. # pattern with old version 4.y
  604. >>>26 ulelong =0x0000206C Pattern
  605. !:ext pat
  606. # pattern with newer versions
  607. >>>26 ulelong =0x00000D2C Pattern
  608. !:ext pat
  609. # remaining older templates or pictures
  610. >>>26 default x
  611. # used by older versions 5 - 15
  612. >>>>12 string =vrsn
  613. # 4th chunk size unequal 282Ch only found for CDR
  614. >>>>>26 ulelong !0x0000282c Picture
  615. !:ext cdr
  616. >>>>>26 default x Picture or template
  617. !:ext cdr/cdt
  618. # used by newer versions since 16
  619. >>>>12 string =fver Picture (root.dat)
  620. !:ext dat
  621. # version marked by 1 ASCII char: space~3, ... , F~15, ... , N~22, ... R~22 template
  622. >11 string x \b, version
  623. >11 string >\040 '%-.1s'
  624. >0 use corel-version
  625. >4 ulelong+8 x \b, %u bytes
  626. #
  627. # display numeric version of RIFF based Corel after 3rd RIFF tag
  628. 0 name corel-version
  629. # for debugging purpose; vrsn for short content; fver for 16 byte size
  630. #>12 string x \b, TAG "%-4.4s"
  631. # 1st data chunk length 2 implies short content version
  632. >16 ulelong 2
  633. # vrsn chunk short content interpreted by MajorVersion * 100 + MinorVersion
  634. >>20 uleshort/100 x %u
  635. >>20 uleshort%100 >0 \b.%u
  636. # for debugging purpose display next chunk like: DISP LIST
  637. #>>22 string x \b, 4th "%-4.4s"
  638. #>>26 ulelong x \b, 4th SIZE %#x
  639. # for debugging purpose display 5th chunk like: LIST DISP ccmm osfp
  640. #>>(26.l+30) string x \b, 5th "%-4.4s"
  641. # 1st data chunk length 10h implies 16 byte content with version info
  642. >16 ulelong 0x10
  643. >>34 ubyte x %u
  644. >>>33 ubyte >0 \b.%u
  645. # display information of RIFF based Corel Design formats
  646. 0 name corel-des
  647. # display second chunk for debugging
  648. #>8 string x \b, [8]=%.8s
  649. >12 string x \b, Corel DESIGNER
  650. !:mime image/x-corel-des
  651. #!:mime application/x-vnd.corel.designer.document
  652. # used by Corel Designer with newer versions since 16
  653. >12 string =fver graphics (root.dat)
  654. !:ext dat
  655. # used by Corel Designer templates with older versions with vrsn tag
  656. >12 string !fver
  657. # used by Corel Designer with versions 14-15
  658. >>11 string >D graphics (riffData.cdr)
  659. !:ext cdr
  660. # used by Corel Designer with versions 10-12
  661. >>11 string <E graphics
  662. !:ext des
  663. # version indicated by last ASCII char of second chunk tag
  664. >11 string x \b, version '%-.1s'
  665. # but vrsn short content is not always version indicator
  666. # exceptions: 'A'~11.4 'B'~12 'C'~12.5
  667. >11 string >D
  668. >>0 use corel-version
  669. # for debugging purpose display next chunk like: DISP LIST
  670. #>>22 string x \b, 4th "%-4.4s"
  671. #>>26 ulelong x \b, 4th SIZE %#x
  672. # for debugging purpose display 5th chunk like: LIST osfp
  673. #>>(26.l+30) string x \b, 5th "%-4.4s"
  674. >4 ulelong+8 x \b, %u bytes
  675. #
  676. # XXX - some of the below may only appear in little-endian form.
  677. #
  678. # Also "MV93" appears to be for one form of Macromedia Director
  679. # files, and "GDMF" appears to be another multimedia format.
  680. #
  681. 0 string RIFX RIFF (big-endian) data
  682. # RIFF Palette format
  683. >8 string PAL \b, palette
  684. >>16 beshort x \b, version %d
  685. >>18 beshort x \b, %d entries
  686. # RIFF Device Independent Bitmap format
  687. >8 string RDIB \b, device-independent bitmap
  688. >>16 string BM
  689. >>>30 beshort 12 \b, OS/2 1.x format
  690. >>>>34 beshort x \b, %d x
  691. >>>>36 beshort x %d
  692. >>>30 beshort 64 \b, OS/2 2.x format
  693. >>>>34 beshort x \b, %d x
  694. >>>>36 beshort x %d
  695. >>>30 beshort 40 \b, Windows 3.x format
  696. >>>>34 belong x \b, %d x
  697. >>>>38 belong x %d x
  698. >>>>44 beshort x %d
  699. # RIFF MIDI format
  700. >8 string RMID \b, MIDI
  701. # RIFF Multimedia Movie File format
  702. >8 string RMMP \b, multimedia movie
  703. # Microsoft WAVE format (*.wav)
  704. >8 string WAVE \b, WAVE audio
  705. >>20 leshort 1 \b, Microsoft PCM
  706. >>>34 leshort >0 \b, %d bit
  707. >>22 beshort =1 \b, mono
  708. >>22 beshort =2 \b, stereo
  709. >>22 beshort >2 \b, %d channels
  710. >>24 belong >0 %d Hz
  711. # Corel Draw Picture big endian not tested by real examples
  712. #>8 string CDRA \b, Corel Draw Picture
  713. #>8 string CDR6 \b, Corel Draw Picture, version 6
  714. >8 string CDR
  715. >>0 use \^corel-draw
  716. # AVI == Audio Video Interleave
  717. >8 string AVI\040 \b, AVI
  718. # Animated Cursor format
  719. >8 string ACON \b, animated cursor
  720. # Notation Interchange File Format (big-endian only)
  721. >8 string NIFF \b, Notation Interchange File Format
  722. # SoundFont 2 <mpruett@sgi.com>
  723. >8 string sfbk SoundFont/Bank
  724. #------------------------------------------------------------------------------
  725. # Sony Wave64
  726. # see http://www.vcs.de/fileadmin/user_upload/MBS/PDF/Whitepaper/Informations_about_Sony_Wave64.pdf
  727. # 128 bit RIFF-GUID { 66666972-912E-11CF-A5D6-28DB04C10000 } in little-endian
  728. 0 string riff\x2E\x91\xCF\x11\xA5\xD6\x28\xDB\x04\xC1\x00\x00 Sony Wave64 RIFF data
  729. # 128 bit + total file size (64 bits) so 24 bytes
  730. # then WAVE-GUID { 65766177-ACF3-11D3-8CD1-00C04F8EDB8A }
  731. >24 string wave\xF3\xAC\xD3\x11\x8C\xD1\x00\xC0\x4F\x8E\xDB\x8A \b, WAVE 64 audio
  732. !:mime audio/x-w64
  733. # FMT-GUID { 20746D66-ACF3-11D3-8CD1-00C04F8EDB8A }
  734. >>40 search/256 fmt\x20\xF3\xAC\xD3\x11\x8C\xD1\x00\xC0\x4F\x8E\xDB\x8A \b
  735. >>>&10 leshort =1 \b, mono
  736. >>>&10 leshort =2 \b, stereo
  737. >>>&10 leshort >2 \b, %d channels
  738. >>>&12 lelong >0 %d Hz
  739. #------------------------------------------------------------------------------
  740. # MBWF/RF64
  741. # see EBU TECH 3306 https://tech.ebu.ch/docs/tech/tech3306-2009.pdf
  742. 0 string RF64\xff\xff\xff\xffWAVEds64 MBWF/RF64 audio
  743. !:mime audio/x-wav
  744. >40 search/256 fmt\x20 \b
  745. >>&6 leshort =1 \b, mono
  746. >>&6 leshort =2 \b, stereo
  747. >>&6 leshort >2 \b, %d channels
  748. >>&8 lelong >0 %d Hz