RIFF.pm 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530
  1. #------------------------------------------------------------------------------
  2. # File: RIFF.pm
  3. #
  4. # Description: Read RIFF/WAV/AVI meta information
  5. #
  6. # Revisions: 09/14/2005 - P. Harvey Created
  7. #
  8. # References: 1) http://www.exif.org/Exif2-2.PDF
  9. # 2) http://www.vlsi.fi/datasheets/vs1011.pdf
  10. # 3) http://www.music-center.com.br/spec_rif.htm
  11. # 4) http://www.codeproject.com/audio/wavefiles.asp
  12. # 5) http://msdn.microsoft.com/archive/en-us/directx9_c/directx/htm/avirifffilereference.asp
  13. # 6) http://research.microsoft.com/invisible/tests/riff.h.htm
  14. # 7) http://www.onicos.com/staff/iz/formats/wav.html
  15. # 8) http://graphics.cs.uni-sb.de/NMM/dist-0.9.1/Docs/Doxygen/html/mmreg_8h-source.html
  16. # 9) http://developers.videolan.org/vlc/vlc/doc/doxygen/html/codecs_8h-source.html
  17. # 10) http://wiki.multimedia.cx/index.php?title=TwoCC
  18. # 11) Andreas Winter (SCLive) private communication
  19. # 12) http://abcavi.kibi.ru/infotags.htm
  20. # 13) http://tech.ebu.ch/docs/tech/tech3285.pdf
  21. # 14) https://developers.google.com/speed/webp/docs/riff_container
  22. #------------------------------------------------------------------------------
  23. package Image::ExifTool::RIFF;
  24. use strict;
  25. use vars qw($VERSION);
  26. use Image::ExifTool qw(:DataAccess :Utils);
  27. $VERSION = '1.41';
  28. sub ConvertTimecode($);
  29. # recognized RIFF variants
  30. my %riffType = (
  31. 'WAVE' => 'WAV', 'AVI ' => 'AVI', 'WEBP' => 'WEBP',
  32. 'LA02' => 'LA', 'LA03' => 'LA', 'LA04' => 'LA',
  33. 'OFR ' => 'OFR', 'LPAC' => 'PAC', 'wvpk' => 'WV',
  34. );
  35. # MIME types of recognized RIFF-format files
  36. my %riffMimeType = (
  37. WAV => 'audio/x-wav',
  38. AVI => 'video/x-msvideo',
  39. WEBP => 'image/webp',
  40. LA => 'audio/x-nspaudio',
  41. OFR => 'audio/x-ofr',
  42. PAC => 'audio/x-lpac',
  43. WV => 'audio/x-wavpack',
  44. );
  45. %Image::ExifTool::RIFF::audioEncoding = ( #2
  46. Notes => 'These "TwoCC" audio encoding codes are used in RIFF and ASF files.',
  47. 0x01 => 'Microsoft PCM',
  48. 0x02 => 'Microsoft ADPCM',
  49. 0x03 => 'Microsoft IEEE float',
  50. 0x04 => 'Compaq VSELP', #4
  51. 0x05 => 'IBM CVSD', #4
  52. 0x06 => 'Microsoft a-Law',
  53. 0x07 => 'Microsoft u-Law',
  54. 0x08 => 'Microsoft DTS', #4
  55. 0x09 => 'DRM', #4
  56. 0x0a => 'WMA 9 Speech', #9
  57. 0x0b => 'Microsoft Windows Media RT Voice', #10
  58. 0x10 => 'OKI-ADPCM',
  59. 0x11 => 'Intel IMA/DVI-ADPCM',
  60. 0x12 => 'Videologic Mediaspace ADPCM', #4
  61. 0x13 => 'Sierra ADPCM', #4
  62. 0x14 => 'Antex G.723 ADPCM', #4
  63. 0x15 => 'DSP Solutions DIGISTD',
  64. 0x16 => 'DSP Solutions DIGIFIX',
  65. 0x17 => 'Dialoic OKI ADPCM', #6
  66. 0x18 => 'Media Vision ADPCM', #6
  67. 0x19 => 'HP CU', #7
  68. 0x1a => 'HP Dynamic Voice', #10
  69. 0x20 => 'Yamaha ADPCM', #6
  70. 0x21 => 'SONARC Speech Compression', #6
  71. 0x22 => 'DSP Group True Speech', #6
  72. 0x23 => 'Echo Speech Corp.', #6
  73. 0x24 => 'Virtual Music Audiofile AF36', #6
  74. 0x25 => 'Audio Processing Tech.', #6
  75. 0x26 => 'Virtual Music Audiofile AF10', #6
  76. 0x27 => 'Aculab Prosody 1612', #7
  77. 0x28 => 'Merging Tech. LRC', #7
  78. 0x30 => 'Dolby AC2',
  79. 0x31 => 'Microsoft GSM610',
  80. 0x32 => 'MSN Audio', #6
  81. 0x33 => 'Antex ADPCME', #6
  82. 0x34 => 'Control Resources VQLPC', #6
  83. 0x35 => 'DSP Solutions DIGIREAL', #6
  84. 0x36 => 'DSP Solutions DIGIADPCM', #6
  85. 0x37 => 'Control Resources CR10', #6
  86. 0x38 => 'Natural MicroSystems VBX ADPCM', #6
  87. 0x39 => 'Crystal Semiconductor IMA ADPCM', #6
  88. 0x3a => 'Echo Speech ECHOSC3', #6
  89. 0x3b => 'Rockwell ADPCM',
  90. 0x3c => 'Rockwell DIGITALK',
  91. 0x3d => 'Xebec Multimedia', #6
  92. 0x40 => 'Antex G.721 ADPCM',
  93. 0x41 => 'Antex G.728 CELP',
  94. 0x42 => 'Microsoft MSG723', #7
  95. 0x43 => 'IBM AVC ADPCM', #10
  96. 0x45 => 'ITU-T G.726', #9
  97. 0x50 => 'Microsoft MPEG',
  98. 0x51 => 'RT23 or PAC', #7
  99. 0x52 => 'InSoft RT24', #4
  100. 0x53 => 'InSoft PAC', #4
  101. 0x55 => 'MP3',
  102. 0x59 => 'Cirrus', #7
  103. 0x60 => 'Cirrus Logic', #6
  104. 0x61 => 'ESS Tech. PCM', #6
  105. 0x62 => 'Voxware Inc.', #6
  106. 0x63 => 'Canopus ATRAC', #6
  107. 0x64 => 'APICOM G.726 ADPCM',
  108. 0x65 => 'APICOM G.722 ADPCM',
  109. 0x66 => 'Microsoft DSAT', #6
  110. 0x67 => 'Micorsoft DSAT DISPLAY', #6
  111. 0x69 => 'Voxware Byte Aligned', #7
  112. 0x70 => 'Voxware AC8', #7
  113. 0x71 => 'Voxware AC10', #7
  114. 0x72 => 'Voxware AC16', #7
  115. 0x73 => 'Voxware AC20', #7
  116. 0x74 => 'Voxware MetaVoice', #7
  117. 0x75 => 'Voxware MetaSound', #7
  118. 0x76 => 'Voxware RT29HW', #7
  119. 0x77 => 'Voxware VR12', #7
  120. 0x78 => 'Voxware VR18', #7
  121. 0x79 => 'Voxware TQ40', #7
  122. 0x7a => 'Voxware SC3', #10
  123. 0x7b => 'Voxware SC3', #10
  124. 0x80 => 'Soundsoft', #6
  125. 0x81 => 'Voxware TQ60', #7
  126. 0x82 => 'Microsoft MSRT24', #7
  127. 0x83 => 'AT&T G.729A', #7
  128. 0x84 => 'Motion Pixels MVI MV12', #7
  129. 0x85 => 'DataFusion G.726', #7
  130. 0x86 => 'DataFusion GSM610', #7
  131. 0x88 => 'Iterated Systems Audio', #7
  132. 0x89 => 'Onlive', #7
  133. 0x8a => 'Multitude, Inc. FT SX20', #10
  134. 0x8b => 'Infocom ITS A/S G.721 ADPCM', #10
  135. 0x8c => 'Convedia G729', #10
  136. 0x8d => 'Not specified congruency, Inc.', #10
  137. 0x91 => 'Siemens SBC24', #7
  138. 0x92 => 'Sonic Foundry Dolby AC3 APDIF', #7
  139. 0x93 => 'MediaSonic G.723', #8
  140. 0x94 => 'Aculab Prosody 8kbps', #8
  141. 0x97 => 'ZyXEL ADPCM', #7,
  142. 0x98 => 'Philips LPCBB', #7
  143. 0x99 => 'Studer Professional Audio Packed', #7
  144. 0xa0 => 'Malden PhonyTalk', #8
  145. 0xa1 => 'Racal Recorder GSM', #10
  146. 0xa2 => 'Racal Recorder G720.a', #10
  147. 0xa3 => 'Racal G723.1', #10
  148. 0xa4 => 'Racal Tetra ACELP', #10
  149. 0xb0 => 'NEC AAC NEC Corporation', #10
  150. 0xff => 'AAC', #10
  151. 0x100 => 'Rhetorex ADPCM', #6
  152. 0x101 => 'IBM u-Law', #3
  153. 0x102 => 'IBM a-Law', #3
  154. 0x103 => 'IBM ADPCM', #3
  155. 0x111 => 'Vivo G.723', #7
  156. 0x112 => 'Vivo Siren', #7
  157. 0x120 => 'Philips Speech Processing CELP', #10
  158. 0x121 => 'Philips Speech Processing GRUNDIG', #10
  159. 0x123 => 'Digital G.723', #7
  160. 0x125 => 'Sanyo LD ADPCM', #8
  161. 0x130 => 'Sipro Lab ACEPLNET', #8
  162. 0x131 => 'Sipro Lab ACELP4800', #8
  163. 0x132 => 'Sipro Lab ACELP8V3', #8
  164. 0x133 => 'Sipro Lab G.729', #8
  165. 0x134 => 'Sipro Lab G.729A', #8
  166. 0x135 => 'Sipro Lab Kelvin', #8
  167. 0x136 => 'VoiceAge AMR', #10
  168. 0x140 => 'Dictaphone G.726 ADPCM', #8
  169. 0x150 => 'Qualcomm PureVoice', #8
  170. 0x151 => 'Qualcomm HalfRate', #8
  171. 0x155 => 'Ring Zero Systems TUBGSM', #8
  172. 0x160 => 'Microsoft Audio1', #8
  173. 0x161 => 'Windows Media Audio V2 V7 V8 V9 / DivX audio (WMA) / Alex AC3 Audio', #10
  174. 0x162 => 'Windows Media Audio Professional V9', #10
  175. 0x163 => 'Windows Media Audio Lossless V9', #10
  176. 0x164 => 'WMA Pro over S/PDIF', #10
  177. 0x170 => 'UNISYS NAP ADPCM', #10
  178. 0x171 => 'UNISYS NAP ULAW', #10
  179. 0x172 => 'UNISYS NAP ALAW', #10
  180. 0x173 => 'UNISYS NAP 16K', #10
  181. 0x174 => 'MM SYCOM ACM SYC008 SyCom Technologies', #10
  182. 0x175 => 'MM SYCOM ACM SYC701 G726L SyCom Technologies', #10
  183. 0x176 => 'MM SYCOM ACM SYC701 CELP54 SyCom Technologies', #10
  184. 0x177 => 'MM SYCOM ACM SYC701 CELP68 SyCom Technologies', #10
  185. 0x178 => 'Knowledge Adventure ADPCM', #10
  186. 0x180 => 'Fraunhofer IIS MPEG2AAC', #10
  187. 0x190 => 'Digital Theater Systems DTS DS', #10
  188. 0x200 => 'Creative Labs ADPCM', #6
  189. 0x202 => 'Creative Labs FASTSPEECH8', #6
  190. 0x203 => 'Creative Labs FASTSPEECH10', #6
  191. 0x210 => 'UHER ADPCM', #8
  192. 0x215 => 'Ulead DV ACM', #10
  193. 0x216 => 'Ulead DV ACM', #10
  194. 0x220 => 'Quarterdeck Corp.', #6
  195. 0x230 => 'I-Link VC', #8
  196. 0x240 => 'Aureal Semiconductor Raw Sport', #8
  197. 0x241 => 'ESST AC3', #10
  198. 0x250 => 'Interactive Products HSX', #8
  199. 0x251 => 'Interactive Products RPELP', #8
  200. 0x260 => 'Consistent CS2', #8
  201. 0x270 => 'Sony SCX', #8
  202. 0x271 => 'Sony SCY', #10
  203. 0x272 => 'Sony ATRAC3', #10
  204. 0x273 => 'Sony SPC', #10
  205. 0x280 => 'TELUM Telum Inc.', #10
  206. 0x281 => 'TELUMIA Telum Inc.', #10
  207. 0x285 => 'Norcom Voice Systems ADPCM', #10
  208. 0x300 => 'Fujitsu FM TOWNS SND', #6
  209. 0x301 => 'Fujitsu (not specified)', #10
  210. 0x302 => 'Fujitsu (not specified)', #10
  211. 0x303 => 'Fujitsu (not specified)', #10
  212. 0x304 => 'Fujitsu (not specified)', #10
  213. 0x305 => 'Fujitsu (not specified)', #10
  214. 0x306 => 'Fujitsu (not specified)', #10
  215. 0x307 => 'Fujitsu (not specified)', #10
  216. 0x308 => 'Fujitsu (not specified)', #10
  217. 0x350 => 'Micronas Semiconductors, Inc. Development', #10
  218. 0x351 => 'Micronas Semiconductors, Inc. CELP833', #10
  219. 0x400 => 'Brooktree Digital', #6
  220. 0x401 => 'Intel Music Coder (IMC)', #10
  221. 0x402 => 'Ligos Indeo Audio', #10
  222. 0x450 => 'QDesign Music', #8
  223. 0x500 => 'On2 VP7 On2 Technologies', #10
  224. 0x501 => 'On2 VP6 On2 Technologies', #10
  225. 0x680 => 'AT&T VME VMPCM', #7
  226. 0x681 => 'AT&T TCP', #8
  227. 0x700 => 'YMPEG Alpha (dummy for MPEG-2 compressor)', #10
  228. 0x8ae => 'ClearJump LiteWave (lossless)', #10
  229. 0x1000 => 'Olivetti GSM', #6
  230. 0x1001 => 'Olivetti ADPCM', #6
  231. 0x1002 => 'Olivetti CELP', #6
  232. 0x1003 => 'Olivetti SBC', #6
  233. 0x1004 => 'Olivetti OPR', #6
  234. 0x1100 => 'Lernout & Hauspie', #6
  235. 0x1101 => 'Lernout & Hauspie CELP codec', #10
  236. 0x1102 => 'Lernout & Hauspie SBC codec', #10
  237. 0x1103 => 'Lernout & Hauspie SBC codec', #10
  238. 0x1104 => 'Lernout & Hauspie SBC codec', #10
  239. 0x1400 => 'Norris Comm. Inc.', #6
  240. 0x1401 => 'ISIAudio', #7
  241. 0x1500 => 'AT&T Soundspace Music Compression', #7
  242. 0x181c => 'VoxWare RT24 speech codec', #10
  243. 0x181e => 'Lucent elemedia AX24000P Music codec', #10
  244. 0x1971 => 'Sonic Foundry LOSSLESS', #10
  245. 0x1979 => 'Innings Telecom Inc. ADPCM', #10
  246. 0x1c07 => 'Lucent SX8300P speech codec', #10
  247. 0x1c0c => 'Lucent SX5363S G.723 compliant codec', #10
  248. 0x1f03 => 'CUseeMe DigiTalk (ex-Rocwell)', #10
  249. 0x1fc4 => 'NCT Soft ALF2CD ACM', #10
  250. 0x2000 => 'FAST Multimedia DVM', #7
  251. 0x2001 => 'Dolby DTS (Digital Theater System)', #10
  252. 0x2002 => 'RealAudio 1 / 2 14.4', #10
  253. 0x2003 => 'RealAudio 1 / 2 28.8', #10
  254. 0x2004 => 'RealAudio G2 / 8 Cook (low bitrate)', #10
  255. 0x2005 => 'RealAudio 3 / 4 / 5 Music (DNET)', #10
  256. 0x2006 => 'RealAudio 10 AAC (RAAC)', #10
  257. 0x2007 => 'RealAudio 10 AAC+ (RACP)', #10
  258. 0x2500 => 'Reserved range to 0x2600 Microsoft', #10
  259. 0x3313 => 'makeAVIS (ffvfw fake AVI sound from AviSynth scripts)', #10
  260. 0x4143 => 'Divio MPEG-4 AAC audio', #10
  261. 0x4201 => 'Nokia adaptive multirate', #10
  262. 0x4243 => 'Divio G726 Divio, Inc.', #10
  263. 0x434c => 'LEAD Speech', #10
  264. 0x564c => 'LEAD Vorbis', #10
  265. 0x5756 => 'WavPack Audio', #10
  266. 0x674f => 'Ogg Vorbis (mode 1)', #10
  267. 0x6750 => 'Ogg Vorbis (mode 2)', #10
  268. 0x6751 => 'Ogg Vorbis (mode 3)', #10
  269. 0x676f => 'Ogg Vorbis (mode 1+)', #10
  270. 0x6770 => 'Ogg Vorbis (mode 2+)', #10
  271. 0x6771 => 'Ogg Vorbis (mode 3+)', #10
  272. 0x7000 => '3COM NBX 3Com Corporation', #10
  273. 0x706d => 'FAAD AAC', #10
  274. 0x7a21 => 'GSM-AMR (CBR, no SID)', #10
  275. 0x7a22 => 'GSM-AMR (VBR, including SID)', #10
  276. 0xa100 => 'Comverse Infosys Ltd. G723 1', #10
  277. 0xa101 => 'Comverse Infosys Ltd. AVQSBC', #10
  278. 0xa102 => 'Comverse Infosys Ltd. OLDSBC', #10
  279. 0xa103 => 'Symbol Technologies G729A', #10
  280. 0xa104 => 'VoiceAge AMR WB VoiceAge Corporation', #10
  281. 0xa105 => 'Ingenient Technologies Inc. G726', #10
  282. 0xa106 => 'ISO/MPEG-4 advanced audio Coding', #10
  283. 0xa107 => 'Encore Software Ltd G726', #10
  284. 0xa109 => 'Speex ACM Codec xiph.org', #10
  285. 0xdfac => 'DebugMode SonicFoundry Vegas FrameServer ACM Codec', #10
  286. 0xe708 => 'Unknown -', #10
  287. 0xf1ac => 'Free Lossless Audio Codec FLAC', #10
  288. 0xfffe => 'Extensible', #7
  289. 0xffff => 'Development', #4
  290. );
  291. # RIFF info
  292. %Image::ExifTool::RIFF::Main = (
  293. PROCESS_PROC => \&Image::ExifTool::RIFF::ProcessChunks,
  294. NOTES => q{
  295. The RIFF container format is used various types of fines including WAV, AVI,
  296. WEBP, LA, OFR, PAC and WV. According to the EXIF specification, Meta
  297. information is embedded in two types of RIFF C<LIST> chunks: C<INFO> and
  298. C<exif>, and information about the audio content is stored in the C<fmt >
  299. chunk. As well as this information, some video information and proprietary
  300. manufacturer-specific information is also extracted.
  301. Large AVI videos may be a concatenation of two or more RIFF chunks. For
  302. these files, information is extracted from subsequent RIFF chunks as
  303. sub-documents, but the Duration is calculated for the full video.
  304. },
  305. # (not 100% sure that the concatination technique mentioned above is valid - PH)
  306. 'fmt ' => {
  307. Name => 'AudioFormat',
  308. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::AudioFormat' },
  309. },
  310. 'bext' => {
  311. Name => 'BroadcastExtension',
  312. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::BroadcastExt' },
  313. },
  314. LIST_INFO => {
  315. Name => 'Info',
  316. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::Info' },
  317. },
  318. LIST_exif => {
  319. Name => 'Exif',
  320. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::Exif' },
  321. },
  322. LIST_hdrl => { # AVI header LIST chunk
  323. Name => 'Hdrl',
  324. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::Hdrl' },
  325. },
  326. LIST_Tdat => { #PH (Adobe CS3 Bridge)
  327. Name => 'Tdat',
  328. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::Tdat' },
  329. },
  330. LIST_ncdt => { #PH (Nikon metadata)
  331. Name => 'NikonData',
  332. SubDirectory => {
  333. TagTable => 'Image::ExifTool::Nikon::AVI',
  334. # define ProcessProc here so we don't need to load RIFF.pm from Nikon.pm
  335. ProcessProc => \&Image::ExifTool::RIFF::ProcessChunks,
  336. },
  337. },
  338. LIST_hydt => { #PH (Pentax metadata)
  339. Name => 'PentaxData',
  340. SubDirectory => {
  341. TagTable => 'Image::ExifTool::Pentax::AVI',
  342. ProcessProc => \&Image::ExifTool::RIFF::ProcessChunks,
  343. },
  344. },
  345. # seen LIST_JUNK
  346. JUNK => [
  347. {
  348. Name => 'OlympusJunk',
  349. Condition => '$$valPt =~ /^OLYMDigital Camera/',
  350. SubDirectory => { TagTable => 'Image::ExifTool::Olympus::AVI' },
  351. },
  352. {
  353. Name => 'CasioJunk',
  354. Condition => '$$valPt =~ /^QVMI/',
  355. # Casio stores standard EXIF-format information in AVI videos (EX-S600)
  356. SubDirectory => {
  357. TagTable => 'Image::ExifTool::Exif::Main',
  358. DirName => 'IFD0',
  359. Multi => 0, # (IFD1 is not written)
  360. Start => 10,
  361. ByteOrder => 'BigEndian',
  362. },
  363. },
  364. {
  365. Name => 'RicohJunk',
  366. # the Ricoh Caplio GX stores sub-chunks in here
  367. Condition => '$$valPt =~ /^ucmt/',
  368. SubDirectory => {
  369. TagTable => 'Image::ExifTool::Ricoh::AVI',
  370. ProcessProc => \&Image::ExifTool::RIFF::ProcessChunks,
  371. },
  372. },
  373. {
  374. Name => 'PentaxJunk', # (Optio RS1000)
  375. Condition => '$$valPt =~ /^IIII\x01\0/',
  376. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::Junk' },
  377. },
  378. {
  379. Name => 'PentaxJunk2', # (Optio RZ18)
  380. Condition => '$$valPt =~ /^PENTDigital Camera/',
  381. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::Junk2' },
  382. },
  383. {
  384. Name => 'TextJunk',
  385. # try to interpret unknown junk as an ASCII string
  386. RawConv => '$val =~ /^([^\0-\x1f\x7f-\xff]+)\0*$/ ? $1 : undef',
  387. }
  388. ],
  389. _PMX => { #PH (Adobe CS3 Bridge)
  390. Name => 'XMP',
  391. Notes => 'AVI and WAV files',
  392. SubDirectory => { TagTable => 'Image::ExifTool::XMP::Main' },
  393. },
  394. JUNQ => { #PH (Adobe CS3 Bridge)
  395. # old XMP is preserved when metadata is replaced in Bridge
  396. Name => 'OldXMP',
  397. Binary => 1,
  398. },
  399. olym => {
  400. Name => 'Olym',
  401. SubDirectory => { TagTable => 'Image::ExifTool::Olympus::WAV' },
  402. },
  403. fact => {
  404. Name => 'NumberOfSamples',
  405. RawConv => 'Get32u(\$val, 0)',
  406. },
  407. 'cue ' => {
  408. Name => 'CuePoints',
  409. Binary => 1,
  410. },
  411. afsp => { },
  412. IDIT => {
  413. Name => 'DateTimeOriginal',
  414. Description => 'Date/Time Original',
  415. Groups => { 2 => 'Time' },
  416. ValueConv => 'Image::ExifTool::RIFF::ConvertRIFFDate($val)',
  417. PrintConv => '$self->ConvertDateTime($val)',
  418. },
  419. #
  420. # WebP-specific tags
  421. #
  422. EXIF => { # (WebP)
  423. Name => 'EXIF',
  424. Notes => 'WebP files',
  425. SubDirectory => {
  426. TagTable => 'Image::ExifTool::Exif::Main',
  427. ProcessProc => \&Image::ExifTool::ProcessTIFF,
  428. },
  429. },
  430. 'XMP ' => { #14 (WebP)
  431. Name => 'XMP',
  432. Notes => 'WebP files',
  433. SubDirectory => { TagTable => 'Image::ExifTool::XMP::Main' },
  434. },
  435. ICCP => { #14 (WebP)
  436. Name => 'ICC_Profile',
  437. Notes => 'WebP files',
  438. SubDirectory => { TagTable => 'Image::ExifTool::ICC_Profile::Main' },
  439. },
  440. 'VP8 ' => { # (WebP lossy)
  441. Name => 'VP8Bitstream',
  442. Condition => '$$valPt =~ /^...\x9d\x01\x2a/s',
  443. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::VP8' },
  444. },
  445. VP8L => { #14 (WebP lossless)
  446. Name => 'VP8L',
  447. Condition => '$$valPt =~ /^\x2f/',
  448. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::VP8L' },
  449. },
  450. VP8X => { #14 (WebP extended)
  451. Name => 'VP8X',
  452. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::VP8X' },
  453. },
  454. ANIM => { #14 (WebP animation)
  455. Name => 'ANIM',
  456. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::ANIM' },
  457. },
  458. ANMF => { #14 (WebP animation frame)
  459. Name => 'ANMF',
  460. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::ANMF' },
  461. },
  462. ALPH => { #14 (WebP alpha)
  463. Name => 'ALPH',
  464. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::ALPH' },
  465. },
  466. );
  467. # the maker notes used by some digital cameras
  468. %Image::ExifTool::RIFF::Junk = (
  469. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  470. GROUPS => { 2 => 'Audio' },
  471. );
  472. # Format and Audio Stream Format chunk data
  473. %Image::ExifTool::RIFF::AudioFormat = (
  474. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  475. GROUPS => { 2 => 'Audio' },
  476. FORMAT => 'int16u',
  477. 0 => {
  478. Name => 'Encoding',
  479. PrintHex => 1,
  480. PrintConv => \%Image::ExifTool::RIFF::audioEncoding,
  481. SeparateTable => 'AudioEncoding',
  482. },
  483. 1 => 'NumChannels',
  484. 2 => {
  485. Name => 'SampleRate',
  486. Format => 'int32u',
  487. },
  488. 4 => {
  489. Name => 'AvgBytesPerSec',
  490. Format => 'int32u',
  491. },
  492. # uninteresting
  493. # 6 => 'BlockAlignment',
  494. 7 => 'BitsPerSample',
  495. );
  496. # Broadcast Audio Extension 'bext' information (ref 13)
  497. %Image::ExifTool::RIFF::BroadcastExt = (
  498. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  499. GROUPS => { 2 => 'Audio' },
  500. NOTES => q{
  501. Information found in the Broadcast Audio Extension chunk (see
  502. L<http://tech.ebu.ch/docs/tech/tech3285.pdf>).
  503. },
  504. 0 => {
  505. Name => 'Description',
  506. Format => 'string[256]',
  507. },
  508. 256 => {
  509. Name => 'Originator',
  510. Format => 'string[32]',
  511. },
  512. 288 => {
  513. Name => 'OriginatorReference',
  514. Format => 'string[32]',
  515. },
  516. 320 => {
  517. Name => 'DateTimeOriginal',
  518. Description => 'Date/Time Original',
  519. Groups => { 2 => 'Time' },
  520. Format => 'string[18]',
  521. ValueConv => '$_=$val; tr/-/:/; s/^(\d{4}:\d{2}:\d{2})/$1 /; $_',
  522. PrintConv => '$self->ConvertDateTime($val)',
  523. },
  524. 338 => {
  525. Name => 'TimeReference',
  526. Notes => 'first sample count since midnight',
  527. Format => 'int32u[2]',
  528. ValueConv => 'my @v=split(" ",$val); $v[0] + $v[1] * 4294967296',
  529. },
  530. 346 => {
  531. Name => 'BWFVersion',
  532. Format => 'int16u',
  533. },
  534. # 348 - int8u[64] - SMPTE 330M UMID (Unique Material Identifier)
  535. # 412 - int8u[190] - reserved
  536. 602 => {
  537. Name => 'CodingHistory',
  538. Format => 'string[$size-602]',
  539. },
  540. );
  541. # Sub chunks of INFO LIST chunk
  542. %Image::ExifTool::RIFF::Info = (
  543. PROCESS_PROC => \&Image::ExifTool::RIFF::ProcessChunks,
  544. GROUPS => { 2 => 'Audio' },
  545. NOTES => q{
  546. RIFF INFO tags found in WAV audio and AVI video files. Tags which are part
  547. of the EXIF 2.3 specification have an underlined Tag Name in the HTML
  548. version of this documentation. Other tags are found in AVI files generated
  549. by some software.
  550. },
  551. IARL => 'ArchivalLocation',
  552. IART => { Name => 'Artist', Groups => { 2 => 'Author' } },
  553. ICMS => 'Commissioned',
  554. ICMT => 'Comment',
  555. ICOP => { Name => 'Copyright', Groups => { 2 => 'Author' } },
  556. ICRD => {
  557. Name => 'DateCreated',
  558. Groups => { 2 => 'Time' },
  559. ValueConv => '$_=$val; s/-/:/g; $_',
  560. },
  561. ICRP => 'Cropped',
  562. IDIM => 'Dimensions',
  563. IDPI => 'DotsPerInch',
  564. IENG => 'Engineer',
  565. IGNR => 'Genre',
  566. IKEY => 'Keywords',
  567. ILGT => 'Lightness',
  568. IMED => 'Medium',
  569. INAM => 'Title',
  570. IPLT => 'NumColors',
  571. IPRD => 'Product',
  572. ISBJ => 'Subject',
  573. ISFT => {
  574. Name => 'Software',
  575. # remove trailing nulls/spaces and split at first null
  576. # (Casio writes "CASIO" in unicode after the first null)
  577. ValueConv => '$_=$val; s/(\s*\0)+$//; s/(\s*\0)/, /; s/\0+//g; $_',
  578. },
  579. ISHP => 'Sharpness',
  580. ISRC => 'Source',
  581. ISRF => 'SourceForm',
  582. ITCH => 'Technician',
  583. #
  584. # 3rd party tags
  585. #
  586. # internet movie database (ref 12)
  587. ISGN => 'SecondaryGenre',
  588. IWRI => 'WrittenBy',
  589. IPRO => 'ProducedBy',
  590. ICNM => 'Cinematographer',
  591. IPDS => 'ProductionDesigner',
  592. IEDT => 'EditedBy',
  593. ICDS => 'CostumeDesigner',
  594. IMUS => 'MusicBy',
  595. ISTD => 'ProductionStudio',
  596. IDST => 'DistributedBy',
  597. ICNT => 'Country',
  598. ILNG => 'Language',
  599. IRTD => 'Rating',
  600. ISTR => 'Starring',
  601. # MovieID (ref12)
  602. TITL => 'Title',
  603. DIRC => 'Directory',
  604. YEAR => 'Year',
  605. GENR => 'Genre',
  606. COMM => 'Comments',
  607. LANG => 'Language',
  608. AGES => 'Rated',
  609. STAR => 'Starring',
  610. CODE => 'EncodedBy',
  611. PRT1 => 'Part',
  612. PRT2 => 'NumberOfParts',
  613. # Morgan Multimedia INFO tags (ref 12)
  614. IAS1 => 'FirstLanguage',
  615. IAS2 => 'SecondLanguage',
  616. IAS3 => 'ThirdLanguage',
  617. IAS4 => 'FourthLanguage',
  618. IAS5 => 'FifthLanguage',
  619. IAS6 => 'SixthLanguage',
  620. IAS7 => 'SeventhLanguage',
  621. IAS8 => 'EighthLanguage',
  622. IAS9 => 'NinthLanguage',
  623. ICAS => 'DefaultAudioStream',
  624. IBSU => 'BaseURL',
  625. ILGU => 'LogoURL',
  626. ILIU => 'LogoIconURL',
  627. IWMU => 'WatermarkURL',
  628. IMIU => 'MoreInfoURL',
  629. IMBI => 'MoreInfoBannerImage',
  630. IMBU => 'MoreInfoBannerURL',
  631. IMIT => 'MoreInfoText',
  632. # GSpot INFO tags (ref 12)
  633. IENC => 'EncodedBy',
  634. IRIP => 'RippedBy',
  635. # Sound Forge Pro tags
  636. DISP => 'SoundSchemeTitle',
  637. TLEN => { Name => 'Length', ValueConv => '$val/1000', PrintConv => '"$val s"' },
  638. TRCK => 'TrackNumber',
  639. TURL => 'URL',
  640. TVER => 'Version',
  641. LOCA => 'Location',
  642. TORG => 'Organization',
  643. # Sony Vegas AVI tags, also used by SCLive and Adobe Premier (ref 11)
  644. TAPE => {
  645. Name => 'TapeName',
  646. Groups => { 2 => 'Video' },
  647. },
  648. TCOD => {
  649. Name => 'StartTimecode',
  650. # this is the tape time code for the start of the video
  651. Groups => { 2 => 'Video' },
  652. ValueConv => '$val * 1e-7',
  653. PrintConv => \&ConvertTimecode,
  654. },
  655. TCDO => {
  656. Name => 'EndTimecode',
  657. Groups => { 2 => 'Video' },
  658. ValueConv => '$val * 1e-7',
  659. PrintConv => \&ConvertTimecode,
  660. },
  661. VMAJ => {
  662. Name => 'VegasVersionMajor',
  663. Groups => { 2 => 'Video' },
  664. },
  665. VMIN => {
  666. Name => 'VegasVersionMinor',
  667. Groups => { 2 => 'Video' },
  668. },
  669. CMNT => {
  670. Name => 'Comment',
  671. Groups => { 2 => 'Video' },
  672. },
  673. RATE => {
  674. Name => 'Rate', #? (video? units?)
  675. Groups => { 2 => 'Video' },
  676. },
  677. STAT => {
  678. Name => 'Statistics',
  679. Groups => { 2 => 'Video' },
  680. # ("7318 0 3.430307 1", "0 0 3500.000000 1", "7 0 3.433228 1")
  681. PrintConv => [
  682. '"$val frames captured"',
  683. '"$val dropped"',
  684. '"Data rate $val"',
  685. { 0 => 'Bad', 1 => 'OK' }, # capture OK?
  686. ],
  687. },
  688. DTIM => {
  689. Name => 'DateTimeOriginal',
  690. Description => 'Date/Time Original',
  691. Groups => { 2 => 'Time' },
  692. ValueConv => q{
  693. my @v = split ' ', $val;
  694. return undef unless @v == 2;
  695. # the Kodak EASYSHARE Sport stores this incorrectly as a string:
  696. return $val if $val =~ /^\d{4}:\d{2}:\d{2} \d{2}:\d{2}:\d{2}$/;
  697. # get time in seconds
  698. $val = 1e-7 * ($v[0] * 4294967296 + $v[1]);
  699. # shift from Jan 1, 1601 to Jan 1, 1970
  700. $val -= 134774 * 24 * 3600 if $val != 0;
  701. return Image::ExifTool::ConvertUnixTime($val);
  702. },
  703. PrintConv => '$self->ConvertDateTime($val)',
  704. },
  705. # not observed, but apparently part of the standard:
  706. IDIT => {
  707. Name => 'DateTimeOriginal',
  708. Description => 'Date/Time Original',
  709. Groups => { 2 => 'Time' },
  710. ValueConv => 'Image::ExifTool::RIFF::ConvertRIFFDate($val)',
  711. PrintConv => '$self->ConvertDateTime($val)',
  712. },
  713. ISMP => 'TimeCode',
  714. );
  715. # Sub chunks of EXIF LIST chunk
  716. %Image::ExifTool::RIFF::Exif = (
  717. PROCESS_PROC => \&Image::ExifTool::RIFF::ProcessChunks,
  718. GROUPS => { 2 => 'Audio' },
  719. NOTES => 'These tags are part of the EXIF 2.3 specification for WAV audio files.',
  720. ever => 'ExifVersion',
  721. erel => 'RelatedImageFile',
  722. etim => { Name => 'TimeCreated', Groups => { 2 => 'Time' } },
  723. ecor => { Name => 'Make', Groups => { 2 => 'Camera' } },
  724. emdl => { Name => 'Model', Groups => { 2 => 'Camera' } },
  725. emnt => { Name => 'MakerNotes', Binary => 1 },
  726. eucm => {
  727. Name => 'UserComment',
  728. PrintConv => 'Image::ExifTool::Exif::ConvertExifText($self,$val,"RIFF:UserComment")',
  729. },
  730. );
  731. # Sub chunks of hdrl LIST chunk
  732. %Image::ExifTool::RIFF::Hdrl = (
  733. PROCESS_PROC => \&Image::ExifTool::RIFF::ProcessChunks,
  734. GROUPS => { 2 => 'Image' },
  735. avih => {
  736. Name => 'AVIHeader',
  737. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::AVIHeader' },
  738. },
  739. IDIT => {
  740. Name => 'DateTimeOriginal',
  741. Description => 'Date/Time Original',
  742. Groups => { 2 => 'Time' },
  743. ValueConv => 'Image::ExifTool::RIFF::ConvertRIFFDate($val)',
  744. PrintConv => '$self->ConvertDateTime($val)',
  745. },
  746. ISMP => 'TimeCode',
  747. LIST_strl => {
  748. Name => 'Stream',
  749. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::Stream' },
  750. },
  751. LIST_odml => {
  752. Name => 'OpenDML',
  753. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::OpenDML' },
  754. },
  755. );
  756. # Sub chunks of Tdat LIST chunk (ref PH)
  757. %Image::ExifTool::RIFF::Tdat = (
  758. PROCESS_PROC => \&Image::ExifTool::RIFF::ProcessChunks,
  759. GROUPS => { 2 => 'Video' },
  760. # (have seen tc_O, tc_A, rn_O and rn_A)
  761. );
  762. %Image::ExifTool::RIFF::AVIHeader = (
  763. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  764. GROUPS => { 2 => 'Video' },
  765. FORMAT => 'int32u',
  766. FIRST_ENTRY => 0,
  767. 0 => {
  768. Name => 'FrameRate',
  769. # (must use RawConv because raw value used in Composite tag)
  770. RawConv => '$val ? 1e6 / $val : undef',
  771. PrintConv => 'int($val * 1000 + 0.5) / 1000',
  772. },
  773. 1 => {
  774. Name => 'MaxDataRate',
  775. PrintConv => 'sprintf("%.4g kB/s",$val / 1024)',
  776. },
  777. # 2 => 'PaddingGranularity',
  778. # 3 => 'Flags',
  779. 4 => 'FrameCount',
  780. # 5 => 'InitialFrames',
  781. 6 => 'StreamCount',
  782. # 7 => 'SuggestedBufferSize',
  783. 8 => 'ImageWidth',
  784. 9 => 'ImageHeight',
  785. );
  786. %Image::ExifTool::RIFF::Stream = (
  787. PROCESS_PROC => \&Image::ExifTool::RIFF::ProcessChunks,
  788. GROUPS => { 2 => 'Image' },
  789. strh => {
  790. Name => 'StreamHeader',
  791. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::StreamHeader' },
  792. },
  793. strn => 'StreamName',
  794. strd => { #PH
  795. Name => 'StreamData',
  796. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::StreamData' },
  797. },
  798. strf => [
  799. {
  800. Name => 'AudioFormat',
  801. Condition => '$$self{RIFFStreamType} eq "auds"',
  802. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::AudioFormat' },
  803. },
  804. {
  805. Name => 'VideoFormat',
  806. Condition => '$$self{RIFFStreamType} eq "vids"',
  807. SubDirectory => { TagTable => 'Image::ExifTool::BMP::Main' },
  808. },
  809. ],
  810. );
  811. # Open DML tags (ref http://www.morgan-multimedia.com/download/odmlff2.pdf)
  812. %Image::ExifTool::RIFF::OpenDML = (
  813. PROCESS_PROC => \&Image::ExifTool::RIFF::ProcessChunks,
  814. GROUPS => { 2 => 'Video' },
  815. dmlh => {
  816. Name => 'ExtendedAVIHeader',
  817. SubDirectory => { TagTable => 'Image::ExifTool::RIFF::ExtAVIHdr' },
  818. },
  819. );
  820. # Extended AVI Header tags (ref http://www.morgan-multimedia.com/download/odmlff2.pdf)
  821. %Image::ExifTool::RIFF::ExtAVIHdr = (
  822. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  823. GROUPS => { 2 => 'Video' },
  824. FORMAT => 'int32u',
  825. 0 => 'TotalFrameCount',
  826. );
  827. %Image::ExifTool::RIFF::StreamHeader = (
  828. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  829. GROUPS => { 2 => 'Video' },
  830. FORMAT => 'int32u',
  831. FIRST_ENTRY => 0,
  832. PRIORITY => 0, # so we get values from the first stream
  833. 0 => {
  834. Name => 'StreamType',
  835. Format => 'string[4]',
  836. RawConv => '$$self{RIFFStreamType} = $val',
  837. PrintConv => {
  838. auds => 'Audio',
  839. mids => 'MIDI',
  840. txts => 'Text',
  841. vids => 'Video',
  842. iavs => 'Interleaved Audio+Video',
  843. },
  844. },
  845. 1 => [
  846. {
  847. Name => 'AudioCodec',
  848. Condition => '$$self{RIFFStreamType} eq "auds"',
  849. Format => 'string[4]',
  850. },
  851. {
  852. Name => 'VideoCodec',
  853. Condition => '$$self{RIFFStreamType} eq "vids"',
  854. Format => 'string[4]',
  855. },
  856. {
  857. Name => 'Codec',
  858. Format => 'string[4]',
  859. },
  860. ],
  861. # 2 => 'StreamFlags',
  862. # 3 => 'StreamPriority',
  863. # 3.5 => 'Language',
  864. # 4 => 'InitialFrames',
  865. 5 => [
  866. {
  867. Name => 'AudioSampleRate',
  868. Condition => '$$self{RIFFStreamType} eq "auds"',
  869. Format => 'rational64u',
  870. ValueConv => '$val ? 1/$val : 0',
  871. PrintConv => 'int($val * 100 + 0.5) / 100',
  872. },
  873. {
  874. Name => 'VideoFrameRate',
  875. Condition => '$$self{RIFFStreamType} eq "vids"',
  876. Format => 'rational64u',
  877. # (must use RawConv because raw value used in Composite tag)
  878. RawConv => '$val ? 1/$val : undef',
  879. PrintConv => 'int($val * 1000 + 0.5) / 1000',
  880. },
  881. {
  882. Name => 'StreamSampleRate',
  883. Format => 'rational64u',
  884. ValueConv => '$val ? 1/$val : 0',
  885. PrintConv => 'int($val * 1000 + 0.5) / 1000',
  886. },
  887. ],
  888. # 7 => 'Start',
  889. 8 => [
  890. {
  891. Name => 'AudioSampleCount',
  892. Condition => '$$self{RIFFStreamType} eq "auds"',
  893. },
  894. {
  895. Name => 'VideoFrameCount',
  896. Condition => '$$self{RIFFStreamType} eq "vids"',
  897. },
  898. {
  899. Name => 'StreamSampleCount',
  900. },
  901. ],
  902. # 9 => 'SuggestedBufferSize',
  903. 10 => {
  904. Name => 'Quality',
  905. PrintConv => '$val eq 0xffffffff ? "Default" : $val',
  906. },
  907. 11 => {
  908. Name => 'SampleSize',
  909. PrintConv => '$val ? "$val byte" . ($val==1 ? "" : "s") : "Variable"',
  910. },
  911. # 12 => { Name => 'Frame', Format => 'int16u[4]' },
  912. );
  913. %Image::ExifTool::RIFF::StreamData = ( #PH
  914. PROCESS_PROC => \&Image::ExifTool::RIFF::ProcessStreamData,
  915. GROUPS => { 2 => 'Video' },
  916. NOTES => q{
  917. This chunk is used to store proprietary information in AVI videos from some
  918. cameras. The first 4 characters of the data are used as the Tag ID below.
  919. },
  920. AVIF => {
  921. Name => 'AVIF',
  922. SubDirectory => {
  923. TagTable => 'Image::ExifTool::Exif::Main',
  924. DirName => 'IFD0',
  925. Start => 8,
  926. ByteOrder => 'LittleEndian',
  927. },
  928. },
  929. CASI => { # (used by Casio GV-10)
  930. Name => 'CasioData',
  931. SubDirectory => { TagTable => 'Image::ExifTool::Casio::AVI' },
  932. },
  933. Zora => 'VendorName', # (Samsung PL90 AVI files)
  934. unknown => {
  935. Name => 'UnknownData',
  936. # try to interpret unknown stream data as a string
  937. RawConv => '$_=$val; /^[^\0-\x1f\x7f-\xff]+$/ ? $_ : undef',
  938. },
  939. );
  940. # VP8 bitstream (ref http://www.rfc-editor.org/rfc/pdfrfc/rfc6386.txt.pdf)
  941. %Image::ExifTool::RIFF::VP8 = (
  942. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  943. GROUPS => { 2 => 'Image' },
  944. NOTES => q{
  945. This chunk is found in simple-format (lossy) WebP files. See
  946. L<https://developers.google.com/speed/webp/docs/riff_container> for the WebP
  947. container specification.
  948. },
  949. 0 => {
  950. Name => 'VP8Version',
  951. Mask => 0x0e,
  952. ValueConv => '$val >> 1',
  953. PrintConv => {
  954. 0 => '0 (bicubic reconstruction, normal loop)',
  955. 1 => '1 (bilinear reconstruction, simple loop)',
  956. 2 => '2 (bilinear reconstruction, no loop)',
  957. 3 => '3 (no reconstruction, no loop)',
  958. },
  959. },
  960. 6 => {
  961. Name => 'ImageWidth',
  962. Format => 'int16u',
  963. Mask => 0x3fff,
  964. },
  965. 6.1 => {
  966. Name => 'HorizontalScale',
  967. Format => 'int16u',
  968. Mask => 0xc000,
  969. ValueConv => '$val >> 14',
  970. },
  971. 8 => {
  972. Name => 'ImageHeight',
  973. Format => 'int16u',
  974. Mask => 0x3fff,
  975. },
  976. 8.1 => {
  977. Name => 'VerticalScale',
  978. Format => 'int16u',
  979. Mask => 0xc000,
  980. ValueConv => '$val >> 14',
  981. },
  982. );
  983. # WebP lossless info (ref 14)
  984. %Image::ExifTool::RIFF::VP8L = (
  985. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  986. NOTES => 'This chunk is found in lossless WebP files.',
  987. GROUPS => { 2 => 'Image' },
  988. 1 => {
  989. Name => 'ImageWidth',
  990. Format => 'int16u',
  991. ValueConv => '($val & 0x3fff) + 1',
  992. },
  993. 2 => {
  994. Name => 'ImageHeight',
  995. Format => 'int32u',
  996. ValueConv => '(($val >> 6) & 0x3fff) + 1',
  997. },
  998. );
  999. # WebP extended info (ref 14)
  1000. %Image::ExifTool::RIFF::VP8X = (
  1001. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1002. GROUPS => { 2 => 'Image' },
  1003. NOTES => 'This chunk is found in extended WebP files.',
  1004. # 0 - bitmask: 2=ICC, 3=alpha, 4=EXIF, 5=XMP, 6=animation
  1005. 4 => {
  1006. Name => 'ImageWidth',
  1007. Format => 'int32u',
  1008. ValueConv => '($val & 0xffffff) + 1',
  1009. },
  1010. 6 => {
  1011. Name => 'ImageHeight',
  1012. Format => 'int32u',
  1013. ValueConv => '($val >> 8) + 1',
  1014. },
  1015. );
  1016. # WebP animation info (ref 14)
  1017. %Image::ExifTool::RIFF::ANIM = (
  1018. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1019. GROUPS => { 2 => 'Image' },
  1020. NOTES => 'WebP animation chunk.',
  1021. 0 => {
  1022. Name => 'BackgroundColor',
  1023. Format => 'int8u[4]',
  1024. },
  1025. 4 => {
  1026. Name => 'AnimationLoopCount',
  1027. PrintConv => '$val || "inf"',
  1028. },
  1029. );
  1030. # WebP animation frame info (ref 14)
  1031. %Image::ExifTool::RIFF::ANMF = (
  1032. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1033. GROUPS => { 2 => 'Image' },
  1034. NOTES => 'WebP animation frame chunk.',
  1035. 12 => {
  1036. Name => 'Duration',
  1037. Format => 'int32u',
  1038. Notes => 'extracted as the sum of durations of all animation frames',
  1039. RawConv => q{
  1040. if (defined $$self{VALUE}{Duration}) {
  1041. $$self{VALUE}{Duration} += $val & 0x0fff;
  1042. return undef;
  1043. }
  1044. return $val & 0x0fff;
  1045. },
  1046. ValueConv => '$val / 1000',
  1047. PrintConv => 'ConvertDuration($val)',
  1048. },
  1049. );
  1050. # WebP alpha info (ref 14)
  1051. %Image::ExifTool::RIFF::ALPH = (
  1052. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1053. GROUPS => { 2 => 'Image' },
  1054. NOTES => 'WebP alpha chunk.',
  1055. 0 => {
  1056. Name => 'AlphaPreprocessing',
  1057. Mask => 0x03,
  1058. PrintConv => {
  1059. 0 => 'none',
  1060. 1 => 'Level Reduction',
  1061. },
  1062. },
  1063. 0.1 => {
  1064. Name => 'AlphaFiltering',
  1065. Mask => 0x03,
  1066. PrintConv => {
  1067. 0 => 'none',
  1068. 1 => 'Horizontal',
  1069. 2 => 'Vertical',
  1070. 3 => 'Gradient',
  1071. },
  1072. },
  1073. 0.2 => {
  1074. Name => 'AlphaCompression',
  1075. Mask => 0x03,
  1076. PrintConv => {
  1077. 0 => 'none',
  1078. 1 => 'Lossless',
  1079. },
  1080. },
  1081. );
  1082. # RIFF composite tags
  1083. %Image::ExifTool::RIFF::Composite = (
  1084. Duration => {
  1085. Require => {
  1086. 0 => 'RIFF:FrameRate',
  1087. 1 => 'RIFF:FrameCount',
  1088. },
  1089. Desire => {
  1090. 2 => 'VideoFrameRate',
  1091. 3 => 'VideoFrameCount',
  1092. },
  1093. RawConv => 'Image::ExifTool::RIFF::CalcDuration($self, @val)',
  1094. PrintConv => 'ConvertDuration($val)',
  1095. },
  1096. Duration2 => {
  1097. Name => 'Duration',
  1098. Require => {
  1099. 0 => 'RIFF:AvgBytesPerSec',
  1100. 1 => 'FileSize',
  1101. },
  1102. Desire => {
  1103. # check FrameCount because this calculation only applies
  1104. # to audio-only files (eg. WAV)
  1105. 2 => 'FrameCount',
  1106. 3 => 'VideoFrameCount',
  1107. },
  1108. # (can't calculate duration like this for compressed audio types)
  1109. RawConv => q{
  1110. return undef if $$self{VALUE}{FileType} =~ /^(LA|OFR|PAC|WV)$/;
  1111. return ($val[0] and not ($val[2] or $val[3])) ? $val[1] / $val[0] : undef;
  1112. },
  1113. PrintConv => 'ConvertDuration($val)',
  1114. },
  1115. );
  1116. # add our composite tags
  1117. Image::ExifTool::AddCompositeTags('Image::ExifTool::RIFF');
  1118. #------------------------------------------------------------------------------
  1119. # Convert RIFF date to EXIF format
  1120. my %monthNum = (
  1121. Jan=>1, Feb=>2, Mar=>3, Apr=>4, May=>5, Jun=>6,
  1122. Jul=>7, Aug=>8, Sep=>9, Oct=>10,Nov=>11,Dec=>12
  1123. );
  1124. sub ConvertRIFFDate($)
  1125. {
  1126. my $val = shift;
  1127. my @part = split ' ', $val;
  1128. my $mon;
  1129. if (@part >= 5 and $mon = $monthNum{ucfirst(lc($part[1]))}) {
  1130. # the standard AVI date format (eg. "Mon Mar 10 15:04:43 2003")
  1131. $val = sprintf("%.4d:%.2d:%.2d %s", $part[4],
  1132. $mon, $part[2], $part[3]);
  1133. } elsif ($val =~ m{(\d{4})/\s*(\d+)/\s*(\d+)/?\s+(\d+):\s*(\d+)\s*(P?)}) {
  1134. # but the Casio QV-3EX writes dates like "2001/ 1/27 1:42PM",
  1135. # and the Casio EX-Z30 writes "2005/11/28/ 09:19"... doh!
  1136. $val = sprintf("%.4d:%.2d:%.2d %.2d:%.2d:00",$1,$2,$3,$4+($6?12:0),$5);
  1137. } elsif ($val =~ m{(\d{4})[-/](\d+)[-/](\d+)\s+(\d+:\d+:\d+)}) {
  1138. # the Konica KD500Z writes "2002-12-16 15:35:01\0\0"
  1139. $val = "$1:$2:$3 $4";
  1140. }
  1141. return $val;
  1142. }
  1143. #------------------------------------------------------------------------------
  1144. # Print time
  1145. # Inputs: 0) time in seconds
  1146. # Returns: time string
  1147. sub ConvertTimecode($)
  1148. {
  1149. my $val = shift;
  1150. my $hr = int($val / 3600);
  1151. $val -= $hr * 3600;
  1152. my $min = int($val / 60);
  1153. $val -= $min * 60;
  1154. return sprintf("%d:%.2d:%05.2f", $hr, $min, $val);
  1155. }
  1156. #------------------------------------------------------------------------------
  1157. # Calculate duration of RIFF
  1158. # Inputs: 0) ExifTool ref, 1/2) RIFF:FrameRate/Count, 2/3) VideoFrameRate/Count
  1159. # Returns: Duration in seconds or undef
  1160. # Notes: Sums duration of all sub-documents (concatenated AVI files)
  1161. sub CalcDuration($@)
  1162. {
  1163. my ($et, @val) = @_;
  1164. my $totalDuration = 0;
  1165. my $subDoc = 0;
  1166. my @keyList;
  1167. for (;;) {
  1168. # this is annoying. Apparently (although I couldn't verify this), FrameCount
  1169. # in the RIFF header includes multiple video tracks if they exist (eg. with the
  1170. # FujiFilm REAL 3D AVI's), but the video stream information isn't reliable for
  1171. # some cameras (eg. Olympus FE models), so use the video stream information
  1172. # only if the RIFF header duration is 2 to 3 times longer
  1173. my $dur1 = $val[1] / $val[0] if $val[0];
  1174. if ($val[2] and $val[3]) {
  1175. my $dur2 = $val[3] / $val[2];
  1176. my $rat = $dur1 / $dur2;
  1177. $dur1 = $dur2 if $rat > 1.9 and $rat < 3.1;
  1178. }
  1179. $totalDuration += $dur1 if defined $dur1;
  1180. last unless $subDoc++ < $$et{DOC_COUNT};
  1181. # get tag values for next sub-document
  1182. my @tags = qw(FrameRate FrameCount VideoFrameRate VideoFrameCount);
  1183. my $rawValue = $$et{VALUE};
  1184. my ($i, $j, $key, $keys);
  1185. for ($i=0; $i<@tags; ++$i) {
  1186. if ($subDoc == 1) {
  1187. # generate list of available keys for each tag
  1188. $keys = $keyList[$i] = [ ];
  1189. for ($j=0; ; ++$j) {
  1190. $key = $tags[$i];
  1191. $key .= " ($j)" if $j;
  1192. last unless defined $$rawValue{$key};
  1193. push @$keys, $key;
  1194. }
  1195. } else {
  1196. $keys = $keyList[$i];
  1197. }
  1198. # find key for tag in this sub-document
  1199. my $grp = "Doc$subDoc";
  1200. $grp .= ":RIFF" if $i < 2; # (tags 0 and 1 also in RIFF group)
  1201. $key = $et->GroupMatches($grp, $keys);
  1202. $val[$i] = $key ? $$rawValue{$key} : undef;
  1203. }
  1204. last unless defined $val[0] and defined $val[1]; # (Require'd tags)
  1205. }
  1206. return $totalDuration;
  1207. }
  1208. #------------------------------------------------------------------------------
  1209. # Process stream data
  1210. # Inputs: 0) ExifTool object ref, 1) dirInfo reference, 2) tag table ref
  1211. # Returns: 1 on success
  1212. sub ProcessStreamData($$$)
  1213. {
  1214. my ($et, $dirInfo, $tagTablePtr) = @_;
  1215. my $dataPt = $$dirInfo{DataPt};
  1216. my $start = $$dirInfo{DirStart};
  1217. my $size = $$dirInfo{DirLen};
  1218. return 0 if $size < 4;
  1219. if ($et->Options('Verbose')) {
  1220. $et->VerboseDir($$dirInfo{DirName}, 0, $size);
  1221. }
  1222. my $tag = substr($$dataPt, $start, 4);
  1223. my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag);
  1224. unless ($tagInfo) {
  1225. $tagInfo = $et->GetTagInfo($tagTablePtr, 'unknown');
  1226. return 1 unless $tagInfo;
  1227. }
  1228. my $subdir = $$tagInfo{SubDirectory};
  1229. if ($$tagInfo{SubDirectory}) {
  1230. my $offset = $$subdir{Start} || 0;
  1231. my $baseShift = $$dirInfo{DataPos} + $$dirInfo{DirStart} + $offset;
  1232. my %subdirInfo = (
  1233. DataPt => $dataPt,
  1234. DataPos => $$dirInfo{DataPos} - $baseShift,
  1235. Base => ($$dirInfo{Base} || 0) + $baseShift,
  1236. DataLen => $$dirInfo{DataLen},
  1237. DirStart=> $$dirInfo{DirStart} + $offset,
  1238. DirLen => $$dirInfo{DirLen} - $offset,
  1239. DirName => $$subdir{DirName},
  1240. Parent => $$dirInfo{DirName},
  1241. );
  1242. unless ($offset) {
  1243. # allow processing of 2nd directory at the same address
  1244. my $addr = $subdirInfo{DirStart} + $subdirInfo{DataPos} + $subdirInfo{Base};
  1245. delete $$et{PROCESSED}{$addr}
  1246. }
  1247. # (we could set FIRST_EXIF_POS to $subdirInfo{Base} here to make
  1248. # htmlDump offsets relative to EXIF base if we wanted...)
  1249. my $subTable = GetTagTable($$subdir{TagTable});
  1250. $et->ProcessDirectory(\%subdirInfo, $subTable);
  1251. } else {
  1252. $et->HandleTag($tagTablePtr, $tag, undef,
  1253. DataPt => $dataPt,
  1254. DataPos => $$dirInfo{DataPos},
  1255. Start => $start,
  1256. Size => $size,
  1257. TagInfo => $tagInfo,
  1258. );
  1259. }
  1260. return 1;
  1261. }
  1262. #------------------------------------------------------------------------------
  1263. # Make tag information hash for unknown tag
  1264. # Inputs: 0) Tag table ref, 1) tag ID
  1265. sub MakeTagInfo($$)
  1266. {
  1267. my ($tagTablePtr, $tag) = @_;
  1268. my $name = $tag;
  1269. my $n = ($name =~ s/([\x00-\x1f\x7f-\xff])/'x'.unpack('H*',$1)/eg);
  1270. # print in hex if tag is numerical
  1271. $name = sprintf('0x%.4x',unpack('N',$tag)) if $n > 2;
  1272. AddTagToTable($tagTablePtr, $tag, {
  1273. Name => "Unknown_$name",
  1274. Description => "Unknown $name",
  1275. Unknown => 1,
  1276. Binary => 1,
  1277. });
  1278. }
  1279. #------------------------------------------------------------------------------
  1280. # Process RIFF chunks
  1281. # Inputs: 0) ExifTool object reference, 1) directory information reference
  1282. # 2) tag table reference
  1283. # Returns: 1 on success
  1284. sub ProcessChunks($$$)
  1285. {
  1286. my ($et, $dirInfo, $tagTablePtr) = @_;
  1287. my $dataPt = $$dirInfo{DataPt};
  1288. my $start = $$dirInfo{DirStart};
  1289. my $size = $$dirInfo{DirLen};
  1290. my $end = $start + $size;
  1291. my $base = $$dirInfo{Base};
  1292. my $verbose = $et->Options('Verbose');
  1293. my $unknown = $et->Options('Unknown');
  1294. $et->VerboseDir($$dirInfo{DirName}, 0, $size) if $verbose;
  1295. while ($start + 8 < $end) {
  1296. my $tag = substr($$dataPt, $start, 4);
  1297. my $len = Get32u($dataPt, $start + 4);
  1298. $start += 8;
  1299. if ($start + $len > $end) {
  1300. $et->Warn("Bad $tag chunk");
  1301. return 0;
  1302. }
  1303. if ($tag eq 'LIST' and $len >= 4) {
  1304. $tag .= '_' . substr($$dataPt, $start, 4);
  1305. $len -= 4;
  1306. $start += 4;
  1307. }
  1308. my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag);
  1309. my $baseShift = 0;
  1310. my $val;
  1311. if ($tagInfo) {
  1312. if ($$tagInfo{SubDirectory}) {
  1313. # adjust base if necessary (needed for Ricoh maker notes)
  1314. my $newBase = $tagInfo->{SubDirectory}{Base};
  1315. if (defined $newBase) {
  1316. # different than your average Base eval...
  1317. # here we use an absolute $start address
  1318. $start += $base;
  1319. #### eval Base ($start)
  1320. $newBase = eval $newBase;
  1321. $baseShift = $newBase - $base;
  1322. $start -= $base;
  1323. }
  1324. } elsif (not $$tagInfo{Binary}) {
  1325. $val = substr($$dataPt, $start, $len);
  1326. $val =~ s/\0+$//; # remove trailing nulls from strings
  1327. }
  1328. } elsif ($verbose or $unknown) {
  1329. MakeTagInfo($tagTablePtr, $tag);
  1330. }
  1331. $et->HandleTag($tagTablePtr, $tag, $val,
  1332. DataPt => $dataPt,
  1333. DataPos => $$dirInfo{DataPos} - $baseShift,
  1334. Start => $start,
  1335. Size => $len,
  1336. Base => $base + $baseShift,
  1337. Addr => $base + $baseShift + $start,
  1338. );
  1339. ++$len if $len & 0x01; # must account for padding if odd number of bytes
  1340. $start += $len;
  1341. }
  1342. return 1;
  1343. }
  1344. #------------------------------------------------------------------------------
  1345. # Extract information from a RIFF file
  1346. # Inputs: 0) ExifTool object reference, 1) DirInfo reference
  1347. # Returns: 1 on success, 0 if this wasn't a valid RIFF file
  1348. sub ProcessRIFF($$)
  1349. {
  1350. my ($et, $dirInfo) = @_;
  1351. my $raf = $$dirInfo{RAF};
  1352. my ($buff, $buf2, $type, $mime, $err);
  1353. my $verbose = $et->Options('Verbose');
  1354. my $unknown = $et->Options('Unknown');
  1355. # verify this is a valid RIFF file
  1356. return 0 unless $raf->Read($buff, 12) == 12;
  1357. if ($buff =~ /^RIFF....(.{4})/s) {
  1358. $type = $riffType{$1};
  1359. } else {
  1360. # minimal support for a few obscure lossless audio formats...
  1361. return 0 unless $buff =~ /^(LA0[234]|OFR |LPAC|wvpk)/ and $raf->Read($buf2, 1024);
  1362. $type = $riffType{$1};
  1363. $buff .= $buf2;
  1364. return 0 unless $buff =~ /WAVE(.{4})?fmt /sg and $raf->Seek(pos($buff) - 4, 0);
  1365. }
  1366. $mime = $riffMimeType{$type} if $type;
  1367. $et->SetFileType($type, $mime);
  1368. $$et{RIFFStreamType} = ''; # initialize stream type
  1369. SetByteOrder('II');
  1370. my $tagTablePtr = GetTagTable('Image::ExifTool::RIFF::Main');
  1371. my $pos = 12;
  1372. #
  1373. # Read chunks in RIFF image
  1374. #
  1375. for (;;) {
  1376. my $num = $raf->Read($buff, 8);
  1377. if ($num < 8) {
  1378. $err = 1 if $num;
  1379. last;
  1380. }
  1381. $pos += 8;
  1382. my ($tag, $len) = unpack('a4V', $buff);
  1383. # special case: construct new tag name from specific LIST type
  1384. if ($tag eq 'LIST') {
  1385. $raf->Read($buff, 4) == 4 or $err=1, last;
  1386. $pos += 4;
  1387. $tag .= "_$buff";
  1388. $len -= 4; # already read 4 bytes (the LIST type)
  1389. }
  1390. $et->VPrint(0, "RIFF '$tag' chunk ($len bytes of data):\n");
  1391. if ($len <= 0) {
  1392. if ($len < 0) {
  1393. $et->Warn('Invalid chunk length');
  1394. } elsif ($tag eq "\0\0\0\0") {
  1395. # avoid reading through corupted files filled with nulls because it takes forever
  1396. $et->Warn('Encountered empty null chunk. Processing aborted');
  1397. } else {
  1398. next;
  1399. }
  1400. last;
  1401. }
  1402. # stop when we hit the audio data or AVI index or AVI movie data
  1403. # --> no more because Adobe Bridge stores XMP after this!!
  1404. # (so now we only do this on the FastScan option)
  1405. if (($tag eq 'data' or $tag eq 'idx1' or $tag eq 'LIST_movi') and
  1406. $et->Options('FastScan'))
  1407. {
  1408. $et->VPrint(0, "(end of parsing)\n");
  1409. last;
  1410. }
  1411. # RIFF chunks are padded to an even number of bytes
  1412. my $len2 = $len + ($len & 0x01);
  1413. if ($$tagTablePtr{$tag} or (($verbose or $unknown) and $tag !~ /^(data|idx1|LIST_movi|RIFF)$/)) {
  1414. $raf->Read($buff, $len2) == $len2 or $err=1, last;
  1415. MakeTagInfo($tagTablePtr, $tag) if not $$tagTablePtr{$tag} and ($verbose or $unknown);
  1416. $et->HandleTag($tagTablePtr, $tag, $buff,
  1417. DataPt => \$buff,
  1418. DataPos => 0, # (relative to Base)
  1419. Start => 0,
  1420. Size => $len2,
  1421. Base => $pos,
  1422. );
  1423. } elsif ($tag eq 'RIFF') {
  1424. # don't read into RIFF chunk (eg. concatenated video file)
  1425. $raf->Read($buff, 4) == 4 or $err=1, last;
  1426. # extract information from remaining file as an embedded file
  1427. $$et{DOC_NUM} = ++$$et{DOC_COUNT}
  1428. } else {
  1429. $raf->Seek($len2, 1) or $err=1, last;
  1430. }
  1431. $pos += $len2;
  1432. }
  1433. delete $$et{DOC_NUM};
  1434. $err and $et->Warn('Error reading RIFF file (corrupted?)');
  1435. return 1;
  1436. }
  1437. 1; # end
  1438. __END__
  1439. =head1 NAME
  1440. Image::ExifTool::RIFF - Read RIFF/WAV/AVI meta information
  1441. =head1 SYNOPSIS
  1442. This module is used by Image::ExifTool
  1443. =head1 DESCRIPTION
  1444. This module contains routines required by Image::ExifTool to extract
  1445. information from RIFF-based (Resource Interchange File Format) files,
  1446. including AVI videos, WAV audio files and WEBP images.
  1447. =head1 AUTHOR
  1448. Copyright 2003-2016, Phil Harvey (phil at owl.phy.queensu.ca)
  1449. This library is free software; you can redistribute it and/or modify it
  1450. under the same terms as Perl itself.
  1451. =head1 REFERENCES
  1452. =over 4
  1453. =item L<http://www.exif.org/Exif2-2.PDF>
  1454. =item L<http://www.vlsi.fi/datasheets/vs1011.pdf>
  1455. =item L<http://www.music-center.com.br/spec_rif.htm>
  1456. =item L<http://www.codeproject.com/audio/wavefiles.asp>
  1457. =item L<http://msdn.microsoft.com/archive/en-us/directx9_c/directx/htm/avirifffilereference.asp>
  1458. =item L<http://wiki.multimedia.cx/index.php?title=TwoCC>
  1459. =item L<https://developers.google.com/speed/webp/docs/riff_container>
  1460. =back
  1461. =head1 SEE ALSO
  1462. L<Image::ExifTool::TagNames/RIFF Tags>,
  1463. L<Image::ExifTool(3pm)|Image::ExifTool>
  1464. =cut