|
7 | 7 | * Copyright(c) 2020 Google Inc. |
8 | 8 | */ |
9 | 9 |
|
10 | | -// There are basically two major "container" families for modern audio-visual formats: |
11 | | -// 1) the ISO-BMFF family (MP4, HEVC, AVIF, etc) |
12 | | -// 2) the Matroska family (MKV, WebM, WebP) |
| 10 | +// A Container Format is a file that embeds multiple data streams into a single file. |
| 11 | +// Relevant examples: |
| 12 | +// 1) the ISO-BMFF family (MP4, HEVC, AVIF, MOV/QT, etc) |
| 13 | +// 2) the Matroska family (MKV, WebM) |
| 14 | +// 3) the RIFF family (WAV, AVI, WebP) |
| 15 | +// 4) the OGG family (OGV, OPUS) |
| 16 | +// 5) the ZIP family (ZIP, JAR, CBZ, EPUB, ODF, OOXML) |
13 | 17 |
|
14 | 18 | // The ISO-BMFF container needs special processing because of its "compatible brands" array :( |
15 | 19 | // The Matroska container needs special processing because the sub-type can appear anywhere :( |
| 20 | +// The OGG container needs special processing to determine what kind of streams are present :( |
| 21 | +// The ZIP container needs special processing to determine what files are present inside it :( |
16 | 22 |
|
17 | 23 | // NOTE: Because the ICO format also starts with a couple zero bytes, this tree will rely on the |
18 | 24 | // File Type box never going beyond 255 bytes in length which, seems unlikely according to |
@@ -58,6 +64,8 @@ const fileSignatures = { |
58 | 64 | [0xFF, 0xF2], |
59 | 65 | [0x49, 0x44, 0x33], // 'ID3' |
60 | 66 | ], |
| 67 | + 'audio/wav': [[0x52, 0x49, 0x46, 0x46, '??', '??', '??', '??', 0x57, 0x41, 0x56, 0x45]], // 'RIFF....WAVE' |
| 68 | + 'video/avi': [[0x52, 0x49, 0x46, 0x46, '??', '??', '??', '??', 0x41, 0x56, 0x49, 0x20]], // 'RIFF....AVI ' |
61 | 69 | }; |
62 | 70 |
|
63 | 71 | // TODO: Eventually add support for various container formats so that: |
|
0 commit comments