Resource Interchange File Format: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted section blanking Visual edit Mobile edit Mobile web edit
ce for tone
 
(9 intermediate revisions by 4 users not shown)
Line 1:
{{shortShort description|Tagged file structure for multimedia resource files}}
{{moreMore footnotes needed|date=January 2019}}
{{Infobox file format
| name = RIFF
Line 34:
'''Resource Interchange File Format''' ('''RIFF''') is a generic file [[container format (digital)|container format]] for storing data in tagged [[Chunk (information)|chunks]].<ref>{{Cite book |title=Multimedia Programming Interface and Data Specifications 1.0 |url=https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf |pages=10–11 |publisher=IBM / Microsoft |date=August 1991 |access-date=2017-07-07}}</ref> It is primarily used for audio and video, though it can be used for arbitrary data.<ref name="LoC">{{cite web|url=http://www.digitalpreservation.gov/formats/fdd/fdd000025.shtml|title=RIFF (Resource Interchange File Format)|publisher=[[Library of Congress]]|work=Digital Preservation|date=2014-01-08|access-date=2014-03-11}}</ref>
 
The Microsoft implementation is mostly known through the container formats like [[Audio Video Interleave|AVI]], [[ANI (animation file format)|ANI]] and [[WAV]], which use RIFF as their basis.<ref name="micriff">{{cite book|title=Encyclopedia of Graphics File Formats, Second Edition |date=1996 |author=James D. Murray |author2=William vanRyper |isbn=1-56592-161-5 |publisher=[[O'Reilly Media|O'Reilly]] |at=Microsoft RIFF |url=https://www.fileformat.info/format/riff/egff.htm |access-date=2016-04-07 |url-status=live |archive-url=https://web.archive.org/web/20051128020903/http://www.oreilly.com/www/centers/gff/formats/micriff/index.htm |archive-date=November 28, 2005 }}</ref>
 
== History ==
RIFF was introduced in 1991 by [[Microsoft]] and [[International Business Machines|IBM]] and used as the default format for [[Windows 3.1x|Windows 3.1]] multimedia files. It is based on [[Interchange File Format]] introduced by [[Electronic Arts]] in 1985 on the [[Amiga]]. IFF uses the [[endiannessEndianness|big-endian]] convention of the Amiga's [[Motorola 68000]] CPU, but in RIFF multi-[[byte]] integers are stored in the [[endiannessEndianness|little-endian]] order of the [[x86]] processors used in [[IBM PC compatible]]s. A RIFX format, which is big-endian, was also introduced.
 
In 2010 Google introduced the [[WebP]] picture format, which uses RIFF as a container.<ref>{{Cite web |url=http://code.google.com/speed/webp/docs/riff_container.html |title=RIFF Container |work=[[Google Code]] |access-date=1 October 2010 }}</ref>
| url = http://code.google.com/speed/webp/docs/riff_container.html
| title = RIFF Container
| work = [[Google Code]]
| access-date = 1 October 2010
}}</ref>
 
== Explanation ==
Line 104 ⟶ 99:
|
|}
 
=== Converting DTIM time to normal time ===
The field consists of two values (v[0] and v[1]) separated with a space (0x20). Sample code:
<syntaxhighlight lang="c">
// time in seconds - "concatenate" date & time elements with a decimal point delimiter
TimeInSeconds = (v[0] * (2^32) + v[1]) * 10^(-7);
 
// shift basis from Jan 1, 1601 to Unix epoch Jan 1, 1970 (369 years & leap days)
UnixTimeStamp = TimeInSeconds - 134774 * 24 * 3600;
</syntaxhighlight>
 
== Some common RIFF file types ==
Line 118 ⟶ 123:
== See also ==
* [[Interchange File Format|IFF]] (the [[big-endian]] format from which RIFF derives)
* [[Audio Interchange File Format|AIFF]]
* [[Broadcast Wave Format|BWF]] Broadcast Wave Format
* [[Type–length–value|TLV]] (the generic format that RIFF is an example of)