]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/file/Magdir/animation
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / contrib / file / 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 # updated by Joerg Jenderek
324 # GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
325 0       beshort&0xFFFE          0xFFFE  
326 >2      ubyte&0xF0      >0x0F           
327 >>2     ubyte&0xF0      <0xE1           MPEG ADTS, layer I, v1
328 # rate
329 >>>2      byte&0xF0       0x10           \b,  32 kBits
330 >>>2      byte&0xF0       0x20           \b,  64 kBits
331 >>>2      byte&0xF0       0x30           \b,  96 kBits
332 >>>2      byte&0xF0       0x40           \b, 128 kBits
333 >>>2      byte&0xF0       0x50           \b, 160 kBits
334 >>>2      byte&0xF0       0x60           \b, 192 kBits
335 >>>2      byte&0xF0       0x70           \b, 224 kBits
336 >>>2      byte&0xF0       0x80           \b, 256 kBits
337 >>>2      byte&0xF0       0x90           \b, 288 kBits
338 >>>2      byte&0xF0       0xA0           \b, 320 kBits
339 >>>2      byte&0xF0       0xB0           \b, 352 kBits
340 >>>2      byte&0xF0       0xC0           \b, 384 kBits
341 >>>2      byte&0xF0       0xD0           \b, 416 kBits
342 >>>2      byte&0xF0       0xE0           \b, 448 kBits
343 # timing
344 >>>2      byte&0x0C       0x00           \b, 44.1 kHz
345 >>>2      byte&0x0C       0x04           \b, 48 kHz
346 >>>2      byte&0x0C       0x08           \b, 32 kHz
347 # channels/options
348 >>>3      byte&0xC0       0x00           \b, Stereo
349 >>>3      byte&0xC0       0x40           \b, JntStereo
350 >>>3      byte&0xC0       0x80           \b, 2x Monaural
351 >>>3      byte&0xC0       0xC0           \b, Monaural
352 #>1     byte            ^0x01          \b, Data Verify
353 #>2     byte            &0x02          \b, Packet Pad
354 #>2     byte            &0x01          \b, Custom Flag
355 #>3     byte            &0x08          \b, Copyrighted
356 #>3     byte            &0x04          \b, Original Source
357 #>3     byte&0x03       1              \b, NR: 50/15 ms
358 #>3     byte&0x03       3              \b, NR: CCIT J.17
359
360 # MP3, M2A
361 0       beshort&0xFFFE  0xFFF2         MPEG ADTS, layer III, v2
362 # rate
363 >2      byte&0xF0       0x10           \b,   8 kBits
364 >2      byte&0xF0       0x20           \b,  16 kBits
365 >2      byte&0xF0       0x30           \b,  24 kBits
366 >2      byte&0xF0       0x40           \b,  32 kBits
367 >2      byte&0xF0       0x50           \b,  40 kBits
368 >2      byte&0xF0       0x60           \b,  48 kBits
369 >2      byte&0xF0       0x70           \b,  56 kBits
370 >2      byte&0xF0       0x80           \b,  64 kBits
371 >2      byte&0xF0       0x90           \b,  80 kBits
372 >2      byte&0xF0       0xA0           \b,  96 kBits
373 >2      byte&0xF0       0xB0           \b, 112 kBits
374 >2      byte&0xF0       0xC0           \b, 128 kBits
375 >2      byte&0xF0       0xD0           \b, 144 kBits
376 >2      byte&0xF0       0xE0           \b, 160 kBits
377 # timing
378 >2      byte&0x0C       0x00           \b, 22.05 kHz
379 >2      byte&0x0C       0x04           \b, 24 kHz
380 >2      byte&0x0C       0x08           \b, 16 kHz
381 # channels/options
382 >3      byte&0xC0       0x00           \b, Stereo
383 >3      byte&0xC0       0x40           \b, JntStereo
384 >3      byte&0xC0       0x80           \b, 2x Monaural
385 >3      byte&0xC0       0xC0           \b, Monaural
386 #>1     byte            ^0x01          \b, Data Verify
387 #>2     byte            &0x02          \b, Packet Pad
388 #>2     byte            &0x01          \b, Custom Flag
389 #>3     byte            &0x08          \b, Copyrighted
390 #>3     byte            &0x04          \b, Original Source
391 #>3     byte&0x03       1              \b, NR: 50/15 ms
392 #>3     byte&0x03       3              \b, NR: CCIT J.17
393
394 # MP2, M2A
395 0       beshort&0xFFFE  0xFFF4         MPEG ADTS, layer II, v2
396 # rate 
397 >2      byte&0xF0       0x10           \b,   8 kBits
398 >2      byte&0xF0       0x20           \b,  16 kBits 
399 >2      byte&0xF0       0x30           \b,  24 kBits
400 >2      byte&0xF0       0x40           \b,  32 kBits
401 >2      byte&0xF0       0x50           \b,  40 kBits
402 >2      byte&0xF0       0x60           \b,  48 kBits
403 >2      byte&0xF0       0x70           \b,  56 kBits
404 >2      byte&0xF0       0x80           \b,  64 kBits
405 >2      byte&0xF0       0x90           \b,  80 kBits
406 >2      byte&0xF0       0xA0           \b,  96 kBits
407 >2      byte&0xF0       0xB0           \b, 112 kBits
408 >2      byte&0xF0       0xC0           \b, 128 kBits
409 >2      byte&0xF0       0xD0           \b, 144 kBits
410 >2      byte&0xF0       0xE0           \b, 160 kBits
411 # timing
412 >2      byte&0x0C       0x00           \b, 22.05 kHz
413 >2      byte&0x0C       0x04           \b, 24 kHz
414 >2      byte&0x0C       0x08           \b, 16 kHz
415 # channels/options
416 >3      byte&0xC0       0x00           \b, Stereo
417 >3      byte&0xC0       0x40           \b, JntStereo
418 >3      byte&0xC0       0x80           \b, 2x Monaural
419 >3      byte&0xC0       0xC0           \b, Monaural
420 #>1     byte            ^0x01          \b, Data Verify
421 #>2     byte            &0x02          \b, Packet Pad
422 #>2     byte            &0x01          \b, Custom Flag
423 #>3     byte            &0x08          \b, Copyrighted
424 #>3     byte            &0x04          \b, Original Source
425 #>3     byte&0x03       1              \b, NR: 50/15 ms
426 #>3     byte&0x03       3              \b, NR: CCIT J.17
427
428 # MPA, M2A
429 0       beshort&0xFFFE  0xFFF6         MPEG ADTS, layer I, v2
430 # rate
431 >2      byte&0xF0       0x10           \b,  32 kBits
432 >2      byte&0xF0       0x20           \b,  48 kBits
433 >2      byte&0xF0       0x30           \b,  56 kBits
434 >2      byte&0xF0       0x40           \b,  64 kBits
435 >2      byte&0xF0       0x50           \b,  80 kBits
436 >2      byte&0xF0       0x60           \b,  96 kBits
437 >2      byte&0xF0       0x70           \b, 112 kBits
438 >2      byte&0xF0       0x80           \b, 128 kBits
439 >2      byte&0xF0       0x90           \b, 144 kBits
440 >2      byte&0xF0       0xA0           \b, 160 kBits
441 >2      byte&0xF0       0xB0           \b, 176 kBits
442 >2      byte&0xF0       0xC0           \b, 192 kBits
443 >2      byte&0xF0       0xD0           \b, 224 kBits
444 >2      byte&0xF0       0xE0           \b, 256 kBits
445 # timing
446 >2      byte&0x0C       0x00           \b, 22.05 kHz
447 >2      byte&0x0C       0x04           \b, 24 kHz
448 >2      byte&0x0C       0x08           \b, 16 kHz
449 # channels/options
450 >3      byte&0xC0       0x00           \b, Stereo
451 >3      byte&0xC0       0x40           \b, JntStereo
452 >3      byte&0xC0       0x80           \b, 2x Monaural
453 >3      byte&0xC0       0xC0           \b, Monaural
454 #>1     byte            ^0x01          \b, Data Verify
455 #>2     byte            &0x02          \b, Packet Pad
456 #>2     byte            &0x01          \b, Custom Flag
457 #>3     byte            &0x08          \b, Copyrighted
458 #>3     byte            &0x04          \b, Original Source
459 #>3     byte&0x03       1              \b, NR: 50/15 ms
460 #>3     byte&0x03       3              \b, NR: CCIT J.17
461
462 # MP3, M25A
463 0       beshort&0xFFFE  0xFFE2         MPEG ADTS, layer III,  v2.5
464 # rate  
465 >2      byte&0xF0       0x10           \b,   8 kBits
466 >2      byte&0xF0       0x20           \b,  16 kBits
467 >2      byte&0xF0       0x30           \b,  24 kBits
468 >2      byte&0xF0       0x40           \b,  32 kBits
469 >2      byte&0xF0       0x50           \b,  40 kBits
470 >2      byte&0xF0       0x60           \b,  48 kBits
471 >2      byte&0xF0       0x70           \b,  56 kBits
472 >2      byte&0xF0       0x80           \b,  64 kBits
473 >2      byte&0xF0       0x90           \b,  80 kBits
474 >2      byte&0xF0       0xA0           \b,  96 kBits
475 >2      byte&0xF0       0xB0           \b, 112 kBits
476 >2      byte&0xF0       0xC0           \b, 128 kBits
477 >2      byte&0xF0       0xD0           \b, 144 kBits
478 >2      byte&0xF0       0xE0           \b, 160 kBits
479 # timing
480 >2      byte&0x0C       0x00           \b, 11.025 kHz
481 >2      byte&0x0C       0x04           \b, 12 kHz
482 >2      byte&0x0C       0x08           \b, 8 kHz
483 # channels/options
484 >3      byte&0xC0       0x00           \b, Stereo
485 >3      byte&0xC0       0x40           \b, JntStereo
486 >3      byte&0xC0       0x80           \b, 2x Monaural
487 >3      byte&0xC0       0xC0           \b, Monaural
488 #>1     byte            ^0x01          \b, Data Verify
489 #>2     byte            &0x02          \b, Packet Pad
490 #>2     byte            &0x01          \b, Custom Flag
491 #>3     byte            &0x08          \b, Copyrighted
492 #>3     byte            &0x04          \b, Original Source
493 #>3     byte&0x03       1              \b, NR: 50/15 ms
494 #>3     byte&0x03       3              \b, NR: CCIT J.17
495
496 # AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
497
498 # Stored AAC streams (instead of the MP4 format)
499 0       string          ADIF           MPEG ADIF, AAC
500 >4      byte            &0x80
501 >>13    byte            &0x10          \b, VBR
502 >>13    byte            ^0x10          \b, CBR
503 >>16    byte&0x1E       0x02           \b, single stream
504 >>16    byte&0x1E       0x04           \b, 2 streams
505 >>16    byte&0x1E       0x06           \b, 3 streams
506 >>16    byte            &0x08          \b, 4 or more streams
507 >>16    byte            &0x10          \b, 8 or more streams
508 >>4    byte            &0x80          \b, Copyrighted
509 >>13   byte            &0x40          \b, Original Source
510 >>13   byte            &0x20          \b, Home Flag
511 >4      byte            ^0x80
512 >>4     byte            &0x10          \b, VBR
513 >>4     byte            ^0x10          \b, CBR
514 >>7     byte&0x1E       0x02           \b, single stream
515 >>7     byte&0x1E       0x04           \b, 2 streams
516 >>7     byte&0x1E       0x06           \b, 3 streams
517 >>7     byte            &0x08          \b, 4 or more streams
518 >>7     byte            &0x10          \b, 8 or more streams
519 >>4    byte            &0x40          \b, Original Stream(s)
520 >>4    byte            &0x20          \b, Home Source
521
522 # Live or stored single AAC stream (used with MPEG-2 systems)
523 0       beshort&0xFFF6  0xFFF0         MPEG ADTS, AAC
524 >1      byte            &0x08          \b, v2
525 >1      byte            ^0x08          \b, v4
526 # profile
527 >>2     byte            &0xC0          \b LTP
528 >2      byte&0xc0       0x00           \b Main
529 >2      byte&0xc0       0x40           \b LC
530 >2      byte&0xc0       0x80           \b SSR
531 # timing
532 >2      byte&0x3c       0x00           \b, 96 kHz
533 >2      byte&0x3c       0x04           \b, 88.2 kHz
534 >2      byte&0x3c       0x08           \b, 64 kHz
535 >2      byte&0x3c       0x0c           \b, 48 kHz
536 >2      byte&0x3c       0x10           \b, 44.1 kHz
537 >2      byte&0x3c       0x14           \b, 32 kHz
538 >2      byte&0x3c       0x18           \b, 24 kHz
539 >2      byte&0x3c       0x1c           \b, 22.05 kHz
540 >2      byte&0x3c       0x20           \b, 16 kHz
541 >2      byte&0x3c       0x24           \b, 12 kHz
542 >2      byte&0x3c       0x28           \b, 11.025 kHz
543 >2      byte&0x3c       0x2c           \b, 8 kHz
544 # channels
545 >2      beshort&0x01c0  0x0040         \b, monaural
546 >2      beshort&0x01c0  0x0080         \b, stereo
547 >2      beshort&0x01c0  0x00c0         \b, stereo + center
548 >2      beshort&0x01c0  0x0100         \b, stereo+center+LFE
549 >2      beshort&0x01c0  0x0140         \b, surround
550 >2      beshort&0x01c0  0x0180         \b, surround + LFE
551 >2      beshort         &0x01C0        \b, surround + side
552 #>1     byte            ^0x01           \b, Data Verify
553 #>2     byte            &0x02           \b, Custom Flag
554 #>3     byte            &0x20           \b, Original Stream
555 #>3     byte            &0x10           \b, Home Source
556 #>3     byte            &0x08           \b, Copyrighted
557
558 # Live MPEG-4 audio streams (instead of RTP FlexMux)
559 0       beshort&0xFFE0  0x56E0         MPEG-4 LOAS
560 #>1     beshort&0x1FFF  x              \b, %u byte packet
561 >3      byte&0xE0       0x40
562 >>4     byte&0x3C       0x04           \b, single stream
563 >>4     byte&0x3C       0x08           \b, 2 streams
564 >>4     byte&0x3C       0x0C           \b, 3 streams
565 >>4     byte            &0x08          \b, 4 or more streams
566 >>4     byte            &0x20          \b, 8 or more streams
567 >3      byte&0xC0       0
568 >>4     byte&0x78       0x08           \b, single stream
569 >>4     byte&0x78       0x10           \b, 2 streams
570 >>4     byte&0x78       0x18           \b, 3 streams
571 >>4     byte            &0x20          \b, 4 or more streams
572 >>4     byte            &0x40          \b, 8 or more streams
573 0       beshort         0x4DE1         MPEG-4 LO-EP audio stream
574
575 # FLI animation format
576 4       leshort         0xAF11                  FLI file
577 >6      leshort         x                       - %d frames,
578 >8      leshort         x                       width=%d pixels,
579 >10     leshort         x                       height=%d pixels,
580 >12     leshort         x                       depth=%d,
581 >16     leshort         x                       ticks/frame=%d
582 # FLC animation format
583 4       leshort         0xAF12                  FLC file
584 >6      leshort         x                       - %d frames
585 >8      leshort         x                       width=%d pixels,
586 >10     leshort         x                       height=%d pixels,
587 >12     leshort         x                       depth=%d,
588 >16     leshort         x                       ticks/frame=%d
589
590 # DL animation format
591 # XXX - collision with most `mips' magic
592 #
593 # I couldn't find a real magic number for these, however, this
594 # -appears- to work.  Note that it might catch other files, too, so be
595 # careful!
596 #
597 # Note that title and author appear in the two 20-byte chunks
598 # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
599 # 255 (hex FF)!  The DL format is really bad.
600 #
601 #0      byte    1       DL version 1, medium format (160x100, 4 images/screen)
602 #>42    byte    x       - %d screens,
603 #>43    byte    x       %d commands
604 #0      byte    2       DL version 2
605 #>1     byte    1       - large format (320x200,1 image/screen),
606 #>1     byte    2       - medium format (160x100,4 images/screen),
607 #>1     byte    >2      - unknown format,
608 #>42    byte    x       %d screens,
609 #>43    byte    x       %d commands
610 # Based on empirical evidence, DL version 3 have several nulls following the
611 # \003.  Most of them start with non-null values at hex offset 0x34 or so.
612 #0      string  \3\0\0\0\0\0\0\0\0\0\0\0        DL version 3
613
614 # iso 13818 transport stream
615 #
616 # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
617 # (the following is a little bit restrictive and works fine for a stream
618 #  that starts with PAT properly. it won't work for stream data, that is
619 #  cut from an input device data right in the middle, but this shouldn't
620 #  disturb)
621 # syncbyte      8 bit   0x47
622 # error_ind     1 bit   -
623 # payload_start 1 bit   1
624 # priority      1 bit   -
625 # PID          13 bit   0x0000
626 # scrambling    2 bit   -
627 # adaptfld_ctrl 2 bit   1 or 3
628 # conti_count   4 bit   0
629 0       belong&0xFF5FFF1F       0x47400010      MPEG transport stream data
630 >188    byte                    !0x47           CORRUPTED
631
632 # DIF digital video file format <mpruett@sgi.com>
633 0       belong&0xffffff00       0x1f070000      DIF
634 >4      byte                    &0x01           (DVCPRO) movie file
635 >4      byte                    ^0x01           (DV) movie file
636 >3      byte                    &0x80           (PAL)
637 >3      byte                    ^0x80           (NTSC)
638
639 # Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
640 0       belong                  0x3026b275      Microsoft ASF
641
642 # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
643 0       string                  \x8aMNG         MNG video data,
644 >4      belong                  !0x0d0a1a0a     CORRUPTED,
645 >4      belong                  0x0d0a1a0a
646 >>16    belong  x                               %ld x
647 >>20    belong  x                               %ld
648
649 # JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
650 0       string                  \x8bJNG         JNG video data,
651 >4      belong                  !0x0d0a1a0a     CORRUPTED,
652 >4      belong                  0x0d0a1a0a
653 >>16    belong  x                               %ld x
654 >>20    belong  x                               %ld
655
656 # Vivo video (Wolfram Kleff)
657 3       string          \x0D\x0AVersion:Vivo    Vivo video data
658
659 # VRML (Virtual Reality Modelling Language)
660 0       string/b        #VRML\ V1.0\ ascii      VRML 1 file
661 0       string/b        #VRML\ V2.0\ utf8       ISO/IEC 14772 VRML 97 file
662
663 #---------------------------------------------------------------------------
664 # HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
665 # From Mark Sheppard <msheppard@climax.co.uk>, 2002-10-03
666 #
667 0       string          HVQM4           %s
668 >6      string          >\0             v%s
669 >0      byte            x               GameCube movie,
670 >0x34   ubeshort        x               %d x
671 >0x36   ubeshort        x               %d,
672 >0x26   ubeshort        x               %dµs,
673 >0x42   ubeshort        0               no audio
674 >0x42   ubeshort        >0              %dHz audio
675
676 # From: "Stefan A. Haubenthal" <polluks@web.de>
677 0       string          DVDVIDEO-VTS    Video title set,
678 >0x21   byte            x               v%x
679 0       string          DVDVIDEO-VMG    Video manager,
680 >0x21   byte            x               v%x
681
682 # From: Behan Webster <behanw@websterwood.com>
683 # NuppelVideo used by Mythtv (*.nuv)
684 0       regex           NuppelVideo|MythTVVideo MythTV NuppelVideo
685 >12     string          x               v%s
686 >20     lelong          x               (%d
687 >24     lelong          x               \bx%d),
688 >36     string          P               \bprogressive,
689 >36     string          I               \binterlaced,
690 >40     ledouble        x               \baspect:%.2f,
691 >48     ledouble        x               \bfps:%.2f