HOME

TheInfoList



OR:

The Resource Interchange File Format (RIFF) is a generic file
container format A container format (informally, sometimes called a wrapper) or metafile is a file format that allows multiple data streams to be embedded into a single file, usually along with metadata for identifying and further detailing those streams. No ...
for storing data in tagged chunks. It is primarily used to store
multimedia Multimedia is a form of communication that uses a combination of different content forms such as text, audio, images, animations, or video into a single interactive presentation, in contrast to tradit ...
such as sound and video, though it may also be used to store any arbitrary data. The Microsoft implementation is mostly known through container formats like
AVI Avi is a given name, usually masculine, often a diminutive of Avram, Avraham, etc. It is sometimes feminine and a diminutive of the Hebrew spelling of Abigail. People with the given name include: * Avi (born 1937), Newbery award-winning Americ ...
, ANI and WAV, which use RIFF as their basis.


History

RIFF was introduced in 1991 by
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washi ...
and IBM, and was presented by Microsoft as the default format for
Windows 3.1 Windows 3.1 is a major release of Microsoft Windows. It was released to manufacturing on April 6, 1992, as a successor to Windows 3.0. Like its predecessors, the Windows 3.1 series ran as a shell on top of MS-DOS. Codenamed Janus, Windows ...
multimedia files. It is based on
Electronic Arts Electronic Arts Inc. (EA) is an American video game company headquartered in Redwood City, California. Founded in May 1982 by Apple employee Trip Hawkins, the company was a pioneer of the early home computer game industry and promoted the ...
'
Interchange File Format Interchange File Format (IFF), is a generic container file format originally introduced by Electronic Arts in 1985 (in cooperation with Commodore) in order to facilitate transfer of data between software produced by different companies. IFF f ...
, introduced in 1985 on the
Commodore Amiga Amiga is a family of personal computers introduced by Commodore in 1985. The original model is one of a number of mid-1980s computers with 16- or 32-bit processors, 256 KB or more of RAM, mouse-based GUIs, and significantly improved graphi ...
, the only difference being that multi-
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable uni ...
integers are in
little-endian In computing, endianness, also known as byte sex, is the order or sequence of bytes of a word of digital data in computer memory. Endianness is primarily expressed as big-endian (BE) or little-endian (LE). A big-endian system stores the most si ...
format, native to the 80x86 processor series used in IBM PCs, rather than the
big-endian In computing, endianness, also known as byte sex, is the order or sequence of bytes of a word of digital data in computer memory. Endianness is primarily expressed as big-endian (BE) or little-endian (LE). A big-endian system stores the most si ...
format native to the
68k The Motorola 68000 series (also known as 680x0, m68000, m68k, or 68k) is a family of 32-bit complex instruction set computer (CISC) microprocessors. During the 1980s and early 1990s, they were popular in personal computers and workstations and w ...
processor series used in
Amiga Amiga is a family of personal computers introduced by Commodore International, Commodore in 1985. The original model is one of a number of mid-1980s computers with 16- or 32-bit processors, 256 KB or more of RAM, mouse-based GUIs, and sign ...
and
Apple Macintosh The Mac (known as Macintosh until 1999) is a family of personal computers designed and marketed by Apple Inc. Macs are known for their ease of use and minimalist designs, and are popular among students, creative professionals, and software ...
computers, where IFF files were heavily used. A RIFX format, which is big-endian, was also introduced. In 2010 Google introduced the
WebP WebP is an image file format developed by Google intended as a replacement for JPEG, PNG, and GIF file formats. It supports both lossy and lossless compression, as well as animation and alpha transparency. Google announced the WebP format i ...
picture format, which uses RIFF as a container.


Explanation

RIFF files consist entirely of " chunks". The overall format is identical to IFF, except for the endianness as previously stated, and the different meaning of the chunk names. All chunks have the following format: * 4 bytes: an
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
identifier for this chunk (examples are "fmt " and "data"; note the space in "fmt "). * 4 bytes: an unsigned, little-endian 32-
bit The bit is the most basic unit of information in computing and digital communications. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represente ...
integer with the length of this chunk (except this field itself and the chunk identifier). * variable-sized field: the chunk data itself, of the size given in the previous field. * a pad byte, if the chunk's length is not even. Two chunk identifiers, "RIFF" and "LIST", introduce a chunk that can contain subchunks. The RIFF and LIST chunk data (appearing after the identifier and length) have the following format: * 4 bytes: an ASCII identifier for this particular RIFF or LIST chunk (for RIFF in the typical case, these 4 bytes describe the content of the entire file, such as "AVI " or "WAVE"). * rest of data: subchunks. The file itself consists of one RIFF chunk, which then can contain further subchunks: hence, the first four bytes of a correctly formatted RIFF file will spell out "RIFF". More information about the RIFF format can be found in the
Interchange File Format Interchange File Format (IFF), is a generic container file format originally introduced by Electronic Arts in 1985 (in cooperation with Commodore) in order to facilitate transfer of data between software produced by different companies. IFF f ...
article.
RF64 {{Infobox file format , name = RF64 , icon = , iconcaption = , icon_size = , screenshot = , screenshot_size = , caption = , _noextcode = , extension = , _nomimecode = , mime = , type_code = , uniform_type = , c ...
is a multichannel file format based on RIFF specification, developed by the
European Broadcasting Union The European Broadcasting Union (EBU; french: Union européenne de radio-télévision, links=no, UER) is an alliance of public service media organisations whose countries are within the European Broadcasting Area or who are members of the C ...
. It is BWF-compatible and allows file sizes to exceed 4
gigabyte The gigabyte () is a multiple of the unit byte for digital information. The prefix '' giga'' means 109 in the International System of Units (SI). Therefore, one gigabyte is one billion bytes. The unit symbol for the gigabyte is GB. This definit ...
s. It does so by providing a "ds64" chunk with a 64-bit (8-byte) size.


Use of the INFO chunk

The optional INFO chunk allows RIFF files to be "tagged" with information falling into a number of predefined categories, such as copyright ("ICOP"), comments ("ICMT"), artist ("IART"), in a standardised way. These details can be read from a RIFF file even if the rest of the file format is unrecognized. The standard also allows the use of user-defined fields. Programmers intending to use non-standard fields should bear in mind that the same non-standard subchunk ID may be used by different applications in different (and potentially incompatible) ways.


Compatibility issues


Initial difficulties with MIDI files

In line with their policy of using .RIFF for all Windows 3.1 "multimedia" files, Microsoft introduced a new variant on the existing
MIDI file MIDI (; Musical Instrument Digital Interface) is a technical standard that describes a communications protocol, digital interface, and electrical connectors that connect a wide variety of electronic musical instruments, computers, and re ...
format used for storing song information to be played on electronic musical instruments. Microsoft's "new" MIDI file format consisted of a standard MIDI file enclosed in a RIFF "wrapper", and had the file extension .RMI. Since the existing MIDI file format already supported embedded "tagging" information, the advantages to the user of having a new format were not obvious. The MIDI Manufacturers Association have since embraced the RIFF-based MIDI file format, and used it as the basis of an "extended midifile" that also includes instrument data in " DLS" format, embedded within the same .RMI file.


INFO chunk placement problems

For cataloguing purposes, the optimal position for the INFO chunk is near the beginning of the file. However, since the INFO chunk is optional, it is often omitted from the detailed specifications of individual file formats, leading to some confusion over the correct position for this chunk within a file. When dealing with large media files, the expansion or contraction of the INFO chunk during tag-editing can result in the following "data" section of the file having to be read and rewritten back to disk to accommodate the new header size. Since media files can be gigabytes in size, this is a potentially disk-intensive process. One workaround is to "pad out" the leading INFO chunk using dummy data (using a "dummy chunk" or "pad chunk") when the file is created. Later editing can then expand or contract the "dummy" field to keep the total size of the file header constant: an intelligently written piece of software can then overwrite just the file header when tagging data is changed, without modifying or moving the main body of the file. Some programs have tried to address the problem by placing the INFO chunk at the end of a media file, after the main body of the file. This has resulted in two different conventions for chunk placement, with the attendant risk that some combinations of software can cause a file's INFO data to be ignored or permanently overwritten during editing. More sophisticated programs will take into account the possibility of "unexpected" chunk placement in files and respond accordingly. For instance, when the audio-editing program Audacity encounters a .WAV file with end-placed INFO data, it will correctly identify and read the data, but on saving, will relocate the INFO chunk back to the file header. Although
CorelDRAW CorelDRAW is a vector graphics editor developed and marketed by Corel Corporation. It is also the name of the Corel graphics suite, which includes the bitmap-image editor Corel Photo-Paint as well as other graphics-related programs (see below) ...
10 nominally uses a RIFF file structure, the program's initial release placed the INFO chunk at the end, so that any embedded preview bitmap would not be displayed under Windows' file manager by default. A "patch" utility supplied with the program fixes this problem.


RIFF info tags

RIFF information tags are found in WAV audio and AVI video files. Tags which are part of the
Exif Exchangeable image file format (officially Exif, according to JEIDA/JEITA/CIPA specifications) is a standard that specifies formats for images, sound, and ancillary tags used by digital cameras (including smartphones), scanners and other syste ...
2.2 specification (Tag ID's beginning with "I") have an underlined tag name in the HTML version of this documentation. Other tags are found in AVI files generated by
Sony Vegas Vegas Pro (stylized as VEGAS Pro, colloquially called ''Sony Vegas'') is a video editing software package for non-linear editing (NLE). The first release of Vegas Beta was on June 11, 1999. The software runs on Windows operating systems. Origin ...
video editing software.


Converting DTIM time to normal time

The field consists of two values (v and v separated with a space (0x20). Sample code: // time in seconds - "concatenate" date & time elements with a decimal point delimiter TimeInSeconds = (v * (2^32) + v * 10^(-7); // shift basis from Jan 1, 1601 to Unix epoch Jan 1, 1970 (369 years & leap days) UnixTimeStamp = TimeInSeconds - 134774 * 24 * 3600;


Some common RIFF file types

* WAV (Windows audio) *
AVI Avi is a given name, usually masculine, often a diminutive of Avram, Avraham, etc. It is sometimes feminine and a diminutive of the Hebrew spelling of Abigail. People with the given name include: * Avi (born 1937), Newbery award-winning Americ ...
(Windows audiovisual) * RMI (Windows "RIFF MIDIfile") * CDR (CorelDRAW vector graphics file) * ANI (Animated Windows cursors) *
PAL Phase Alternating Line (PAL) is a colour encoding system for analogue television. It was one of three major analogue colour television standards, the others being NTSC and SECAM. In most countries it was broadcast at 625 lines, 50 fields (25 ...
(Palette) * DLS (Downloadable Sounds) *
WebP WebP is an image file format developed by Google intended as a replacement for JPEG, PNG, and GIF file formats. It supports both lossy and lossless compression, as well as animation and alpha transparency. Google announced the WebP format i ...
(An image format developed by Google) * XMA (Microsoft
Xbox 360 The Xbox 360 is a home video game console developed by Microsoft. As the successor to the original Xbox, it is the second console in the Xbox series. It competed with Sony's PlayStation 3 and Nintendo's Wii as part of the seventh generati ...
console audio format based on
WMA Pro Windows Media Audio (WMA) is a series of audio codecs and their corresponding audio coding formats developed by Microsoft. It is a proprietary technology that forms part of the Windows Media framework. WMA consists of four distinct codecs. The or ...
)


See also

* IFF (the
big-endian In computing, endianness, also known as byte sex, is the order or sequence of bytes of a word of digital data in computer memory. Endianness is primarily expressed as big-endian (BE) or little-endian (LE). A big-endian system stores the most si ...
format from which RIFF derives) *
AIFF Audio Interchange File Format (AIFF) is an audio file format standard used for storing sound data for personal computers and other electronic audio devices. The format was developed by Apple Inc. in 1988 based on Electronic Arts' Interchange ...
* BWF Broadcast Wave Format * TLV (the generic format that RIFF is an example of) * FourCC (the chunk identification approach used by many TLV formats, including IFF, as verbose Magic number)


References


External links


Resource Interchange File Format Services

RIFF AVI file reference
!--http://msdn.microsoft.com/en-us/library/windows/desktop/dd318189(v=vs.85).aspx-->
Reading WAVE files

DirectMusic file format

Multimedia Registration Kit


{{Compression formats Computer file formats Computer-related introductions in 1991