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