Remove trailing whitespace.
[dragonfly.git] / contrib / file-4 / magic / Magdir / animation
1
2 #------------------------------------------------------------------------------
3 # animation:  file(1) magic for animation/movie formats
4 #
5 # animation formats
6 # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
7 # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
8
9 # SGI and Apple formats
10 0       string          MOVI            Silicon Graphics movie file
11 4       string          moov            Apple QuickTime
12 >12     string          mvhd            \b movie (fast start)
13 >12     string          mdra            \b URL
14 >12     string          cmov            \b movie (fast start, compressed header)
15 >12     string          rmra            \b multiple URLs
16 4       string          mdat            Apple QuickTime movie (unoptimized)
17 4       string          wide            Apple QuickTime movie (unoptimized)
18 4       string          skip            Apple QuickTime movie (modified)
19 4       string          free            Apple QuickTime movie (modified)
20 4       string          idsc            Apple QuickTime image (fast start)
21 4       string          idat            Apple QuickTime image (unoptimized)
22 4       string          pckg            Apple QuickTime compressed archive
23 4       string/B        jP              JPEG 2000 image
24 4       string          ftyp            ISO Media
25 >8      string          isom            \b, MPEG v4 system, version 1
26 >8      string          iso2            \b, MPEG v4 system, part 12 revision
27 >8      string          mp41            \b, MPEG v4 system, version 1
28 >8      string          mp42            \b, MPEG v4 system, version 2
29 >8      string          mp7t            \b, MPEG v4 system, MPEG v7 XML
30 >8      string          mp7b            \b, MPEG v4 system, MPEG v7 binary XML
31 >8      string/B        jp2             \b, JPEG 2000
32 >8      string          3gp             \b, MPEG v4 system, 3GPP
33 >>11    byte            4               \b v4 (H.263/AMR GSM 6.10)
34 >>11    byte            5               \b v5 (H.263/AMR GSM 6.10)
35 >>11    byte            6               \b v6 (ITU H.264/AMR GSM 6.10)
36 >8      string          mmp4            \b, MPEG v4 system, 3GPP Mobile
37 >8      string          avc1            \b, MPEG v4 system, 3GPP JVT AVC
38 >8      string/B        M4A             \b, MPEG v4 system, iTunes AAC-LC
39 >8      string/B        M4P             \b, MPEG v4 system, iTunes AES encrypted
40 >8      string/B        M4B             \b, MPEG v4 system, iTunes bookmarked
41 >8      string/B        qt              \b, Apple QuickTime movie
42
43 # MPEG sequences
44 # Scans for all common MPEG header start codes
45 0        belong             0x00000001     JVT NAL sequence
46 >4       byte&0x1F          0x07           \b, H.264 video
47 >>5      byte               66             \b, baseline
48 >>5      byte               77             \b, main
49 >>5      byte               88             \b, extended
50 >>7      byte               x              \b @ L %u
51 0        belong&0xFFFFFF00  0x00000100     MPEG sequence
52 >3       byte               0xBA
53 >>4      byte               &0x40          \b, v2, program multiplex
54 >>4      byte               ^0x40          \b, v1, system multiplex
55 >3       byte               0xBB           \b, v1/2, multiplex (missing pack header)
56 >3       byte&0x1F          0x07           \b, H.264 video
57 >>4      byte               66             \b, baseline
58 >>4      byte               77             \b, main
59 >>4      byte               88             \b, extended
60 >>6      byte               x              \b @ L %u
61 >3       byte               0xB0           \b, v4
62 >>5      belong             0x000001B5
63 >>>9     byte               &0x80
64 >>>>10   byte&0xF0          16             \b, video
65 >>>>10   byte&0xF0          32             \b, still texture
66 >>>>10   byte&0xF0          48             \b, mesh
67 >>>>10   byte&0xF0          64             \b, face
68 >>>9     byte&0xF8          8              \b, video
69 >>>9     byte&0xF8          16             \b, still texture
70 >>>9     byte&0xF8          24             \b, mesh
71 >>>9     byte&0xF8          32             \b, face
72 >>4      byte               1              \b, simple @ L1
73 >>4      byte               2              \b, simple @ L2
74 >>4      byte               3              \b, simple @ L3
75 >>4      byte               4              \b, simple @ L0
76 >>4      byte               17             \b, simple scalable @ L1
77 >>4      byte               18             \b, simple scalable @ L2
78 >>4      byte               33             \b, core @ L1
79 >>4      byte               34             \b, core @ L2
80 >>4      byte               50             \b, main @ L2
81 >>4      byte               51             \b, main @ L3
82 >>4      byte               53             \b, main @ L4
83 >>4      byte               66             \b, n-bit @ L2
84 >>4      byte               81             \b, scalable texture @ L1
85 >>4      byte               97             \b, simple face animation @ L1
86 >>4      byte               98             \b, simple face animation @ L2
87 >>4      byte               99             \b, simple face basic animation @ L1
88 >>4      byte               100            \b, simple face basic animation @ L2
89 >>4      byte               113            \b, basic animation text @ L1
90 >>4      byte               114            \b, basic animation text @ L2
91 >>4      byte               129            \b, hybrid @ L1
92 >>4      byte               130            \b, hybrid @ L2
93 >>4      byte               145            \b, advanced RT simple @ L!
94 >>4      byte               146            \b, advanced RT simple @ L2
95 >>4      byte               147            \b, advanced RT simple @ L3
96 >>4      byte               148            \b, advanced RT simple @ L4
97 >>4      byte               161            \b, core scalable @ L1
98 >>4      byte               162            \b, core scalable @ L2
99 >>4      byte               163            \b, core scalable @ L3
100 >>4      byte               177            \b, advanced coding efficiency @ L1
101 >>4      byte               178            \b, advanced coding efficiency @ L2
102 >>4      byte               179            \b, advanced coding efficiency @ L3
103 >>4      byte               180            \b, advanced coding efficiency @ L4
104 >>4      byte               193            \b, advanced core @ L1
105 >>4      byte               194            \b, advanced core @ L2
106 >>4      byte               209            \b, advanced scalable texture @ L1
107 >>4      byte               210            \b, advanced scalable texture @ L2
108 >>4      byte               211            \b, advanced scalable texture @ L3
109 >>4      byte               225            \b, simple studio @ L1
110 >>4      byte               226            \b, simple studio @ L2
111 >>4      byte               227            \b, simple studio @ L3
112 >>4      byte               228            \b, simple studio @ L4
113 >>4      byte               229            \b, core studio @ L1
114 >>4      byte               230            \b, core studio @ L2
115 >>4      byte               231            \b, core studio @ L3
116 >>4      byte               232            \b, core studio @ L4
117 >>4      byte               240            \b, advanced simple @ L0
118 >>4      byte               241            \b, advanced simple @ L1
119 >>4      byte               242            \b, advanced simple @ L2
120 >>4      byte               243            \b, advanced simple @ L3
121 >>4      byte               244            \b, advanced simple @ L4
122 >>4      byte               245            \b, advanced simple @ L5
123 >>4      byte               247            \b, advanced simple @ L3b
124 >>4      byte               248            \b, FGS @ L0
125 >>4      byte               249            \b, FGS @ L1
126 >>4      byte               250            \b, FGS @ L2
127 >>4      byte               251            \b, FGS @ L3
128 >>4      byte               252            \b, FGS @ L4
129 >>4      byte               253            \b, FGS @ L5
130 >3       byte               0xB5           \b, v4
131 >>4      byte               &0x80
132 >>>5     byte&0xF0          16             \b, video (missing profile header)
133 >>>5     byte&0xF0          32             \b, still texture (missing profile header)
134 >>>5     byte&0xF0          48             \b, mesh (missing profile header)
135 >>>5     byte&0xF0          64             \b, face (missing profile header)
136 >>4      byte&0xF8          8              \b, video (missing profile header)
137 >>4      byte&0xF8          16             \b, still texture (missing profile header)
138 >>4      byte&0xF8          24             \b, mesh (missing profile header)
139 >>4      byte&0xF8          32             \b, face (missing profile header)
140 >3       byte               0xB3
141 >>12     belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
142 >>12     belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
143 >>12     belong             0x000001B5     \b, v2,
144 >>>16    byte&0x0F          1              \b HP
145 >>>16    byte&0x0F          2              \b Spt
146 >>>16    byte&0x0F          3              \b SNR
147 >>>16    byte&0x0F          4              \b MP
148 >>>16    byte&0x0F          5              \b SP
149 >>>17    byte&0xF0          64             \b@HL
150 >>>17    byte&0xF0          96             \b@H-14
151 >>>17    byte&0xF0          128            \b@ML
152 >>>17    byte&0xF0          160            \b@LL
153 >>>17    byte               &0x08          \b progressive
154 >>>17    byte               ^0x08          \b interlaced
155 >>>17    byte&0x06          2              \b Y'CbCr 4:2:0 video
156 >>>17    byte&0x06          4              \b Y'CbCr 4:2:2 video
157 >>>17    byte&0x06          6              \b Y'CbCr 4:4:4 video
158 >>11     byte               &0x02
159 >>>75    byte               &0x01
160 >>>>140  belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
161 >>>>140  belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
162 >>>>140  belong             0x000001B5     \b, v2,
163 >>>>>144 byte&0x0F          1              \b HP
164 >>>>>144 byte&0x0F          2              \b Spt
165 >>>>>144 byte&0x0F          3              \b SNR
166 >>>>>144 byte&0x0F          4              \b MP
167 >>>>>144 byte&0x0F          5              \b SP
168 >>>>>145 byte&0xF0          64             \b@HL
169 >>>>>145 byte&0xF0          96             \b@H-14
170 >>>>>145 byte&0xF0          128            \b@ML
171 >>>>>145 byte&0xF0          160            \b@LL
172 >>>>>145 byte               &0x08          \b progressive
173 >>>>>145 byte               ^0x08          \b interlaced
174 >>>>>145 byte&0x06          2              \b Y'CbCr 4:2:0 video
175 >>>>>145 byte&0x06          4              \b Y'CbCr 4:2:2 video
176 >>>>>145 byte&0x06          6              \b Y'CbCr 4:4:4 video
177 >>76    belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
178 >>76    belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
179 >>76    belong             0x000001B5     \b, v2,
180 >>>80   byte&0x0F          1              \b HP
181 >>>80   byte&0x0F          2              \b Spt
182 >>>80   byte&0x0F          3              \b SNR
183 >>>80   byte&0x0F          4              \b MP
184 >>>80   byte&0x0F          5              \b SP
185 >>>81   byte&0xF0          64             \b@HL
186 >>>81   byte&0xF0          96             \b@H-14
187 >>>81   byte&0xF0          128            \b@ML
188 >>>81   byte&0xF0          160            \b@LL
189 >>>81   byte               &0x08          \b progressive
190 >>>81   byte               ^0x08          \b interlaced
191 >>>81   byte&0x06          2              \b Y'CbCr 4:2:0 video
192 >>>81   byte&0x06          4              \b Y'CbCr 4:2:2 video
193 >>>81   byte&0x06          6              \b Y'CbCr 4:4:4 video
194 >>4      belong&0xFFFFFF00  0x78043800     \b, HD-TV 1920P
195 >>>7     byte&0xF0          0x10           \b, 16:9
196 >>4      belong&0xFFFFFF00  0x50002D00     \b, SD-TV 1280I
197 >>>7     byte&0xF0          0x10           \b, 16:9
198 >>4      belong&0xFFFFFF00  0x30024000     \b, PAL Capture
199 >>>7     byte&0xF0          0x10           \b, 4:3
200 >>4      beshort&0xFFF0     0x2C00         \b, 4CIF
201 >>>5     beshort&0x0FFF     0x01E0         \b NTSC
202 >>>5     beshort&0x0FFF     0x0240         \b PAL
203 >>>7     byte&0xF0          0x20           \b, 4:3
204 >>>7     byte&0xF0          0x30           \b, 16:9
205 >>>7     byte&0xF0          0x40           \b, 11:5
206 >>>7     byte&0xF0          0x80           \b, PAL 4:3
207 >>>7     byte&0xF0          0xC0           \b, NTSC 4:3
208 >>4      belong&0xFFFFFF00  0x2801E000     \b, LD-TV 640P
209 >>>7     byte&0xF0          0x10           \b, 4:3
210 >>4      belong&0xFFFFFF00  0x1400F000     \b, 320x240
211 >>>7     byte&0xF0          0x10           \b, 4:3
212 >>4      belong&0xFFFFFF00  0x0F00A000     \b, 240x160
213 >>>7     byte&0xF0          0x10           \b, 4:3
214 >>4      belong&0xFFFFFF00  0x0A007800     \b, 160x120
215 >>>7     byte&0xF0          0x10           \b, 4:3
216 >>4      beshort&0xFFF0     0x1600         \b, CIF
217 >>>5     beshort&0x0FFF     0x00F0         \b NTSC
218 >>>5     beshort&0x0FFF     0x0120         \b PAL
219 >>>7     byte&0xF0          0x20           \b, 4:3
220 >>>7     byte&0xF0          0x30           \b, 16:9
221 >>>7     byte&0xF0          0x40           \b, 11:5
222 >>>7     byte&0xF0          0x80           \b, PAL 4:3
223 >>>7     byte&0xF0          0xC0           \b, NTSC 4:3
224 >>>5     beshort&0x0FFF     0x0240         \b PAL 625
225 >>>>7    byte&0xF0          0x20           \b, 4:3
226 >>>>7    byte&0xF0          0x30           \b, 16:9
227 >>>>7    byte&0xF0          0x40           \b, 11:5
228 >>4      beshort&0xFFF0     0x2D00         \b, CCIR/ITU
229 >>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
230 >>>5     beshort&0x0FFF     0x0240         \b PAL 625
231 >>>7     byte&0xF0          0x20           \b, 4:3
232 >>>7     byte&0xF0          0x30           \b, 16:9
233 >>>7     byte&0xF0          0x40           \b, 11:5
234 >>4      beshort&0xFFF0     0x1E00         \b, SVCD
235 >>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
236 >>>5     beshort&0x0FFF     0x0240         \b PAL 625
237 >>>7     byte&0xF0          0x20           \b, 4:3
238 >>>7     byte&0xF0          0x30           \b, 16:9
239 >>>7     byte&0xF0          0x40           \b, 11:5
240 >>7      byte&0x0F          1              \b, 23.976 fps
241 >>7      byte&0x0F          2              \b, 24 fps
242 >>7      byte&0x0F          3              \b, 25 fps
243 >>7      byte&0x0F          4              \b, 29.97 fps
244 >>7      byte&0x0F          5              \b, 30 fps
245 >>7      byte&0x0F          6              \b, 50 fps
246 >>7      byte&0x0F          7              \b, 59.94 fps
247 >>7      byte&0x0F          8              \b, 60 fps
248 >>11     byte               &0x04          \b, Constrained
249
250 # MPEG ADTS Audio (*.mpx/mxa/aac)
251 # from dreesen@math.fu-berlin.de
252 # modified to fully support MPEG ADTS
253
254 # MP3, M1A
255 0       beshort&0xFFFE  0xFFFA         MPEG ADTS, layer III, v1
256 # rates
257 >2      byte&0xF0       0x10           \b,  32 kBits
258 >2      byte&0xF0       0x20           \b,  40 kBits
259 >2      byte&0xF0       0x30           \b,  48 kBits
260 >2      byte&0xF0       0x40           \b,  56 kBits
261 >2      byte&0xF0       0x50           \b,  64 kBits
262 >2      byte&0xF0       0x60           \b,  80 kBits
263 >2      byte&0xF0       0x70           \b,  96 kBits
264 >2      byte&0xF0       0x80           \b, 112 kBits
265 >2      byte&0xF0       0x90           \b, 128 kBits
266 >2      byte&0xF0       0xA0           \b, 160 kBits
267 >2      byte&0xF0       0xB0           \b, 192 kBits
268 >2      byte&0xF0       0xC0           \b, 224 kBits
269 >2      byte&0xF0       0xD0           \b, 256 kBits
270 >2      byte&0xF0       0xE0           \b, 320 kBits
271 # timing
272 >2      byte&0x0C       0x00           \b, 44.1 kHz
273 >2      byte&0x0C       0x04           \b, 48 kHz
274 >2      byte&0x0C       0x08           \b, 32 kHz
275 # channels/options
276 >3      byte&0xC0       0x00           \b, Stereo
277 >3      byte&0xC0       0x40           \b, JntStereo
278 >3      byte&0xC0       0x80           \b, 2x Monaural
279 >3      byte&0xC0       0xC0           \b, Monaural
280 #>1     byte            ^0x01          \b, Data Verify
281 #>2     byte            &0x02          \b, Packet Pad
282 #>2     byte            &0x01          \b, Custom Flag
283 #>3     byte            &0x08          \b, Copyrighted
284 #>3     byte            &0x04          \b, Original Source
285 #>3     byte&0x03       1              \b, NR: 50/15 ms
286 #>3     byte&0x03       3              \b, NR: CCIT J.17
287
288 # MP2, M1A
289 0       beshort&0xFFFE  0xFFFC         MPEG ADTS, layer II, v1
290 # rates
291 >2      byte&0xF0       0x10           \b,  32 kBits
292 >2      byte&0xF0       0x20           \b,  48 kBits
293 >2      byte&0xF0       0x30           \b,  56 kBits
294 >2      byte&0xF0       0x40           \b,  64 kBits
295 >2      byte&0xF0       0x50           \b,  80 kBits
296 >2      byte&0xF0       0x60           \b,  96 kBits
297 >2      byte&0xF0       0x70           \b, 112 kBits
298 >2      byte&0xF0       0x80           \b, 128 kBits
299 >2      byte&0xF0       0x90           \b, 160 kBits
300 >2      byte&0xF0       0xA0           \b, 192 kBits
301 >2      byte&0xF0       0xB0           \b, 224 kBits
302 >2      byte&0xF0       0xC0           \b, 256 kBits
303 >2      byte&0xF0       0xD0           \b, 320 kBits
304 >2      byte&0xF0       0xE0           \b, 384 kBits
305 # timing
306 >2      byte&0x0C       0x00           \b, 44.1 kHz
307 >2      byte&0x0C       0x04           \b, 48 kHz
308 >2      byte&0x0C       0x08           \b, 32 kHz
309 # channels/options
310 >3      byte&0xC0       0x00           \b, Stereo
311 >3      byte&0xC0       0x40           \b, JntStereo
312 >3      byte&0xC0       0x80           \b, 2x Monaural
313 >3      byte&0xC0       0xC0           \b, Monaural
314 #>1     byte            ^0x01          \b, Data Verify
315 #>2     byte            &0x02          \b, Packet Pad
316 #>2     byte            &0x01          \b, Custom Flag
317 #>3     byte            &0x08          \b, Copyrighted
318 #>3     byte            &0x04          \b, Original Source
319 #>3     byte&0x03       1              \b, NR: 50/15 ms
320 #>3     byte&0x03       3              \b, NR: CCIT J.17
321
322 # MPA, M1A
323 0       beshort&0xFFFE  0xFFFE         MPEG ADTS, layer I, v1
324 # rate
325 >2      byte&0xF0       0x10           \b,  32 kBits
326 >2      byte&0xF0       0x20           \b,  64 kBits
327 >2      byte&0xF0       0x30           \b,  96 kBits
328 >2      byte&0xF0       0x40           \b, 128 kBits
329 >2      byte&0xF0       0x50           \b, 160 kBits
330 >2      byte&0xF0       0x60           \b, 192 kBits
331 >2      byte&0xF0       0x70           \b, 224 kBits
332 >2      byte&0xF0       0x80           \b, 256 kBits
333 >2      byte&0xF0       0x90           \b, 288 kBits
334 >2      byte&0xF0       0xA0           \b, 320 kBits
335 >2      byte&0xF0       0xB0           \b, 352 kBits
336 >2      byte&0xF0       0xC0           \b, 384 kBits
337 >2      byte&0xF0       0xD0           \b, 416 kBits
338 >2      byte&0xF0       0xE0           \b, 448 kBits
339 # timing
340 >2      byte&0x0C       0x00           \b, 44.1 kHz
341 >2      byte&0x0C       0x04           \b, 48 kHz
342 >2      byte&0x0C       0x08           \b, 32 kHz
343 # channels/options
344 >3      byte&0xC0       0x00           \b, Stereo
345 >3      byte&0xC0       0x40           \b, JntStereo
346 >3      byte&0xC0       0x80           \b, 2x Monaural
347 >3      byte&0xC0       0xC0           \b, Monaural
348 #>1     byte            ^0x01          \b, Data Verify
349 #>2     byte            &0x02          \b, Packet Pad
350 #>2     byte            &0x01          \b, Custom Flag
351 #>3     byte            &0x08          \b, Copyrighted
352 #>3     byte            &0x04          \b, Original Source
353 #>3     byte&0x03       1              \b, NR: 50/15 ms
354 #>3     byte&0x03       3              \b, NR: CCIT J.17
355
356 # MP3, M2A
357 0       beshort&0xFFFE  0xFFF2         MPEG ADTS, layer III, v2
358 # rate
359 >2      byte&0xF0       0x10           \b,   8 kBits
360 >2      byte&0xF0       0x20           \b,  16 kBits
361 >2      byte&0xF0       0x30           \b,  24 kBits
362 >2      byte&0xF0       0x40           \b,  32 kBits
363 >2      byte&0xF0       0x50           \b,  40 kBits
364 >2      byte&0xF0       0x60           \b,  48 kBits
365 >2      byte&0xF0       0x70           \b,  56 kBits
366 >2      byte&0xF0       0x80           \b,  64 kBits
367 >2      byte&0xF0       0x90           \b,  80 kBits
368 >2      byte&0xF0       0xA0           \b,  96 kBits
369 >2      byte&0xF0       0xB0           \b, 112 kBits
370 >2      byte&0xF0       0xC0           \b, 128 kBits
371 >2      byte&0xF0       0xD0           \b, 144 kBits
372 >2      byte&0xF0       0xE0           \b, 160 kBits
373 # timing
374 >2      byte&0x0C       0x00           \b, 22.05 kHz
375 >2      byte&0x0C       0x04           \b, 24 kHz
376 >2      byte&0x0C       0x08           \b, 16 kHz
377 # channels/options
378 >3      byte&0xC0       0x00           \b, Stereo
379 >3      byte&0xC0       0x40           \b, JntStereo
380 >3      byte&0xC0       0x80           \b, 2x Monaural
381 >3      byte&0xC0       0xC0           \b, Monaural
382 #>1     byte            ^0x01          \b, Data Verify
383 #>2     byte            &0x02          \b, Packet Pad
384 #>2     byte            &0x01          \b, Custom Flag
385 #>3     byte            &0x08          \b, Copyrighted
386 #>3     byte            &0x04          \b, Original Source
387 #>3     byte&0x03       1              \b, NR: 50/15 ms
388 #>3     byte&0x03       3              \b, NR: CCIT J.17
389
390 # MP2, M2A
391 0       beshort&0xFFFE  0xFFF4         MPEG ADTS, layer II, v2
392 # rate 
393 >2      byte&0xF0       0x10           \b,   8 kBits
394 >2      byte&0xF0       0x20           \b,  16 kBits 
395 >2      byte&0xF0       0x30           \b,  24 kBits
396 >2      byte&0xF0       0x40           \b,  32 kBits
397 >2      byte&0xF0       0x50           \b,  40 kBits
398 >2      byte&0xF0       0x60           \b,  48 kBits
399 >2      byte&0xF0       0x70           \b,  56 kBits
400 >2      byte&0xF0       0x80           \b,  64 kBits
401 >2      byte&0xF0       0x90           \b,  80 kBits
402 >2      byte&0xF0       0xA0           \b,  96 kBits
403 >2      byte&0xF0       0xB0           \b, 112 kBits
404 >2      byte&0xF0       0xC0           \b, 128 kBits
405 >2      byte&0xF0       0xD0           \b, 144 kBits
406 >2      byte&0xF0       0xE0           \b, 160 kBits
407 # timing
408 >2      byte&0x0C       0x00           \b, 22.05 kHz
409 >2      byte&0x0C       0x04           \b, 24 kHz
410 >2      byte&0x0C       0x08           \b, 16 kHz
411 # channels/options
412 >3      byte&0xC0       0x00           \b, Stereo
413 >3      byte&0xC0       0x40           \b, JntStereo
414 >3      byte&0xC0       0x80           \b, 2x Monaural
415 >3      byte&0xC0       0xC0           \b, Monaural
416 #>1     byte            ^0x01          \b, Data Verify
417 #>2     byte            &0x02          \b, Packet Pad
418 #>2     byte            &0x01          \b, Custom Flag
419 #>3     byte            &0x08          \b, Copyrighted
420 #>3     byte            &0x04          \b, Original Source
421 #>3     byte&0x03       1              \b, NR: 50/15 ms
422 #>3     byte&0x03       3              \b, NR: CCIT J.17
423
424 # MPA, M2A
425 0       beshort&0xFFFE  0xFFF6         MPEG ADTS, layer I, v2
426 # rate
427 >2      byte&0xF0       0x10           \b,  32 kBits
428 >2      byte&0xF0       0x20           \b,  48 kBits
429 >2      byte&0xF0       0x30           \b,  56 kBits
430 >2      byte&0xF0       0x40           \b,  64 kBits
431 >2      byte&0xF0       0x50           \b,  80 kBits
432 >2      byte&0xF0       0x60           \b,  96 kBits
433 >2      byte&0xF0       0x70           \b, 112 kBits
434 >2      byte&0xF0       0x80           \b, 128 kBits
435 >2      byte&0xF0       0x90           \b, 144 kBits
436 >2      byte&0xF0       0xA0           \b, 160 kBits
437 >2      byte&0xF0       0xB0           \b, 176 kBits
438 >2      byte&0xF0       0xC0           \b, 192 kBits
439 >2      byte&0xF0       0xD0           \b, 224 kBits
440 >2      byte&0xF0       0xE0           \b, 256 kBits
441 # timing
442 >2      byte&0x0C       0x00           \b, 22.05 kHz
443 >2      byte&0x0C       0x04           \b, 24 kHz
444 >2      byte&0x0C       0x08           \b, 16 kHz
445 # channels/options
446 >3      byte&0xC0       0x00           \b, Stereo
447 >3      byte&0xC0       0x40           \b, JntStereo
448 >3      byte&0xC0       0x80           \b, 2x Monaural
449 >3      byte&0xC0       0xC0           \b, Monaural
450 #>1     byte            ^0x01          \b, Data Verify
451 #>2     byte            &0x02          \b, Packet Pad
452 #>2     byte            &0x01          \b, Custom Flag
453 #>3     byte            &0x08          \b, Copyrighted
454 #>3     byte            &0x04          \b, Original Source
455 #>3     byte&0x03       1              \b, NR: 50/15 ms
456 #>3     byte&0x03       3              \b, NR: CCIT J.17
457
458 # MP3, M25A
459 0       beshort&0xFFFE  0xFFE2         MPEG ADTS, layer III,  v2.5
460 # rate  
461 >2      byte&0xF0       0x10           \b,   8 kBits
462 >2      byte&0xF0       0x20           \b,  16 kBits
463 >2      byte&0xF0       0x30           \b,  24 kBits
464 >2      byte&0xF0       0x40           \b,  32 kBits
465 >2      byte&0xF0       0x50           \b,  40 kBits
466 >2      byte&0xF0       0x60           \b,  48 kBits
467 >2      byte&0xF0       0x70           \b,  56 kBits
468 >2      byte&0xF0       0x80           \b,  64 kBits
469 >2      byte&0xF0       0x90           \b,  80 kBits
470 >2      byte&0xF0       0xA0           \b,  96 kBits
471 >2      byte&0xF0       0xB0           \b, 112 kBits
472 >2      byte&0xF0       0xC0           \b, 128 kBits
473 >2      byte&0xF0       0xD0           \b, 144 kBits
474 >2      byte&0xF0       0xE0           \b, 160 kBits
475 # timing
476 >2      byte&0x0C       0x00           \b, 11.025 kHz
477 >2      byte&0x0C       0x04           \b, 12 kHz
478 >2      byte&0x0C       0x08           \b, 8 kHz
479 # channels/options
480 >3      byte&0xC0       0x00           \b, Stereo
481 >3      byte&0xC0       0x40           \b, JntStereo
482 >3      byte&0xC0       0x80           \b, 2x Monaural
483 >3      byte&0xC0       0xC0           \b, Monaural
484 #>1     byte            ^0x01          \b, Data Verify
485 #>2     byte            &0x02          \b, Packet Pad
486 #>2     byte            &0x01          \b, Custom Flag
487 #>3     byte            &0x08          \b, Copyrighted
488 #>3     byte            &0x04          \b, Original Source
489 #>3     byte&0x03       1              \b, NR: 50/15 ms
490 #>3     byte&0x03       3              \b, NR: CCIT J.17
491
492 # AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
493
494 # Stored AAC streams (instead of the MP4 format)
495 0       string          ADIF           MPEG ADIF, AAC
496 >4      byte            &0x80
497 >>13    byte            &0x10          \b, VBR
498 >>13    byte            ^0x10          \b, CBR
499 >>16    byte&0x1E       0x02           \b, single stream
500 >>16    byte&0x1E       0x04           \b, 2 streams
501 >>16    byte&0x1E       0x06           \b, 3 streams
502 >>16    byte            &0x08          \b, 4 or more streams
503 >>16    byte            &0x10          \b, 8 or more streams
504 >>4    byte            &0x80          \b, Copyrighted
505 >>13   byte            &0x40          \b, Original Source
506 >>13   byte            &0x20          \b, Home Flag
507 >4      byte            ^0x80
508 >>4     byte            &0x10          \b, VBR
509 >>4     byte            ^0x10          \b, CBR
510 >>7     byte&0x1E       0x02           \b, single stream
511 >>7     byte&0x1E       0x04           \b, 2 streams
512 >>7     byte&0x1E       0x06           \b, 3 streams
513 >>7     byte            &0x08          \b, 4 or more streams
514 >>7     byte            &0x10          \b, 8 or more streams
515 >>4    byte            &0x40          \b, Original Stream(s)
516 >>4    byte            &0x20          \b, Home Source
517
518 # Live or stored single AAC stream (used with MPEG-2 systems)
519 0       beshort&0xFFF6  0xFFF0         MPEG ADTS, AAC
520 >1      byte            &0x08          \b, v2
521 >1      byte            ^0x08          \b, v4
522 # profile
523 >>2     byte            &0xC0          \b LTP
524 >2      byte&0xc0       0x00           \b Main
525 >2      byte&0xc0       0x40           \b LC
526 >2      byte&0xc0       0x80           \b SSR
527 # timing
528 >2      byte&0x3c       0x00           \b, 96 kHz
529 >2      byte&0x3c       0x04           \b, 88.2 kHz
530 >2      byte&0x3c       0x08           \b, 64 kHz
531 >2      byte&0x3c       0x0c           \b, 48 kHz
532 >2      byte&0x3c       0x10           \b, 44.1 kHz
533 >2      byte&0x3c       0x14           \b, 32 kHz
534 >2      byte&0x3c       0x18           \b, 24 kHz
535 >2      byte&0x3c       0x1c           \b, 22.05 kHz
536 >2      byte&0x3c       0x20           \b, 16 kHz
537 >2      byte&0x3c       0x24           \b, 12 kHz
538 >2      byte&0x3c       0x28           \b, 11.025 kHz
539 >2      byte&0x3c       0x2c           \b, 8 kHz
540 # channels
541 >2      beshort&0x01c0  0x0040         \b, monaural
542 >2      beshort&0x01c0  0x0080         \b, stereo
543 >2      beshort&0x01c0  0x00c0         \b, stereo + center
544 >2      beshort&0x01c0  0x0100         \b, stereo+center+LFE
545 >2      beshort&0x01c0  0x0140         \b, surround
546 >2      beshort&0x01c0  0x0180         \b, surround + LFE
547 >2      beshort         &0x01C0        \b, surround + side
548 #>1     byte            ^0x01           \b, Data Verify
549 #>2     byte            &0x02           \b, Custom Flag
550 #>3     byte            &0x20           \b, Original Stream
551 #>3     byte            &0x10           \b, Home Source
552 #>3     byte            &0x08           \b, Copyrighted
553
554 # Live MPEG-4 audio streams (instead of RTP FlexMux)
555 0       beshort&0xFFE0  0x56E0         MPEG-4 LOAS
556 #>1     beshort&0x1FFF  x              \b, %u byte packet
557 >3      byte&0xE0       0x40
558 >>4     byte&0x3C       0x04           \b, single stream
559 >>4     byte&0x3C       0x08           \b, 2 streams
560 >>4     byte&0x3C       0x0C           \b, 3 streams
561 >>4     byte            &0x08          \b, 4 or more streams
562 >>4     byte            &0x20          \b, 8 or more streams
563 >3      byte&0xC0       0
564 >>4     byte&0x78       0x08           \b, single stream
565 >>4     byte&0x78       0x10           \b, 2 streams
566 >>4     byte&0x78       0x18           \b, 3 streams
567 >>4     byte            &0x20          \b, 4 or more streams
568 >>4     byte            &0x40          \b, 8 or more streams
569 0       beshort         0x4DE1         MPEG-4 LO-EP audio stream
570
571 # FLI animation format
572 4       leshort         0xAF11                  FLI file
573 >6      leshort         x                       - %d frames,
574 >8      leshort         x                       width=%d pixels,
575 >10     leshort         x                       height=%d pixels,
576 >12     leshort         x                       depth=%d,
577 >16     leshort         x                       ticks/frame=%d
578 # FLC animation format
579 4       leshort         0xAF12                  FLC file
580 >6      leshort         x                       - %d frames
581 >8      leshort         x                       width=%d pixels,
582 >10     leshort         x                       height=%d pixels,
583 >12     leshort         x                       depth=%d,
584 >16     leshort         x                       ticks/frame=%d
585
586 # DL animation format
587 # XXX - collision with most `mips' magic
588 #
589 # I couldn't find a real magic number for these, however, this
590 # -appears- to work.  Note that it might catch other files, too, so be
591 # careful!
592 #
593 # Note that title and author appear in the two 20-byte chunks
594 # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
595 # 255 (hex FF)!  The DL format is really bad.
596 #
597 #0      byte    1       DL version 1, medium format (160x100, 4 images/screen)
598 #>42    byte    x       - %d screens,
599 #>43    byte    x       %d commands
600 #0      byte    2       DL version 2
601 #>1     byte    1       - large format (320x200,1 image/screen),
602 #>1     byte    2       - medium format (160x100,4 images/screen),
603 #>1     byte    >2      - unknown format,
604 #>42    byte    x       %d screens,
605 #>43    byte    x       %d commands
606 # Based on empirical evidence, DL version 3 have several nulls following the
607 # \003.  Most of them start with non-null values at hex offset 0x34 or so.
608 #0      string  \3\0\0\0\0\0\0\0\0\0\0\0        DL version 3
609
610 # iso 13818 transport stream
611 #
612 # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
613 # (the following is a little bit restrictive and works fine for a stream
614 #  that starts with PAT properly. it won't work for stream data, that is
615 #  cut from an input device data right in the middle, but this shouldn't
616 #  disturb)
617 # syncbyte      8 bit   0x47
618 # error_ind     1 bit   -
619 # payload_start 1 bit   1
620 # priority      1 bit   -
621 # PID          13 bit   0x0000
622 # scrambling    2 bit   -
623 # adaptfld_ctrl 2 bit   1 or 3
624 # conti_count   4 bit   0
625 0       belong&0xFF5FFF1F       0x47400010      MPEG transport stream data
626 >188    byte                    !0x47           CORRUPTED
627
628 # DIF digital video file format <mpruett@sgi.com>
629 0       belong&0xffffff00       0x1f070000      DIF
630 >4      byte                    &0x01           (DVCPRO) movie file
631 >4      byte                    ^0x01           (DV) movie file
632 >3      byte                    &0x80           (PAL)
633 >3      byte                    ^0x80           (NTSC)
634
635 # Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
636 0       belong                  0x3026b275      Microsoft ASF
637
638 # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
639 0       string                  \x8aMNG         MNG video data,
640 >4      belong                  !0x0d0a1a0a     CORRUPTED,
641 >4      belong                  0x0d0a1a0a
642 >>16    belong  x                               %ld x
643 >>20    belong  x                               %ld
644
645 # JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
646 0       string                  \x8bJNG         JNG video data,
647 >4      belong                  !0x0d0a1a0a     CORRUPTED,
648 >4      belong                  0x0d0a1a0a
649 >>16    belong  x                               %ld x
650 >>20    belong  x                               %ld
651
652 # Vivo video (Wolfram Kleff)
653 3       string          \x0D\x0AVersion:Vivo    Vivo video data
654
655 # VRML (Virtual Reality Modelling Language)
656 0       string/b        #VRML\ V1.0\ ascii      VRML 1 file
657 0       string/b        #VRML\ V2.0\ utf8       ISO/IEC 14772 VRML 97 file
658
659 #---------------------------------------------------------------------------
660 # HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
661 # From Mark Sheppard <msheppard@climax.co.uk>, 2002-10-03
662 #
663 0       string          HVQM4           %s
664 >6      string          >\0             v%s
665 >0      byte            x               GameCube movie,
666 >0x34   ubeshort        x               %d x
667 >0x36   ubeshort        x               %d,
668 >0x26   ubeshort        x               %dµs,
669 >0x42   ubeshort        0               no audio
670 >0x42   ubeshort        >0              %dHz audio
671
672 # From: "Stefan A. Haubenthal" <polluks@web.de>
673 0       string          DVDVIDEO-VTS    Video title set,
674 >0x21   byte            x               v%x
675 0       string          DVDVIDEO-VMG    Video manager,
676 >0x21   byte            x               v%x