xref: /minix/external/bsd/file/dist/magic/magdir/animation (revision 84d9c625)
1
2#------------------------------------------------------------------------------
3# $File: animation,v 1.48 2013/03/09 22:36:00 christos Exp $
4# animation:  file(1) magic for animation/movie formats
5#
6# animation formats
7# MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
8# FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
9
10# SGI and Apple formats
110	string		MOVI		Silicon Graphics movie file
12!:mime	video/x-sgi-movie
134       string          moov            Apple QuickTime
14!:mime	video/quicktime
15>12     string          mvhd            \b movie (fast start)
16>12     string          mdra            \b URL
17>12     string          cmov            \b movie (fast start, compressed header)
18>12     string          rmra            \b multiple URLs
194       string          mdat            Apple QuickTime movie (unoptimized)
20!:mime	video/quicktime
21#4       string          wide            Apple QuickTime movie (unoptimized)
22#!:mime	video/quicktime
23#4       string          skip            Apple QuickTime movie (modified)
24#!:mime	video/quicktime
25#4       string          free            Apple QuickTime movie (modified)
26#!:mime	video/quicktime
274       string          idsc            Apple QuickTime image (fast start)
28!:mime	image/x-quicktime
29#4       string          idat            Apple QuickTime image (unoptimized)
30#!:mime	image/x-quicktime
314       string          pckg            Apple QuickTime compressed archive
32!:mime	application/x-quicktime-player
334	string/W	jP		JPEG 2000 image
34!:mime	image/jp2
354	string		ftyp		ISO Media
36>8	string		isom		\b, MPEG v4 system, version 1
37!:mime	video/mp4
38>8	string		iso2		\b, MPEG v4 system, part 12 revision
39>8	string		mp41		\b, MPEG v4 system, version 1
40!:mime	video/mp4
41>8	string		mp42		\b, MPEG v4 system, version 2
42!:mime	video/mp4
43>8	string		mp7t		\b, MPEG v4 system, MPEG v7 XML
44>8	string		mp7b		\b, MPEG v4 system, MPEG v7 binary XML
45>8	string/W	jp2		\b, JPEG 2000
46!:mime	image/jp2
47>8	string		3ge		\b, MPEG v4 system, 3GPP
48!:mime	video/3gpp
49>8	string		3gg		\b, MPEG v4 system, 3GPP
50!:mime	video/3gpp
51>8	string		3gp		\b, MPEG v4 system, 3GPP
52!:mime	video/3gpp
53>8	string		3gs		\b, MPEG v4 system, 3GPP
54!:mime	video/3gpp
55>8	string		3g2		\b, MPEG v4 system, 3GPP2
56!:mime	video/3gpp2
57>>11	byte		4		\b v4 (H.263/AMR GSM 6.10)
58>>11	byte		5		\b v5 (H.263/AMR GSM 6.10)
59>>11	byte		6		\b v6 (ITU H.264/AMR GSM 6.10)
60>8	string		mmp4		\b, MPEG v4 system, 3GPP Mobile
61!:mime	video/mp4
62>8	string		avc1		\b, MPEG v4 system, 3GPP JVT AVC
63!:mime	video/3gpp
64>8	string/W	M4A		\b, MPEG v4 system, iTunes AAC-LC
65!:mime	audio/mp4
66>8	string/W	M4V		\b, MPEG v4 system, iTunes AVC-LC
67!:mime	video/mp4
68>8	string/W	M4P		\b, MPEG v4 system, iTunes AES encrypted
69>8	string/W	M4B		\b, MPEG v4 system, iTunes bookmarked
70>8	string/W	qt		\b, Apple QuickTime movie
71!:mime	video/quicktime
72
73# MPEG sequences
74# Scans for all common MPEG header start codes
750	 belong		    0x00000001
76>4	 byte&0x1F	    0x07	   JVT NAL sequence, H.264 video
77>>5      byte               66             \b, baseline
78>>5      byte               77             \b, main
79>>5      byte               88             \b, extended
80>>7      byte               x              \b @ L %u
810        belong&0xFFFFFF00  0x00000100
82>3       byte               0xBA           MPEG sequence
83!:mime  video/mpeg
84>>4      byte               &0x40          \b, v2, program multiplex
85>>4      byte               ^0x40          \b, v1, system multiplex
86>3       byte               0xBB           MPEG sequence, v1/2, multiplex (missing pack header)
87>3       byte&0x1F          0x07           MPEG sequence, H.264 video
88>>4      byte               66             \b, baseline
89>>4      byte               77             \b, main
90>>4      byte               88             \b, extended
91>>6      byte               x              \b @ L %u
92# GRR too general as it catches also FoxPro Memo example NG.FPT
93>3       byte               0xB0           MPEG sequence, v4
94# TODO: maybe this extra line exclude FoxPro Memo example NG.FPT starting with 000001b0 00000100 00000000
95#>>4      byte               !0             MPEG sequence, v4
96!:mime  video/mpeg4-generic
97>>5      belong             0x000001B5
98>>>9     byte               &0x80
99>>>>10   byte&0xF0          16             \b, video
100>>>>10   byte&0xF0          32             \b, still texture
101>>>>10   byte&0xF0          48             \b, mesh
102>>>>10   byte&0xF0          64             \b, face
103>>>9     byte&0xF8          8              \b, video
104>>>9     byte&0xF8          16             \b, still texture
105>>>9     byte&0xF8          24             \b, mesh
106>>>9     byte&0xF8          32             \b, face
107>>4      byte               1              \b, simple @ L1
108>>4      byte               2              \b, simple @ L2
109>>4      byte               3              \b, simple @ L3
110>>4      byte               4              \b, simple @ L0
111>>4      byte               17             \b, simple scalable @ L1
112>>4      byte               18             \b, simple scalable @ L2
113>>4      byte               33             \b, core @ L1
114>>4      byte               34             \b, core @ L2
115>>4      byte               50             \b, main @ L2
116>>4      byte               51             \b, main @ L3
117>>4      byte               53             \b, main @ L4
118>>4      byte               66             \b, n-bit @ L2
119>>4      byte               81             \b, scalable texture @ L1
120>>4      byte               97             \b, simple face animation @ L1
121>>4      byte               98             \b, simple face animation @ L2
122>>4      byte               99             \b, simple face basic animation @ L1
123>>4      byte               100            \b, simple face basic animation @ L2
124>>4      byte               113            \b, basic animation text @ L1
125>>4      byte               114            \b, basic animation text @ L2
126>>4      byte               129            \b, hybrid @ L1
127>>4      byte               130            \b, hybrid @ L2
128>>4      byte               145            \b, advanced RT simple @ L!
129>>4      byte               146            \b, advanced RT simple @ L2
130>>4      byte               147            \b, advanced RT simple @ L3
131>>4      byte               148            \b, advanced RT simple @ L4
132>>4      byte               161            \b, core scalable @ L1
133>>4      byte               162            \b, core scalable @ L2
134>>4      byte               163            \b, core scalable @ L3
135>>4      byte               177            \b, advanced coding efficiency @ L1
136>>4      byte               178            \b, advanced coding efficiency @ L2
137>>4      byte               179            \b, advanced coding efficiency @ L3
138>>4      byte               180            \b, advanced coding efficiency @ L4
139>>4      byte               193            \b, advanced core @ L1
140>>4      byte               194            \b, advanced core @ L2
141>>4      byte               209            \b, advanced scalable texture @ L1
142>>4      byte               210            \b, advanced scalable texture @ L2
143>>4      byte               211            \b, advanced scalable texture @ L3
144>>4      byte               225            \b, simple studio @ L1
145>>4      byte               226            \b, simple studio @ L2
146>>4      byte               227            \b, simple studio @ L3
147>>4      byte               228            \b, simple studio @ L4
148>>4      byte               229            \b, core studio @ L1
149>>4      byte               230            \b, core studio @ L2
150>>4      byte               231            \b, core studio @ L3
151>>4      byte               232            \b, core studio @ L4
152>>4      byte               240            \b, advanced simple @ L0
153>>4      byte               241            \b, advanced simple @ L1
154>>4      byte               242            \b, advanced simple @ L2
155>>4      byte               243            \b, advanced simple @ L3
156>>4      byte               244            \b, advanced simple @ L4
157>>4      byte               245            \b, advanced simple @ L5
158>>4      byte               247            \b, advanced simple @ L3b
159>>4      byte               248            \b, FGS @ L0
160>>4      byte               249            \b, FGS @ L1
161>>4      byte               250            \b, FGS @ L2
162>>4      byte               251            \b, FGS @ L3
163>>4      byte               252            \b, FGS @ L4
164>>4      byte               253            \b, FGS @ L5
165>3       byte               0xB5           MPEG sequence, v4
166!:mime  video/mpeg4-generic
167>>4      byte               &0x80
168>>>5     byte&0xF0          16             \b, video (missing profile header)
169>>>5     byte&0xF0          32             \b, still texture (missing profile header)
170>>>5     byte&0xF0          48             \b, mesh (missing profile header)
171>>>5     byte&0xF0          64             \b, face (missing profile header)
172>>4      byte&0xF8          8              \b, video (missing profile header)
173>>4      byte&0xF8          16             \b, still texture (missing profile header)
174>>4      byte&0xF8          24             \b, mesh (missing profile header)
175>>4      byte&0xF8          32             \b, face (missing profile header)
176>3       byte               0xB3           MPEG sequence
177!:mime  video/mpeg
178>>12     belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
179>>12     belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
180>>12     belong             0x000001B5     \b, v2,
181>>>16    byte&0x0F          1              \b HP
182>>>16    byte&0x0F          2              \b Spt
183>>>16    byte&0x0F          3              \b SNR
184>>>16    byte&0x0F          4              \b MP
185>>>16    byte&0x0F          5              \b SP
186>>>17    byte&0xF0          64             \b@HL
187>>>17    byte&0xF0          96             \b@H-14
188>>>17    byte&0xF0          128            \b@ML
189>>>17    byte&0xF0          160            \b@LL
190>>>17    byte               &0x08          \b progressive
191>>>17    byte               ^0x08          \b interlaced
192>>>17    byte&0x06          2              \b Y'CbCr 4:2:0 video
193>>>17    byte&0x06          4              \b Y'CbCr 4:2:2 video
194>>>17    byte&0x06          6              \b Y'CbCr 4:4:4 video
195>>11     byte               &0x02
196>>>75    byte               &0x01
197>>>>140  belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
198>>>>140  belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
199>>>>140  belong             0x000001B5     \b, v2,
200>>>>>144 byte&0x0F          1              \b HP
201>>>>>144 byte&0x0F          2              \b Spt
202>>>>>144 byte&0x0F          3              \b SNR
203>>>>>144 byte&0x0F          4              \b MP
204>>>>>144 byte&0x0F          5              \b SP
205>>>>>145 byte&0xF0          64             \b@HL
206>>>>>145 byte&0xF0          96             \b@H-14
207>>>>>145 byte&0xF0          128            \b@ML
208>>>>>145 byte&0xF0          160            \b@LL
209>>>>>145 byte               &0x08          \b progressive
210>>>>>145 byte               ^0x08          \b interlaced
211>>>>>145 byte&0x06          2              \b Y'CbCr 4:2:0 video
212>>>>>145 byte&0x06          4              \b Y'CbCr 4:2:2 video
213>>>>>145 byte&0x06          6              \b Y'CbCr 4:4:4 video
214>>76    belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
215>>76    belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
216>>76    belong             0x000001B5     \b, v2,
217>>>80   byte&0x0F          1              \b HP
218>>>80   byte&0x0F          2              \b Spt
219>>>80   byte&0x0F          3              \b SNR
220>>>80   byte&0x0F          4              \b MP
221>>>80   byte&0x0F          5              \b SP
222>>>81   byte&0xF0          64             \b@HL
223>>>81   byte&0xF0          96             \b@H-14
224>>>81   byte&0xF0          128            \b@ML
225>>>81   byte&0xF0          160            \b@LL
226>>>81   byte               &0x08          \b progressive
227>>>81   byte               ^0x08          \b interlaced
228>>>81   byte&0x06          2              \b Y'CbCr 4:2:0 video
229>>>81   byte&0x06          4              \b Y'CbCr 4:2:2 video
230>>>81   byte&0x06          6              \b Y'CbCr 4:4:4 video
231>>4      belong&0xFFFFFF00  0x78043800     \b, HD-TV 1920P
232>>>7     byte&0xF0          0x10           \b, 16:9
233>>4      belong&0xFFFFFF00  0x50002D00     \b, SD-TV 1280I
234>>>7     byte&0xF0          0x10           \b, 16:9
235>>4      belong&0xFFFFFF00  0x30024000     \b, PAL Capture
236>>>7     byte&0xF0          0x10           \b, 4:3
237>>4      beshort&0xFFF0     0x2C00         \b, 4CIF
238>>>5     beshort&0x0FFF     0x01E0         \b NTSC
239>>>5     beshort&0x0FFF     0x0240         \b PAL
240>>>7     byte&0xF0          0x20           \b, 4:3
241>>>7     byte&0xF0          0x30           \b, 16:9
242>>>7     byte&0xF0          0x40           \b, 11:5
243>>>7     byte&0xF0          0x80           \b, PAL 4:3
244>>>7     byte&0xF0          0xC0           \b, NTSC 4:3
245>>4      belong&0xFFFFFF00  0x2801E000     \b, LD-TV 640P
246>>>7     byte&0xF0          0x10           \b, 4:3
247>>4      belong&0xFFFFFF00  0x1400F000     \b, 320x240
248>>>7     byte&0xF0          0x10           \b, 4:3
249>>4      belong&0xFFFFFF00  0x0F00A000     \b, 240x160
250>>>7     byte&0xF0          0x10           \b, 4:3
251>>4      belong&0xFFFFFF00  0x0A007800     \b, 160x120
252>>>7     byte&0xF0          0x10           \b, 4:3
253>>4      beshort&0xFFF0     0x1600         \b, CIF
254>>>5     beshort&0x0FFF     0x00F0         \b NTSC
255>>>5     beshort&0x0FFF     0x0120         \b PAL
256>>>7     byte&0xF0          0x20           \b, 4:3
257>>>7     byte&0xF0          0x30           \b, 16:9
258>>>7     byte&0xF0          0x40           \b, 11:5
259>>>7     byte&0xF0          0x80           \b, PAL 4:3
260>>>7     byte&0xF0          0xC0           \b, NTSC 4:3
261>>>5     beshort&0x0FFF     0x0240         \b PAL 625
262>>>>7    byte&0xF0          0x20           \b, 4:3
263>>>>7    byte&0xF0          0x30           \b, 16:9
264>>>>7    byte&0xF0          0x40           \b, 11:5
265>>4      beshort&0xFFF0     0x2D00         \b, CCIR/ITU
266>>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
267>>>5     beshort&0x0FFF     0x0240         \b PAL 625
268>>>7     byte&0xF0          0x20           \b, 4:3
269>>>7     byte&0xF0          0x30           \b, 16:9
270>>>7     byte&0xF0          0x40           \b, 11:5
271>>4      beshort&0xFFF0     0x1E00         \b, SVCD
272>>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
273>>>5     beshort&0x0FFF     0x0240         \b PAL 625
274>>>7     byte&0xF0          0x20           \b, 4:3
275>>>7     byte&0xF0          0x30           \b, 16:9
276>>>7     byte&0xF0          0x40           \b, 11:5
277>>7      byte&0x0F          1              \b, 23.976 fps
278>>7      byte&0x0F          2              \b, 24 fps
279>>7      byte&0x0F          3              \b, 25 fps
280>>7      byte&0x0F          4              \b, 29.97 fps
281>>7      byte&0x0F          5              \b, 30 fps
282>>7      byte&0x0F          6              \b, 50 fps
283>>7      byte&0x0F          7              \b, 59.94 fps
284>>7      byte&0x0F          8              \b, 60 fps
285>>11     byte               &0x04          \b, Constrained
286
287# MPEG ADTS Audio (*.mpx/mxa/aac)
288# from dreesen@math.fu-berlin.de
289# modified to fully support MPEG ADTS
290
291# MP3, M1A
292# modified by Joerg Jenderek
293# GRR the original test are too common for many DOS files
294# so don't accept as MP3 until we've tested the rate
2950       beshort&0xFFFE  0xFFFA
296# rates
297>2      byte&0xF0       0x10           MPEG ADTS, layer III, v1,  32 kbps
298!:mime	audio/mpeg
299>2      byte&0xF0       0x20           MPEG ADTS, layer III, v1,  40 kbps
300!:mime	audio/mpeg
301>2      byte&0xF0       0x30           MPEG ADTS, layer III, v1,  48 kbps
302!:mime	audio/mpeg
303>2      byte&0xF0       0x40           MPEG ADTS, layer III, v1,  56 kbps
304!:mime	audio/mpeg
305>2      byte&0xF0       0x50           MPEG ADTS, layer III, v1,  64 kbps
306!:mime	audio/mpeg
307>2      byte&0xF0       0x60           MPEG ADTS, layer III, v1,  80 kbps
308!:mime	audio/mpeg
309>2      byte&0xF0       0x70           MPEG ADTS, layer III, v1,  96 kbps
310!:mime	audio/mpeg
311>2      byte&0xF0       0x80           MPEG ADTS, layer III, v1, 112 kbps
312!:mime	audio/mpeg
313>2      byte&0xF0       0x90           MPEG ADTS, layer III, v1, 128 kbps
314!:mime	audio/mpeg
315>2      byte&0xF0       0xA0           MPEG ADTS, layer III, v1, 160 kbps
316!:mime	audio/mpeg
317>2      byte&0xF0       0xB0           MPEG ADTS, layer III, v1, 192 kbps
318!:mime	audio/mpeg
319>2      byte&0xF0       0xC0           MPEG ADTS, layer III, v1, 224 kbps
320!:mime	audio/mpeg
321>2      byte&0xF0       0xD0           MPEG ADTS, layer III, v1, 256 kbps
322!:mime	audio/mpeg
323>2      byte&0xF0       0xE0           MPEG ADTS, layer III, v1, 320 kbps
324!:mime	audio/mpeg
325# timing
326>2      byte&0x0C       0x00           \b, 44.1 kHz
327>2      byte&0x0C       0x04           \b, 48 kHz
328>2      byte&0x0C       0x08           \b, 32 kHz
329# channels/options
330>3      byte&0xC0       0x00           \b, Stereo
331>3      byte&0xC0       0x40           \b, JntStereo
332>3      byte&0xC0       0x80           \b, 2x Monaural
333>3      byte&0xC0       0xC0           \b, Monaural
334#>1     byte            ^0x01          \b, Data Verify
335#>2     byte            &0x02          \b, Packet Pad
336#>2     byte            &0x01          \b, Custom Flag
337#>3     byte            &0x08          \b, Copyrighted
338#>3     byte            &0x04          \b, Original Source
339#>3     byte&0x03       1              \b, NR: 50/15 ms
340#>3     byte&0x03       3              \b, NR: CCIT J.17
341
342# MP2, M1A
3430       beshort&0xFFFE  0xFFFC         MPEG ADTS, layer II, v1
344!:mime	audio/mpeg
345# rates
346>2      byte&0xF0       0x10           \b,  32 kbps
347>2      byte&0xF0       0x20           \b,  48 kbps
348>2      byte&0xF0       0x30           \b,  56 kbps
349>2      byte&0xF0       0x40           \b,  64 kbps
350>2      byte&0xF0       0x50           \b,  80 kbps
351>2      byte&0xF0       0x60           \b,  96 kbps
352>2      byte&0xF0       0x70           \b, 112 kbps
353>2      byte&0xF0       0x80           \b, 128 kbps
354>2      byte&0xF0       0x90           \b, 160 kbps
355>2      byte&0xF0       0xA0           \b, 192 kbps
356>2      byte&0xF0       0xB0           \b, 224 kbps
357>2      byte&0xF0       0xC0           \b, 256 kbps
358>2      byte&0xF0       0xD0           \b, 320 kbps
359>2      byte&0xF0       0xE0           \b, 384 kbps
360# timing
361>2      byte&0x0C       0x00           \b, 44.1 kHz
362>2      byte&0x0C       0x04           \b, 48 kHz
363>2      byte&0x0C       0x08           \b, 32 kHz
364# channels/options
365>3      byte&0xC0       0x00           \b, Stereo
366>3      byte&0xC0       0x40           \b, JntStereo
367>3      byte&0xC0       0x80           \b, 2x Monaural
368>3      byte&0xC0       0xC0           \b, Monaural
369#>1     byte            ^0x01          \b, Data Verify
370#>2     byte            &0x02          \b, Packet Pad
371#>2     byte            &0x01          \b, Custom Flag
372#>3     byte            &0x08          \b, Copyrighted
373#>3     byte            &0x04          \b, Original Source
374#>3     byte&0x03       1              \b, NR: 50/15 ms
375#>3     byte&0x03       3              \b, NR: CCIT J.17
376
377# MPA, M1A
378# updated by Joerg Jenderek
379# GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
380# GRR this test is still too general as it catches a BOM of UTF-16 files (0xFFFE)
381# FIXME: Almost all little endian UTF-16 text with BOM are clobbered by these entries
382#0	beshort&0xFFFE		0xFFFE
383#>2	ubyte&0xF0	>0x0F
384#>>2	ubyte&0xF0	<0xE1		MPEG ADTS, layer I, v1
385## rate
386#>>>2      byte&0xF0       0x10           \b,  32 kbps
387#>>>2      byte&0xF0       0x20           \b,  64 kbps
388#>>>2      byte&0xF0       0x30           \b,  96 kbps
389#>>>2      byte&0xF0       0x40           \b, 128 kbps
390#>>>2      byte&0xF0       0x50           \b, 160 kbps
391#>>>2      byte&0xF0       0x60           \b, 192 kbps
392#>>>2      byte&0xF0       0x70           \b, 224 kbps
393#>>>2      byte&0xF0       0x80           \b, 256 kbps
394#>>>2      byte&0xF0       0x90           \b, 288 kbps
395#>>>2      byte&0xF0       0xA0           \b, 320 kbps
396#>>>2      byte&0xF0       0xB0           \b, 352 kbps
397#>>>2      byte&0xF0       0xC0           \b, 384 kbps
398#>>>2      byte&0xF0       0xD0           \b, 416 kbps
399#>>>2      byte&0xF0       0xE0           \b, 448 kbps
400## timing
401#>>>2      byte&0x0C       0x00           \b, 44.1 kHz
402#>>>2      byte&0x0C       0x04           \b, 48 kHz
403#>>>2      byte&0x0C       0x08           \b, 32 kHz
404## channels/options
405#>>>3      byte&0xC0       0x00           \b, Stereo
406#>>>3      byte&0xC0       0x40           \b, JntStereo
407#>>>3      byte&0xC0       0x80           \b, 2x Monaural
408#>>>3      byte&0xC0       0xC0           \b, Monaural
409##>1     byte            ^0x01          \b, Data Verify
410##>2     byte            &0x02          \b, Packet Pad
411##>2     byte            &0x01          \b, Custom Flag
412##>3     byte            &0x08          \b, Copyrighted
413##>3     byte            &0x04          \b, Original Source
414##>3     byte&0x03       1              \b, NR: 50/15 ms
415##>3     byte&0x03       3              \b, NR: CCIT J.17
416
417# MP3, M2A
4180       beshort&0xFFFE  0xFFF2         MPEG ADTS, layer III, v2
419!:mime	audio/mpeg
420# rate
421>2      byte&0xF0       0x10           \b,   8 kbps
422>2      byte&0xF0       0x20           \b,  16 kbps
423>2      byte&0xF0       0x30           \b,  24 kbps
424>2      byte&0xF0       0x40           \b,  32 kbps
425>2      byte&0xF0       0x50           \b,  40 kbps
426>2      byte&0xF0       0x60           \b,  48 kbps
427>2      byte&0xF0       0x70           \b,  56 kbps
428>2      byte&0xF0       0x80           \b,  64 kbps
429>2      byte&0xF0       0x90           \b,  80 kbps
430>2      byte&0xF0       0xA0           \b,  96 kbps
431>2      byte&0xF0       0xB0           \b, 112 kbps
432>2      byte&0xF0       0xC0           \b, 128 kbps
433>2      byte&0xF0       0xD0           \b, 144 kbps
434>2      byte&0xF0       0xE0           \b, 160 kbps
435# timing
436>2      byte&0x0C       0x00           \b, 22.05 kHz
437>2      byte&0x0C       0x04           \b, 24 kHz
438>2      byte&0x0C       0x08           \b, 16 kHz
439# channels/options
440>3      byte&0xC0       0x00           \b, Stereo
441>3      byte&0xC0       0x40           \b, JntStereo
442>3      byte&0xC0       0x80           \b, 2x Monaural
443>3      byte&0xC0       0xC0           \b, Monaural
444#>1     byte            ^0x01          \b, Data Verify
445#>2     byte            &0x02          \b, Packet Pad
446#>2     byte            &0x01          \b, Custom Flag
447#>3     byte            &0x08          \b, Copyrighted
448#>3     byte            &0x04          \b, Original Source
449#>3     byte&0x03       1              \b, NR: 50/15 ms
450#>3     byte&0x03       3              \b, NR: CCIT J.17
451
452# MP2, M2A
4530       beshort&0xFFFE  0xFFF4         MPEG ADTS, layer II, v2
454# rate
455>2      byte&0xF0       0x10           \b,   8 kbps
456>2      byte&0xF0       0x20           \b,  16 kbps
457>2      byte&0xF0       0x30           \b,  24 kbps
458>2      byte&0xF0       0x40           \b,  32 kbps
459>2      byte&0xF0       0x50           \b,  40 kbps
460>2      byte&0xF0       0x60           \b,  48 kbps
461>2      byte&0xF0       0x70           \b,  56 kbps
462>2      byte&0xF0       0x80           \b,  64 kbps
463>2      byte&0xF0       0x90           \b,  80 kbps
464>2      byte&0xF0       0xA0           \b,  96 kbps
465>2      byte&0xF0       0xB0           \b, 112 kbps
466>2      byte&0xF0       0xC0           \b, 128 kbps
467>2      byte&0xF0       0xD0           \b, 144 kbps
468>2      byte&0xF0       0xE0           \b, 160 kbps
469# timing
470>2      byte&0x0C       0x00           \b, 22.05 kHz
471>2      byte&0x0C       0x04           \b, 24 kHz
472>2      byte&0x0C       0x08           \b, 16 kHz
473# channels/options
474>3      byte&0xC0       0x00           \b, Stereo
475>3      byte&0xC0       0x40           \b, JntStereo
476>3      byte&0xC0       0x80           \b, 2x Monaural
477>3      byte&0xC0       0xC0           \b, Monaural
478#>1     byte            ^0x01          \b, Data Verify
479#>2     byte            &0x02          \b, Packet Pad
480#>2     byte            &0x01          \b, Custom Flag
481#>3     byte            &0x08          \b, Copyrighted
482#>3     byte            &0x04          \b, Original Source
483#>3     byte&0x03       1              \b, NR: 50/15 ms
484#>3     byte&0x03       3              \b, NR: CCIT J.17
485
486# MPA, M2A
4870       beshort&0xFFFE  0xFFF6         MPEG ADTS, layer I, v2
488!:mime	audio/mpeg
489# rate
490>2      byte&0xF0       0x10           \b,  32 kbps
491>2      byte&0xF0       0x20           \b,  48 kbps
492>2      byte&0xF0       0x30           \b,  56 kbps
493>2      byte&0xF0       0x40           \b,  64 kbps
494>2      byte&0xF0       0x50           \b,  80 kbps
495>2      byte&0xF0       0x60           \b,  96 kbps
496>2      byte&0xF0       0x70           \b, 112 kbps
497>2      byte&0xF0       0x80           \b, 128 kbps
498>2      byte&0xF0       0x90           \b, 144 kbps
499>2      byte&0xF0       0xA0           \b, 160 kbps
500>2      byte&0xF0       0xB0           \b, 176 kbps
501>2      byte&0xF0       0xC0           \b, 192 kbps
502>2      byte&0xF0       0xD0           \b, 224 kbps
503>2      byte&0xF0       0xE0           \b, 256 kbps
504# timing
505>2      byte&0x0C       0x00           \b, 22.05 kHz
506>2      byte&0x0C       0x04           \b, 24 kHz
507>2      byte&0x0C       0x08           \b, 16 kHz
508# channels/options
509>3      byte&0xC0       0x00           \b, Stereo
510>3      byte&0xC0       0x40           \b, JntStereo
511>3      byte&0xC0       0x80           \b, 2x Monaural
512>3      byte&0xC0       0xC0           \b, Monaural
513#>1     byte            ^0x01          \b, Data Verify
514#>2     byte            &0x02          \b, Packet Pad
515#>2     byte            &0x01          \b, Custom Flag
516#>3     byte            &0x08          \b, Copyrighted
517#>3     byte            &0x04          \b, Original Source
518#>3     byte&0x03       1              \b, NR: 50/15 ms
519#>3     byte&0x03       3              \b, NR: CCIT J.17
520
521# MP3, M25A
5220       beshort&0xFFFE  0xFFE2         MPEG ADTS, layer III,  v2.5
523!:mime	audio/mpeg
524# rate
525>2      byte&0xF0       0x10           \b,   8 kbps
526>2      byte&0xF0       0x20           \b,  16 kbps
527>2      byte&0xF0       0x30           \b,  24 kbps
528>2      byte&0xF0       0x40           \b,  32 kbps
529>2      byte&0xF0       0x50           \b,  40 kbps
530>2      byte&0xF0       0x60           \b,  48 kbps
531>2      byte&0xF0       0x70           \b,  56 kbps
532>2      byte&0xF0       0x80           \b,  64 kbps
533>2      byte&0xF0       0x90           \b,  80 kbps
534>2      byte&0xF0       0xA0           \b,  96 kbps
535>2      byte&0xF0       0xB0           \b, 112 kbps
536>2      byte&0xF0       0xC0           \b, 128 kbps
537>2      byte&0xF0       0xD0           \b, 144 kbps
538>2      byte&0xF0       0xE0           \b, 160 kbps
539# timing
540>2      byte&0x0C       0x00           \b, 11.025 kHz
541>2      byte&0x0C       0x04           \b, 12 kHz
542>2      byte&0x0C       0x08           \b, 8 kHz
543# channels/options
544>3      byte&0xC0       0x00           \b, Stereo
545>3      byte&0xC0       0x40           \b, JntStereo
546>3      byte&0xC0       0x80           \b, 2x Monaural
547>3      byte&0xC0       0xC0           \b, Monaural
548#>1     byte            ^0x01          \b, Data Verify
549#>2     byte            &0x02          \b, Packet Pad
550#>2     byte            &0x01          \b, Custom Flag
551#>3     byte            &0x08          \b, Copyrighted
552#>3     byte            &0x04          \b, Original Source
553#>3     byte&0x03       1              \b, NR: 50/15 ms
554#>3     byte&0x03       3              \b, NR: CCIT J.17
555
556# AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
557
558# Stored AAC streams (instead of the MP4 format)
5590       string          ADIF           MPEG ADIF, AAC
560!:mime	audio/x-hx-aac-adif
561>4      byte            &0x80
562>>13    byte            &0x10          \b, VBR
563>>13    byte            ^0x10          \b, CBR
564>>16    byte&0x1E       0x02           \b, single stream
565>>16    byte&0x1E       0x04           \b, 2 streams
566>>16    byte&0x1E       0x06           \b, 3 streams
567>>16    byte            &0x08          \b, 4 or more streams
568>>16    byte            &0x10          \b, 8 or more streams
569>>4    byte            &0x80          \b, Copyrighted
570>>13   byte            &0x40          \b, Original Source
571>>13   byte            &0x20          \b, Home Flag
572>4      byte            ^0x80
573>>4     byte            &0x10          \b, VBR
574>>4     byte            ^0x10          \b, CBR
575>>7     byte&0x1E       0x02           \b, single stream
576>>7     byte&0x1E       0x04           \b, 2 streams
577>>7     byte&0x1E       0x06           \b, 3 streams
578>>7     byte            &0x08          \b, 4 or more streams
579>>7     byte            &0x10          \b, 8 or more streams
580>>4    byte            &0x40          \b, Original Stream(s)
581>>4    byte            &0x20          \b, Home Source
582
583# Live or stored single AAC stream (used with MPEG-2 systems)
5840       beshort&0xFFF6  0xFFF0         MPEG ADTS, AAC
585!:mime	audio/x-hx-aac-adts
586>1      byte            &0x08          \b, v2
587>1      byte            ^0x08          \b, v4
588# profile
589>>2     byte            &0xC0          \b LTP
590>2      byte&0xc0       0x00           \b Main
591>2      byte&0xc0       0x40           \b LC
592>2      byte&0xc0       0x80           \b SSR
593# timing
594>2      byte&0x3c       0x00           \b, 96 kHz
595>2      byte&0x3c       0x04           \b, 88.2 kHz
596>2      byte&0x3c       0x08           \b, 64 kHz
597>2      byte&0x3c       0x0c           \b, 48 kHz
598>2      byte&0x3c       0x10           \b, 44.1 kHz
599>2      byte&0x3c       0x14           \b, 32 kHz
600>2      byte&0x3c       0x18           \b, 24 kHz
601>2      byte&0x3c       0x1c           \b, 22.05 kHz
602>2      byte&0x3c       0x20           \b, 16 kHz
603>2      byte&0x3c       0x24           \b, 12 kHz
604>2      byte&0x3c       0x28           \b, 11.025 kHz
605>2      byte&0x3c       0x2c           \b, 8 kHz
606# channels
607>2      beshort&0x01c0  0x0040         \b, monaural
608>2      beshort&0x01c0  0x0080         \b, stereo
609>2      beshort&0x01c0  0x00c0         \b, stereo + center
610>2      beshort&0x01c0  0x0100         \b, stereo+center+LFE
611>2      beshort&0x01c0  0x0140         \b, surround
612>2      beshort&0x01c0  0x0180         \b, surround + LFE
613>2      beshort         &0x01C0        \b, surround + side
614#>1     byte            ^0x01           \b, Data Verify
615#>2     byte            &0x02           \b, Custom Flag
616#>3     byte            &0x20           \b, Original Stream
617#>3     byte            &0x10           \b, Home Source
618#>3     byte            &0x08           \b, Copyrighted
619
620# Live MPEG-4 audio streams (instead of RTP FlexMux)
6210       beshort&0xFFE0  0x56E0         MPEG-4 LOAS
622!:mime	audio/x-mp4a-latm
623#>1     beshort&0x1FFF  x              \b, %u byte packet
624>3      byte&0xE0       0x40
625>>4     byte&0x3C       0x04           \b, single stream
626>>4     byte&0x3C       0x08           \b, 2 streams
627>>4     byte&0x3C       0x0C           \b, 3 streams
628>>4     byte            &0x08          \b, 4 or more streams
629>>4     byte            &0x20          \b, 8 or more streams
630>3      byte&0xC0       0
631>>4     byte&0x78       0x08           \b, single stream
632>>4     byte&0x78       0x10           \b, 2 streams
633>>4     byte&0x78       0x18           \b, 3 streams
634>>4     byte            &0x20          \b, 4 or more streams
635>>4     byte            &0x40          \b, 8 or more streams
636# This magic isn't strong enough (matches plausible ISO-8859-1 text)
637#0       beshort         0x4DE1         MPEG-4 LO-EP audio stream
638#!:mime	audio/x-mp4a-latm
639
640# Summary: FLI animation format
641# Created by: Daniel Quinlan <quinlan@yggdrasil.com>
642# Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
6434	leshort		0xAF11
644# standard FLI always has 320x200 resolution and 8 bit color
645>8	leshort		320
646>>10	leshort		200
647>>>12	leshort		8			FLI animation, 320x200x8
648!:mime	video/x-fli
649>>>>6	leshort		x			\b, %d frames
650# frame speed is multiple of 1/70s
651>>>>16	leshort		x			\b, %d/70s per frame
652
653# Summary: FLC animation format
654# Created by: Daniel Quinlan <quinlan@yggdrasil.com>
655# Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
6564	leshort		0xAF12
657# standard FLC always use 8 bit color
658>12	leshort		8			FLC animation
659!:mime	video/x-flc
660>>8	leshort		x			\b, %d
661>>10	leshort		x			\bx%dx8
662>>6	uleshort	x			\b, %d frames
663>>16	uleshort	x			\b, %dms per frame
664
665# DL animation format
666# XXX - collision with most `mips' magic
667#
668# I couldn't find a real magic number for these, however, this
669# -appears- to work.  Note that it might catch other files, too, so be
670# careful!
671#
672# Note that title and author appear in the two 20-byte chunks
673# at decimal offsets 2 and 22, respectively, but they are XOR'ed with
674# 255 (hex FF)!  The DL format is really bad.
675#
676#0	byte	1	DL version 1, medium format (160x100, 4 images/screen)
677#!:mime	video/x-unknown
678#>42	byte	x	- %d screens,
679#>43	byte	x	%d commands
680#0	byte	2	DL version 2
681#!:mime	video/x-unknown
682#>1	byte	1	- large format (320x200,1 image/screen),
683#>1	byte	2	- medium format (160x100,4 images/screen),
684#>1	byte	>2	- unknown format,
685#>42	byte	x	%d screens,
686#>43	byte	x	%d commands
687# Based on empirical evidence, DL version 3 have several nulls following the
688# \003.  Most of them start with non-null values at hex offset 0x34 or so.
689#0	string	\3\0\0\0\0\0\0\0\0\0\0\0	DL version 3
690
691# iso 13818 transport stream
692#
693# from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
694# syncbyte      8 bit	0x47
695# error_ind     1 bit	-
696# payload_start 1 bit	1
697# priority      1 bit	-
698# PID          13 bit	0x0000
699# scrambling    2 bit	-
700# adaptfld_ctrl 2 bit	1 or 3
701# conti_count   4 bit	-
7020	belong&0xFF5FFF10	0x47400010
703>188	byte			0x47		MPEG transport stream data
704
705# DIF digital video file format <mpruett@sgi.com>
7060	belong&0xffffff00	0x1f070000      DIF
707>4	byte			&0x01		(DVCPRO) movie file
708>4	byte			^0x01		(DV) movie file
709>3	byte			&0x80		(PAL)
710>3	byte			^0x80		(NTSC)
711
712# Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
7130	belong			0x3026b275	Microsoft ASF
714!:mime  video/x-ms-asf
715
716# MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
7170	string			\x8aMNG		MNG video data,
718!:mime	video/x-mng
719>4	belong			!0x0d0a1a0a	CORRUPTED,
720>4	belong			0x0d0a1a0a
721>>16    belong	x				%ld x
722>>20    belong	x				%ld
723
724# JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
7250	string			\x8bJNG		JNG video data,
726!:mime	video/x-jng
727>4	belong			!0x0d0a1a0a	CORRUPTED,
728>4	belong			0x0d0a1a0a
729>>16    belong	x				%ld x
730>>20    belong	x				%ld
731
732# Vivo video (Wolfram Kleff)
7333	string		\x0D\x0AVersion:Vivo	Vivo video data
734
735# VRML (Virtual Reality Modelling Language)
7360       string/w        #VRML\ V1.0\ ascii	VRML 1 file
737!:mime	model/vrml
7380	string/w	#VRML\ V2.0\ utf8	ISO/IEC 14772 VRML 97 file
739!:mime	model/vrml
740
741# X3D (Extensible 3D) [http://www.web3d.org/specifications/x3d-3.0.dtd]
742# From Michel Briand <michelbriand@free.fr>
7430	string/t		\<?xml\ version="
744!:strength +1
745>20	search/1000/cw  \<!DOCTYPE\ X3D		X3D (Extensible 3D) model xml text
746!:mime model/x3d
747
748#---------------------------------------------------------------------------
749# HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
750# From Mark Sheppard <msheppard@climax.co.uk>, 2002-10-03
751#
7520	string		HVQM4		%s
753>6	string		>\0		v%s
754>0	byte		x		GameCube movie,
755>0x34	ubeshort	x		%d x
756>0x36	ubeshort	x		%d,
757>0x26	ubeshort	x		%dus,
758>0x42	ubeshort	0		no audio
759>0x42	ubeshort	>0		%dHz audio
760
761# From: "Stefan A. Haubenthal" <polluks@web.de>
7620	string		DVDVIDEO-VTS	Video title set,
763>0x21	byte		x		v%x
7640	string		DVDVIDEO-VMG	Video manager,
765>0x21	byte		x		v%x
766
767# From: Behan Webster <behanw@websterwood.com>
768# NuppelVideo used by Mythtv (*.nuv)
769# Note: there are two identical stanzas here differing only in the
770# initial string matched. It used to be done with a regex, but we're
771# trying to get rid of those.
7720	string		NuppelVideo	MythTV NuppelVideo
773>12	string		x		v%s
774>20	lelong		x		(%d
775>24	lelong		x		\bx%d),
776>36	string		P		\bprogressive,
777>36	string		I		\binterlaced,
778>40	ledouble	x		\baspect:%.2f,
779>48	ledouble	x		\bfps:%.2f
7800	string		MythTV		MythTV NuppelVideo
781>12	string		x		v%s
782>20	lelong		x		(%d
783>24	lelong		x		\bx%d),
784>36	string		P		\bprogressive,
785>36	string		I		\binterlaced,
786>40	ledouble	x		\baspect:%.2f,
787>48	ledouble	x		\bfps:%.2f
788
789#						MPEG file
790# MPEG sequences
791# FIXME: This section is from the old magic.mime file and needs integrating with the rest
7920       belong             0x000001BA
793>4      byte               &0x40
794!:mime	video/mp2p
795>4      byte               ^0x40
796!:mime	video/mpeg
7970       belong             0x000001BB
798!:mime	video/mpeg
7990       belong             0x000001B0
800!:mime	video/mp4v-es
8010       belong             0x000001B5
802!:mime	video/mp4v-es
8030       belong             0x000001B3
804!:mime	video/mpv
8050       belong&0xFF5FFF1F  0x47400010
806!:mime	video/mp2t
8070       belong             0x00000001
808>4      byte&0x1F	   0x07
809!:mime	video/h264
810
811# Type: Bink Video
812# Extension: .bik
813# URL:  http://wiki.multimedia.cx/index.php?title=Bink_Container
814# From: <hoehle@users.sourceforge.net>  2008-07-18
8150	string		BIK	Bink Video
816>3	regex		=[a-z]	rev.%s
817#>4	ulelong		x	size %d
818>20	ulelong		x	\b, %d
819>24	ulelong		x	\bx%d
820>8	ulelong		x	\b, %d frames
821>32	ulelong		x	at rate %d/
822>28	ulelong		>1	\b%d
823>40	ulelong		=0	\b, no audio
824>40	ulelong		!0	\b, %d audio track
825>>40	ulelong		!1	\bs
826# follow properties of the first audio track only
827>>48	uleshort	x	%dHz
828>>51	byte&0x20	0	mono
829>>51	byte&0x20	!0	stereo
830#>>51	byte&0x10	0	FFT
831#>>51	byte&0x10	!0	DCT
832
833# Type:	NUT Container
834# URL:	http://wiki.multimedia.cx/index.php?title=NUT
835# From:	Adam Buchbinder <adam.buchbinder@gmail.com>
8360	string	nut/multimedia\ container\0	NUT multimedia container
837
838# Type: Nullsoft Video (NSV)
839# URL:  http://wiki.multimedia.cx/index.php?title=Nullsoft_Video
840# From: Mike Melanson <mike@multimedia.cx>
8410	string	NSVf	Nullsoft Video
842
843# Type: REDCode Video
844# URL:  http://www.red.com/ ; http://wiki.multimedia.cx/index.php?title=REDCode
845# From: Mike Melanson <mike@multimedia.cx>
8464	string	RED1	REDCode Video
847
848# Type: MTV Multimedia File
849# URL:  http://wiki.multimedia.cx/index.php?title=MTV
850# From: Mike Melanson <mike@multimedia.cx>
8510	string	AMVS	MTV Multimedia File
852
853# Type: ARMovie
854# URL:  http://wiki.multimedia.cx/index.php?title=ARMovie
855# From: Mike Melanson <mike@multimedia.cx>
8560	string	ARMovie\012	ARMovie
857
858# Type: Interplay MVE Movie
859# URL:  http://wiki.multimedia.cx/index.php?title=Interplay_MVE
860# From: Mike Melanson <mike@multimedia.cx>
8610	string	Interplay\040MVE\040File\032	Interplay MVE Movie
862
863# Type: Windows Television DVR File
864# URL:  http://wiki.multimedia.cx/index.php?title=WTV
865# From: Mike Melanson <mike@mutlimedia.cx>
866# This takes the form of a Windows-style GUID
8670	bequad	0xB7D800203749DA11
868>8	bequad	0xA64E0007E95EAD8D	Windows Television DVR Media
869
870# Type: Sega FILM/CPK Multimedia
871# URL:  http://wiki.multimedia.cx/index.php?title=Sega_FILM
872# From: Mike Melanson <mike@multimedia.cx>
8730	string	FILM	Sega FILM/CPK Multimedia,
874>32	belong	x	%d x
875>28	belong	x	%d
876
877# Type: Nintendo THP Multimedia
878# URL:  http://wiki.multimedia.cx/index.php?title=THP
879# From: Mike Melanson <mike@multimedia.cx>
8800	string	THP\0	Nintendo THP Multimedia
881
882# Type: BBC Dirac Video
883# URL:  http://wiki.multimedia.cx/index.php?title=Dirac
884# From: Mike Melanson <mike@multimedia.cx>
8850	string	BBCD	BBC Dirac Video
886
887# Type: RAD Game Tools Smacker Multimedia
888# URL:  http://wiki.multimedia.cx/index.php?title=Smacker
889# From: Mike Melanson <mike@multimedia.cx>
8900	string	SMK	RAD Game Tools Smacker Multimedia
891>3	byte	x	version %c,
892>4	lelong	x	%d x
893>8	lelong	x	%d,
894>12	lelong	x	%d frames
895