2 #------------------------------------------------------------------------------
3 # animation: file(1) magic for animation/movie 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)
9 # MPEG animation format
10 0 belong 0x000001b3 MPEG video stream data
11 #>4 beshort&0xfff0 x (%d x
12 #>5 beshort&0x0fff x %d)
13 0 belong 0x000001ba MPEG system stream data
16 # from dreesen@math.fu-berlin.de
19 0 beshort&0xfffe =0xfffa \bMP3
20 >2 byte&0xf0 =0x10 \b, 32 kBits
21 >2 byte&0xf0 =0x20 \b, 40 kBits
22 >2 byte&0xf0 =0x30 \b, 48 kBits
23 >2 byte&0xf0 =0x40 \b, 56 kBits
24 >2 byte&0xf0 =0x50 \b, 64 kBits
25 >2 byte&0xf0 =0x60 \b, 80 kBits
26 >2 byte&0xf0 =0x70 \b, 96 kBits
27 >2 byte&0xf0 =0x80 \b, 112 kBits
28 >2 byte&0xf0 =0x90 \b, 128 kBits
29 >2 byte&0xf0 =0xA0 \b, 160 kBits
30 >2 byte&0xf0 =0xB0 \b, 192 kBits
31 >2 byte&0xf0 =0xC0 \b, 224 kBits
32 >2 byte&0xf0 =0xD0 \b, 256 kBits
33 >2 byte&0xf0 =0xE0 \b, 320 kBits
35 >2 byte&0x0C =0x00 \b, 44.1 kHz
36 >2 byte&0x0C =0x04 \b, 48 kHz
37 >2 byte&0x0C =0x08 \b, 32 kHz
39 >3 byte&0xC0 =0x00 \b, Stereo
40 >3 byte&0xC0 =0x40 \b, JStereo
41 >3 byte&0xC0 =0x80 \b, Dual-Ch
42 >3 byte&0xC0 =0xC0 \b, Mono
43 #>1 byte&0x01 =0x00 \b, Error Protection
44 #>2 byte&0x02 =0x02 \b, Padding
45 #>2 byte&0x01 =0x01 \b, Private
46 #>3 byte&0x08 =0x08 \b, Copyright
47 #>3 byte&0x04 =0x04 \b, Original
48 #>3 byte&0x03 1 \b, Emphasis 5
49 #>3 byte&0x03 3 \b, Emphasis c
52 0 beshort&0xfffe =0xfffc \bMP2
53 >2 byte&0xf0 =0x10 \b, 32 kBits
54 >2 byte&0xf0 =0x20 \b, 48 kBits
55 >2 byte&0xf0 =0x30 \b, 56 kBits
56 >2 byte&0xf0 =0x40 \b, 64 kBits
57 >2 byte&0xf0 =0x50 \b, 80 kBits
58 >2 byte&0xf0 =0x60 \b, 96 kBits
59 >2 byte&0xf0 =0x70 \b, 112 kBits
60 >2 byte&0xf0 =0x80 \b, 128 kBits
61 >2 byte&0xf0 =0x90 \b, 160 kBits
62 >2 byte&0xf0 =0xA0 \b, 192 kBits
63 >2 byte&0xf0 =0xB0 \b, 224 kBits
64 >2 byte&0xf0 =0xC0 \b, 256 kBits
65 >2 byte&0xf0 =0xD0 \b, 320 kBits
66 >2 byte&0xf0 =0xE0 \b, 384 kBits
68 >2 byte&0x0C =0x00 \b, 44.1 kHz
69 >2 byte&0x0C =0x04 \b, 48 kHz
70 >2 byte&0x0C =0x08 \b, 32 kHz
72 >3 byte&0xC0 =0x00 \b, Stereo
73 >3 byte&0xC0 =0x40 \b, JStereo
74 >3 byte&0xC0 =0x80 \b, Dual-Ch
75 >3 byte&0xC0 =0xC0 \b, Mono
76 #>1 byte&0x01 =0x00 \b, Error Protection
77 #>2 byte&0x02 =0x02 \b, Padding
78 #>2 byte&0x01 =0x01 \b, Private
79 #>3 byte&0x08 =0x08 \b, Copyright
80 #>3 byte&0x04 =0x04 \b, Original
81 #>3 byte&0x03 1 \b, Emphasis 5
82 #>3 byte&0x03 3 \b, Emphasis c
85 0 beshort&0xfff8 =0xfff0 MP
90 >2 byte&0xf0 =0x10 \b, 8 kBits
91 >2 byte&0xf0 =0x20 \b, 16 kBits
92 >2 byte&0xf0 =0x30 \b, 24 kBits
93 >2 byte&0xf0 =0x40 \b, 32 kBits
94 >2 byte&0xf0 =0x50 \b, 40 kBits
95 >2 byte&0xf0 =0x60 \b, 48 kBits
96 >2 byte&0xf0 =0x70 \b, 56 kBits
97 >2 byte&0xf0 =0x80 \b, 64 kBits
98 >2 byte&0xf0 =0x90 \b, 80 kBits
99 >2 byte&0xf0 =0xA0 \b, 96 kBits
100 >2 byte&0xf0 =0xB0 \b, 112 kBits
101 >2 byte&0xf0 =0xC0 \b, 128 kBits
102 >2 byte&0xf0 =0xD0 \b, 144 kBits
103 >2 byte&0xf0 =0xE0 \b, 160 kBits
105 >2 byte&0x0C =0x00 \b, 22.05 kHz
106 >2 byte&0x0C =0x04 \b, 24 kHz
107 >2 byte&0x0C =0x08 \b, 16 kHz
109 >3 byte&0xC0 =0x00 \b, Stereo
110 >3 byte&0xC0 =0x40 \b, JStereo
111 >3 byte&0xC0 =0x80 \b, Dual-Ch
112 >3 byte&0xC0 =0xC0 \b, Mono
113 #>1 byte&0x01 =0x00 \b, Error Protection
114 #>2 byte&0x02 =0x02 \b, Padding
115 #>2 byte&0x01 =0x01 \b, Private
116 #>3 byte&0x08 =0x08 \b, Copyright
117 #>3 byte&0x04 =0x04 \b, Original
118 #>3 byte&0x03 1 \b, Emphasis 5
119 #>3 byte&0x03 3 \b, Emphasis c
121 # FLI animation format
122 4 leshort 0xAF11 FLI file
123 >6 leshort x - %d frames,
124 >8 leshort x width=%d pixels,
125 >10 leshort x height=%d pixels,
126 >12 leshort x depth=%d,
127 >16 leshort x ticks/frame=%d
128 # FLC animation format
129 4 leshort 0xAF12 FLC file
130 >6 leshort x - %d frames
131 >8 leshort x width=%d pixels,
132 >10 leshort x height=%d pixels,
133 >12 leshort x depth=%d,
134 >16 leshort x ticks/frame=%d
136 # DL animation format
137 # XXX - collision with most `mips' magic
139 # I couldn't find a real magic number for these, however, this
140 # -appears- to work. Note that it might catch other files, too, so be
143 # Note that title and author appear in the two 20-byte chunks
144 # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
145 # 255 (hex FF)! The DL format is really bad.
147 #0 byte 1 DL version 1, medium format (160x100, 4 images/screen)
148 #>42 byte x - %d screens,
149 #>43 byte x %d commands
150 #0 byte 2 DL version 2
151 #>1 byte 1 - large format (320x200,1 image/screen),
152 #>1 byte 2 - medium format (160x100,4 images/screen),
153 #>1 byte >2 - unknown format,
154 #>42 byte x %d screens,
155 #>43 byte x %d commands
156 # Based on empirical evidence, DL version 3 have several nulls following the
157 # \003. Most of them start with non-null values at hex offset 0x34 or so.
158 #0 string \3\0\0\0\0\0\0\0\0\0\0\0 DL version 3
160 # SGI and Apple formats
161 0 string MOVI Silicon Graphics movie file
162 4 string moov Apple QuickTime movie file (moov)
163 4 string mdat Apple QuickTime movie file (mdat)
165 # iso 13818 transport stream
167 # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
168 # (the following is a little bit restrictive and works fine for a stream
169 # that starts with PAT properly. it won't work for stream data, that is
170 # cut from an input device data right in the middle, but this shouldn't
172 # syncbyte 8 bit 0x47
174 # payload_start 1 bit 1
178 # adaptfld_ctrl 2 bit 1 or 3
179 # conti_count 4 bit 0
180 0 belong&0xFF5FFF1F 0x47400010 MPEG transport stream data
181 >188 byte !0x47 CORRUPTED
183 # DIF digital video file format <mpruett@sgi.com>
184 0 belong&0xffffff00 0x1f070000 DIF
185 >4 byte &0x01 (DVCPRO) movie file
186 >4 byte ^0x01 (DV) movie file
190 # Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
191 0 belong 0x3026b275 Microsoft ASF
193 # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
194 0 string \x8aMNG MNG video data,
195 >4 belong !0x0d0a1a0a CORRUPTED,