xref: /freebsd/contrib/file/magic/Magdir/animation (revision ec965063070e5753c166cf592c9336444b74720a)
1
2#------------------------------------------------------------------------------
3# $File: animation,v 1.90 2022/08/16 11:16:39 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
33
34#### MP4 ####
35# https://www.ftyps.com/ with local additions
36# https://cconcolato.github.io/mp4ra/filetype.html
374	string		ftyp		ISO Media
38# https://aeroquartet.com/wordpress/2016/03/05/3-xavc-s/
39>8	string		XAVC		\b, MPEG v4 system, Sony XAVC Codec
40>>96	string		x		\b, Audio "%.4s"
41>>118	beshort		x		at %dHz
42>>140	string		x		\b, Video "%.4s"
43>>168	beshort		x		%d
44>>170	beshort		x		\bx%d
45>8	string		3g2		\b, MPEG v4 system, 3GPP2
46!:mime	video/3gpp2
47>>11	byte		4		\b v4 (H.263/AMR GSM 6.10)
48>>11	byte		5		\b v5 (H.263/AMR GSM 6.10)
49>>11	byte		6		\b v6 (ITU H.264/AMR GSM 6.10)
50# https://www.3gpp2.org/Public_html/Specs/C.S0050-B_v1.0_070521.pdf
51# Section 8.1.1, corresponds to a, b, c
52>>11	byte		0x61		\b C.S0050-0 V1.0
53>>11	byte		0x62		\b C.S0050-0-A V1.0.0
54>>11	byte		0x63		\b C.S0050-0-B V1.0
55>8	string		3ge		\b, MPEG v4 system, 3GPP
56!:mime	video/3gpp
57>>11	byte		6		\b, Release %d MBMS Extended Presentations
58>>11	byte		7		\b, Release %d MBMS Extended Presentations
59>>11	byte		9		\b, Release %d MBMS Extended Presentations
60>8	string		3gf		\b, MPEG v4 system, 3GPP
61>>11	byte		9		\b, Release %d File-delivery profile
62>8	string		3gg		\b, MPEG v4 system, 3GPP
63!:mime	video/3gpp
64>>11	byte		6		\b, Release %d General Profile
65>>11	byte		9		\b, Release %d General Profile
66>8	string		3gh		\b, MPEG v4 system, 3GPP
67!:mime	video/3gpp
68>>11	byte		9		\b, Release %d Adaptive Streaming Profile
69>8	string		3gm		\b, MPEG v4 system, 3GPP
70!:mime	video/3gpp
71>>11	byte		9		\b, Release %d Media Segment Profile
72>8	string		3gp		\b, MPEG v4 system, 3GPP
73!:mime	video/3gpp
74>>11	byte		1		\b, Release %d (non existent)
75>>11	byte		2		\b, Release %d (non existent)
76>>11	byte		3		\b, Release %d (non existent)
77>>11	byte		4		\b, Release %d
78>>11	byte		5		\b, Release %d
79>>11	byte		6		\b, Release %d
80>>11	byte		7		\b, Release %d Streaming Servers
81>8	string		3gr		\b, MPEG v4 system, 3GPP
82!:mime	video/3gpp
83>>11	byte		6		\b, Release %d Progressive Download Profile
84>>11	byte		9		\b, Release %d Progressive Download Profile
85>8	string		3gs		\b, MPEG v4 system, 3GPP
86!:mime	video/3gpp
87>>11	byte		6		\b, Release %d Streaming Servers
88>>11	byte		7		\b, Release %d Streaming Servers
89>>11	byte		9		\b, Release %d Streaming Servers
90>8	string		3gt		\b, MPEG v4 system, 3GPP
91!:mime	video/3gpp
92>>11	byte		8		\b, Release %d Media Stream Recording Profile
93>>11	byte		9		\b, Release %d Media Stream Recording Profile
94>8	string		ARRI		\b, MPEG v4 system, ARRI Digital Camera
95!:mime	video/mp4
96>8	string		avc1		\b, MPEG v4 system, 3GPP JVT AVC [ISO 14496-12:2005]
97!:mime	video/mp4
98>8	string		bbxm		\b, Blinkbox Master File: H.264 video/16-bit LE LPCM audio
99!:mime	video/mp4
100>8	string/W	qt		\b, Apple QuickTime movie
101!:mime	video/quicktime
102>8	string		CAEP		\b, Canon Digital Camera
103>8	string		caqv		\b, Casio Digital Camera
104>8	string		CDes		\b, Convergent Design
105>8	string		caaa		\b, CMAF Media Profile - AAC Adaptive Audio
106>8	string		caac		\b, CMAF Media Profile - AAC Core
107>8	string		caqv		\b, Casio Digital Camera	Casio
108>8	string		ccea		\b, CMAF Supplemental Data - CEA-608/708
109>8	string		ccff		\b, Common container file format
110>8	string		cfhd		\b, CMAF Media Profile - AVC HD
111>8	string		cfsd		\b, CMAF Media Profile - AVC SD
112>8	string		chd1		\b, CMAF Media Profile - HEVC HDR10
113>8	string		chdf		\b, CMAF Media Profile - AVC HDHF
114>8	string		chhd		\b, CMAF Media Profile - HEVC HHD8
115>8	string		chh1		\b, CMAF Media Profile - HEVC HHD10
116>8	string		clg1		\b, CMAF Media Profile - HEVC HLG10
117>8	string		cmfc		\b, CMAF Track Format
118>8	string		cmff		\b, CMAF Fragment Format
119>8	string		cmfl		\b, CMAF Chunk Format
120>8	string		cmfs		\b, CMAF Segment Format
121>8	string		cud1		\b, CMAF Media Profile - HEVC UHD10
122>8	string		cud8		\b, CMAF Media Profile - HEVC UHD8
123>8	string		cwvt		\b, CMAF Media Profile - WebVTT
124>8	string		da0a		\b, DMB MAF w/ MPEG Layer II aud, MOT slides, DLS, JPG/PNG/MNG
125>8	string		da0b		\b, DMB MAF, ext DA0A, with 3GPP timed text, DID, TVA, REL, IPMP
126>8	string		da1a		\b, DMB MAF audio with ER-BSAC audio, JPG/PNG/MNG images
127>8	string		da1b		\b, DMB MAF, ext da1a, with 3GPP timed text, DID, TVA, REL, IPMP
128>8	string		da2a		\b, DMB MAF aud w/ HE-AAC v2 aud, MOT slides, DLS, JPG/PNG/MNG
129>8	string		da2b		\b, DMB MAF, ext da2a, with 3GPP timed text, DID, TVA, REL, IPMP
130>8	string		da3a		\b, DMB MAF aud with HE-AAC aud, JPG/PNG/MNG images
131>8	string		da3b		\b, DMB MAF, ext da3a w/ BIFS, 3GPP, DID, TVA, REL, IPMP
132>8	string		dash		\b, MPEG v4 system, Dynamic Adaptive Streaming over HTTP
133!:mime	video/mp4
134>8	string		dby1		\b, MP4 files with Dolby content
135>8	string		dsms		\b, Media Segment DASH conformant
136>8	string		dts1		\b, MP4 track file with audio codecs dtsc dtsh or dtse
137>8	string		dts2		\b, MP4 track file with audio codec dtsx
138>8	string		dts3		\b, MP4 track file with audio codec dtsy
139>8	string		dxo$20		\b, DxO ONE camera
140>8	string		dmb1		\b, DMB MAF supporting all the components defined in the spec
141>8	string		dmpf		\b, Digital Media Project
142>8	string		drc1		\b, Dirac (wavelet compression), encap in ISO base media (MP4)
143>8	string		dv1a		\b, DMB MAF vid w/ AVC vid, ER-BSAC aud, BIFS, JPG/PNG/MNG, TS
144>8	string		dv1b		\b, DMB MAF, ext dv1a, with 3GPP timed text, DID, TVA, REL, IPMP
145>8	string		dv2a		\b, DMB MAF vid w/ AVC vid, HE-AAC v2 aud, BIFS, JPG/PNG/MNG, TS
146>8	string		dv2b		\b, DMB MAF, ext dv2a, with 3GPP timed text, DID, TVA, REL, IPMP
147>8	string		dv3a		\b, DMB MAF vid w/ AVC vid, HE-AAC aud, BIFS, JPG/PNG/MNG, TS
148>8	string		dv3b		\b, DMB MAF, ext dv3a, with 3GPP timed text, DID, TVA, REL, IPMP
149>8	string		dvr1		\b, DVB (.DVB) over RTP
150!:mime	video/vnd.dvb.file
151>8	string		dvt1		\b, DVB (.DVB) over MPEG-2 Transport Stream
152>8	string		emsg		\b, Event message box present
153!:mime	video/vnd.dvb.file
154>8	string		F4V		\b, Video for Adobe Flash Player 9+ (.F4V)
155!:mime	video/mp4
156>8	string		F4P		\b, Protected Video for Adobe Flash Player 9+ (.F4P)
157!:mime	video/mp4
158>8	string		F4A		\b, Audio for Adobe Flash Player 9+ (.F4A)
159!:mime	audio/mp4
160>8	string		F4B		\b, Audio Book for Adobe Flash Player 9+ (.F4B)
161!:mime	audio/mp4
162>8	string		ifrm		\b, Apple iFrame Specification, Version 8.1 Jan 2013
163>8	string		im1i		\b, CMAF Media Profile - IMSC1 Image
164>8	string		im1t		\b, CMAF Media Profile - IMSC1 Text
165>8	string		isc2		\b, ISMACryp 2.0 Encrypted File
166#	?/enc-isoff-generic
167>8	string		iso		\b, MP4 Base Media
168!:mime	video/mp4
169!:ext	mp4
170>>11	string		m 		v1 [ISO 14496-12:2003]
171>>11	string		2		v2 [ISO 14496-12:2005]
172>>11	string		4		v4
173>>11	string		5		v5
174>>11	string		6		v6
175>8	string		isml		\b, MP4 Base Media v2 [ISO 14496-12:2005]
176!:mime	video/mp4
177>8	string		J2P0		\b, JPEG2000 Profile 0
178>8	string		J2P1		\b, JPEG2000 Profile 1
179>8	string/W	jp2		\b, JPEG 2000
180!:mime	image/jp2
181>8	string		JP2		\b, JPEG 2000 Image (.JP2) [ISO 15444-1 ?]
182!:mime	image/jp2
183>8	string		JP20		\b, Unknown, from GPAC samples (prob non-existent)
184>8	string		jpm		\b, JPEG 2000 Compound Image (.JPM) [ISO 15444-6]
185!:mime	image/jpm
186>8	string		jpsi		\b, The JPSearch data interchange format
187>8	string		jpx		\b, JPEG 2000 w/ extensions (.JPX) [ISO 15444-2]
188!:mime	image/jpx
189>8	string		KDDI		\b, 3GPP2 EZmovie for KDDI 3G cellphones
190!:mime	video/3gpp2
191>8	string		LCAG		\b,  Leica digital camera
192>8	string		lmsg		\b, Last Media Segment indicator for ISO base media file format.
193>8	string		M4A 		\b, Apple iTunes ALAC/AAC-LC (.M4A) Audio
194!:mime	audio/x-m4a
195>8	string		M4B 		\b, Apple iTunes ALAC/AAC-LC (.M4B) Audio Book
196!:mime	audio/mp4
197>8	string		M4P 		\b, Apple iTunes ALAC/AAC-LC (.M4P) AES Protected Audio
198!:mime	video/mp4
199>8	string		M4V 		\b, Apple iTunes Video (.M4V) Video
200!:mime	video/x-m4v
201>8	string		M4VH		\b, Apple TV (.M4V)
202!:mime	video/x-m4v
203>8	string		M4VP		\b, Apple iPhone (.M4V)
204!:mime	video/x-m4v
205>8	string		mj2s		\b, Motion JPEG 2000 [ISO 15444-3] Simple Profile
206!:mime	video/mj2
207>8	string		mjp2		\b, Motion JPEG 2000 [ISO 15444-3] General Profile
208>8	string		MFSM		\b, Media File for Samsung video Metadata
209>8	string		MGSV		\b, Sony Home and Mobile Multimedia Platform (HMMP)
210!:mime	video/mj2
211>8	string		mmp4		\b, MPEG-4/3GPP Mobile Profile (.MP4 / .3GP) (for NTT)
212!:mime	video/mp4
213>8	string		mobi		\b, MPEG-4, MOBI format
214!:mime	video/mp4
215>8	string		mp21		\b, MPEG-21 [ISO/IEC 21000-9]
216>8	string		mp41		\b, MP4 v1 [ISO 14496-1:ch13]
217!:mime	video/mp4
218>8	string		mp42		\b, MP4 v2 [ISO 14496-14]
219!:mime	video/mp4
220>8	string		mp71		\b, MP4 w/ MPEG-7 Metadata [per ISO 14496-12]
221>8	string		mp7t		\b, MPEG v4 system, MPEG v7 XML
222>8	string		mp7b		\b, MPEG v4 system, MPEG v7 binary XML
223>8	string		mpuf		\b, Compliance with the MMT Processing Unit format
224>8	string		msdh		\b, Media Segment conforming to ISO base media file format.
225>8	string		msix		\b, Media Segment conforming to ISO base media file format.
226>8	string		mmp4		\b, MPEG v4 system, 3GPP Mobile
227!:mime	video/mp4
228>8	string		MPPI		\b, Photo Player, MAF [ISO/IEC 23000-3]
229>8	string		mqt		\b, Sony / Mobile QuickTime (.MQV) US Pat 7,477,830
230!:mime	video/quicktime
231>8	string		MSNV		\b, MPEG-4 (.MP4) for SonyPSP
232!:mime	audio/mp4
233>8	string		NDAS		\b, MP4 v2 [ISO 14496-14] Nero Digital AAC Audio
234!:mime	audio/mp4
235>8	string		NDSC		\b, MPEG-4 (.MP4) Nero Cinema Profile
236!:mime	video/mp4
237>8	string		NDSH		\b, MPEG-4 (.MP4) Nero HDTV Profile
238!:mime	video/mp4
239>8	string		NDSM		\b, MPEG-4 (.MP4) Nero Mobile Profile
240!:mime	video/mp4
241>8	string		NDSP		\b, MPEG-4 (.MP4) Nero Portable Profile
242!:mime	video/mp4
243>8	string		NDSS		\b, MPEG-4 (.MP4) Nero Standard Profile
244!:mime	video/mp4
245>8	string		NDXC		\b, H.264/MPEG-4 AVC (.MP4) Nero Cinema Profile
246!:mime	video/mp4
247>8	string		NDXH		\b, H.264/MPEG-4 AVC (.MP4) Nero HDTV Profile
248!:mime	video/mp4
249>8	string		NDXM		\b, H.264/MPEG-4 AVC (.MP4) Nero Mobile Profile
250!:mime	video/mp4
251>8	string		NDXP		\b, H.264/MPEG-4 AVC (.MP4) Nero Portable Profile
252!:mime	video/mp4
253>8	string		NDXS		\b, H.264/MPEG-4 AVC (.MP4) Nero Standard Profile
254>8	string		niko		\b, Nikon Digital Camera
255!:mime	video/mp4
256>8	string		odcf  		\b, OMA DCF DRM Format 2.0 (OMA-TS-DRM-DCF-V2_0-20060303-A)
257>8	string		opf2 		\b, OMA PDCF DRM Format 2.1 (OMA-TS-DRM-DCF-V2_1-20070724-C)
258>8	string		opx2  		\b, OMA PDCF DRM + XBS ext (OMA-TS-DRM_XBS-V1_0-20070529-C)
259>8	string		pana		\b, Panasonic Digital Camera
260>8	string		piff		\b, Protected Interoperable File Format
261>8	string		pnvi		]b, Panasonic Video Intercom
262>8	string		qt  		\b, Apple QuickTime (.MOV/QT)
263!:mime	video/quicktime
264# HEIF image format
265# see https://nokiatech.github.io/heif/technical.html
266>8	string		mif1		\b, HEIF Image
267!:mime image/heif
268>8	string		msf1		\b, HEIF Image Sequence
269!:mime image/heif-sequence
270>8	string		heic		\b, HEIF Image HEVC Main or Main Still Picture Profile
271!:mime image/heic
272>8	string		heix		\b, HEIF Image HEVC Main 10 Profile
273!:mime image/heic
274>8	string		hevc		\b, HEIF Image Sequenz HEVC Main or Main Still Picture Profile
275!:mime image/heic-sequence
276>8	string		hevx		\b, HEIF Image Sequence HEVC Main 10 Profile
277!:mime image/heic-sequence
278# following HEIF brands are not mentioned in the heif technical info currently (Oct 2017)
279# but used in the reference implementation:
280# https://github.com/nokiatech/heif/blob/d5e9a21c8ba8df712bdf643021dd9f6518134776/Srcs/reader/hevcimagefilereader.cpp
281>8	string		heim		\b, HEIF Image L-HEVC
282!:mime image/heif
283>8	string		heis		\b, HEIF Image L-HEVC
284!:mime image/heif
285>8	string		avic		\b, HEIF Image AVC
286!:mime image/heif
287>8	string		hevm		\b, HEIF Image Sequence L-HEVC
288!:mime image/heif-sequence
289>8	string		hevs		\b, HEIF Image Sequence L-HEVC
290!:mime image/heif-sequence
291>8	string		avcs		\b, HEIF Image Sequence AVC
292!:mime image/heif-sequence
293# AVIF image format
294# see https://aomediacodec.github.io/av1-avif/
295>8	string		avif		\b, AVIF Image
296!:mime image/avif
297>8	string		avis		\b, AVIF Image Sequence
298!:mime image/avif
299>8	string		risx		\b, Representation Index Segment for MPEG-2 TS Segments
300>8	string		ROSS		\b, Ross Video
301>8	string		sdv		\b, SD Memory Card Video
302>8	string		ssc1		\b, Samsung stereo, single stream (patent pending)
303>8	string		ssc2		\b, Samsung stereo, dual stream (patent pending)
304>8	string		SEAU		\b, Sony Home and Mobile Multimedia Platform (HMMP)
305>8	string		SEBK		\b, Sony Home and Mobile Multimedia Platform (HMMP)
306>8	string		senv		\b, Video contents Sony Entertainment Network
307>8	string		sims		\b, Media Segment for Sub-Indexed Media Segment format
308>8	string		sisx		\b, Single Index Segment forindex MPEG-2 TS
309>8	string		ssss		\b, Subsegment Index Segment used to index MPEG-2 Segments
310>8	string		uvvu		\b, UltraViolet file brand for DECE Common Format
311
312# MPEG sequences
313# Scans for all common MPEG header start codes
3140	 belong		    0x00000001
315>4	 byte&0x1F	    0x07	   JVT NAL sequence, H.264 video
316>>5      byte               66             \b, baseline
317>>5      byte               77             \b, main
318>>5      byte               88             \b, extended
319>>7      byte               x              \b @ L %u
3200        belong&0xFFFFFF00  0x00000100
321>3       byte               0xBA           MPEG sequence
322!:mime  video/mpeg
323# http://fileformats.archiveteam.org/wiki/Enhanced_VOB
324# https://reposcope.com/mimetype/video/mpeg
325!:ext	vob/evo/mpg/mpeg
326>>4      byte               &0x40          \b, v2, program multiplex
327>>4      byte               ^0x40          \b, v1, system multiplex
328>3       byte               0xBB           MPEG sequence, v1/2, multiplex (missing pack header)
329>3       byte&0x1F          0x07           MPEG sequence, H.264 video
330>>4      byte               66             \b, baseline
331>>4      byte               77             \b, main
332>>4      byte               88             \b, extended
333>>6      byte               x              \b @ L %u
334# GRR too general as it catches also FoxPro Memo example NG.FPT
335>3       byte               0xB0           MPEG sequence, v4
336# TODO: maybe this extra line exclude FoxPro Memo example NG.FPT starting with 000001b0 00000100 00000000
337#>>4      byte               !0             MPEG sequence, v4
338!:mime  video/mpeg4-generic
339>>5      belong             0x000001B5
340>>>9     byte               &0x80
341>>>>10   byte&0xF0          16             \b, video
342>>>>10   byte&0xF0          32             \b, still texture
343>>>>10   byte&0xF0          48             \b, mesh
344>>>>10   byte&0xF0          64             \b, face
345>>>9     byte&0xF8          8              \b, video
346>>>9     byte&0xF8          16             \b, still texture
347>>>9     byte&0xF8          24             \b, mesh
348>>>9     byte&0xF8          32             \b, face
349>>4      byte               1              \b, simple @ L1
350>>4      byte               2              \b, simple @ L2
351>>4      byte               3              \b, simple @ L3
352>>4      byte               4              \b, simple @ L0
353>>4      byte               17             \b, simple scalable @ L1
354>>4      byte               18             \b, simple scalable @ L2
355>>4      byte               33             \b, core @ L1
356>>4      byte               34             \b, core @ L2
357>>4      byte               50             \b, main @ L2
358>>4      byte               51             \b, main @ L3
359>>4      byte               53             \b, main @ L4
360>>4      byte               66             \b, n-bit @ L2
361>>4      byte               81             \b, scalable texture @ L1
362>>4      byte               97             \b, simple face animation @ L1
363>>4      byte               98             \b, simple face animation @ L2
364>>4      byte               99             \b, simple face basic animation @ L1
365>>4      byte               100            \b, simple face basic animation @ L2
366>>4      byte               113            \b, basic animation text @ L1
367>>4      byte               114            \b, basic animation text @ L2
368>>4      byte               129            \b, hybrid @ L1
369>>4      byte               130            \b, hybrid @ L2
370>>4      byte               145            \b, advanced RT simple @ L!
371>>4      byte               146            \b, advanced RT simple @ L2
372>>4      byte               147            \b, advanced RT simple @ L3
373>>4      byte               148            \b, advanced RT simple @ L4
374>>4      byte               161            \b, core scalable @ L1
375>>4      byte               162            \b, core scalable @ L2
376>>4      byte               163            \b, core scalable @ L3
377>>4      byte               177            \b, advanced coding efficiency @ L1
378>>4      byte               178            \b, advanced coding efficiency @ L2
379>>4      byte               179            \b, advanced coding efficiency @ L3
380>>4      byte               180            \b, advanced coding efficiency @ L4
381>>4      byte               193            \b, advanced core @ L1
382>>4      byte               194            \b, advanced core @ L2
383>>4      byte               209            \b, advanced scalable texture @ L1
384>>4      byte               210            \b, advanced scalable texture @ L2
385>>4      byte               211            \b, advanced scalable texture @ L3
386>>4      byte               225            \b, simple studio @ L1
387>>4      byte               226            \b, simple studio @ L2
388>>4      byte               227            \b, simple studio @ L3
389>>4      byte               228            \b, simple studio @ L4
390>>4      byte               229            \b, core studio @ L1
391>>4      byte               230            \b, core studio @ L2
392>>4      byte               231            \b, core studio @ L3
393>>4      byte               232            \b, core studio @ L4
394>>4      byte               240            \b, advanced simple @ L0
395>>4      byte               241            \b, advanced simple @ L1
396>>4      byte               242            \b, advanced simple @ L2
397>>4      byte               243            \b, advanced simple @ L3
398>>4      byte               244            \b, advanced simple @ L4
399>>4      byte               245            \b, advanced simple @ L5
400>>4      byte               247            \b, advanced simple @ L3b
401>>4      byte               248            \b, FGS @ L0
402>>4      byte               249            \b, FGS @ L1
403>>4      byte               250            \b, FGS @ L2
404>>4      byte               251            \b, FGS @ L3
405>>4      byte               252            \b, FGS @ L4
406>>4      byte               253            \b, FGS @ L5
407>3       byte               0xB5           MPEG sequence, v4
408!:mime  video/mpeg4-generic
409>>4      byte               &0x80
410>>>5     byte&0xF0          16             \b, video (missing profile header)
411>>>5     byte&0xF0          32             \b, still texture (missing profile header)
412>>>5     byte&0xF0          48             \b, mesh (missing profile header)
413>>>5     byte&0xF0          64             \b, face (missing profile header)
414>>4      byte&0xF8          8              \b, video (missing profile header)
415>>4      byte&0xF8          16             \b, still texture (missing profile header)
416>>4      byte&0xF8          24             \b, mesh (missing profile header)
417>>4      byte&0xF8          32             \b, face (missing profile header)
418>3       byte               0xB3           MPEG sequence
419!:mime  video/mpeg
420>>12     belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
421>>12     belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
422>>12     belong             0x000001B5     \b, v2,
423>>>16    byte&0x0F          1              \b HP
424>>>16    byte&0x0F          2              \b Spt
425>>>16    byte&0x0F          3              \b SNR
426>>>16    byte&0x0F          4              \b MP
427>>>16    byte&0x0F          5              \b SP
428>>>17    byte&0xF0          64             \b@HL
429>>>17    byte&0xF0          96             \b@H-14
430>>>17    byte&0xF0          128            \b@ML
431>>>17    byte&0xF0          160            \b@LL
432>>>17    byte               &0x08          \b progressive
433>>>17    byte               ^0x08          \b interlaced
434>>>17    byte&0x06          2              \b Y'CbCr 4:2:0 video
435>>>17    byte&0x06          4              \b Y'CbCr 4:2:2 video
436>>>17    byte&0x06          6              \b Y'CbCr 4:4:4 video
437>>11     byte               &0x02
438>>>75    byte               &0x01
439>>>>140  belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
440>>>>140  belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
441>>>>140  belong             0x000001B5     \b, v2,
442>>>>>144 byte&0x0F          1              \b HP
443>>>>>144 byte&0x0F          2              \b Spt
444>>>>>144 byte&0x0F          3              \b SNR
445>>>>>144 byte&0x0F          4              \b MP
446>>>>>144 byte&0x0F          5              \b SP
447>>>>>145 byte&0xF0          64             \b@HL
448>>>>>145 byte&0xF0          96             \b@H-14
449>>>>>145 byte&0xF0          128            \b@ML
450>>>>>145 byte&0xF0          160            \b@LL
451>>>>>145 byte               &0x08          \b progressive
452>>>>>145 byte               ^0x08          \b interlaced
453>>>>>145 byte&0x06          2              \b Y'CbCr 4:2:0 video
454>>>>>145 byte&0x06          4              \b Y'CbCr 4:2:2 video
455>>>>>145 byte&0x06          6              \b Y'CbCr 4:4:4 video
456>>76    belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
457>>76    belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
458>>76    belong             0x000001B5     \b, v2,
459>>>80   byte&0x0F          1              \b HP
460>>>80   byte&0x0F          2              \b Spt
461>>>80   byte&0x0F          3              \b SNR
462>>>80   byte&0x0F          4              \b MP
463>>>80   byte&0x0F          5              \b SP
464>>>81   byte&0xF0          64             \b@HL
465>>>81   byte&0xF0          96             \b@H-14
466>>>81   byte&0xF0          128            \b@ML
467>>>81   byte&0xF0          160            \b@LL
468>>>81   byte               &0x08          \b progressive
469>>>81   byte               ^0x08          \b interlaced
470>>>81   byte&0x06          2              \b Y'CbCr 4:2:0 video
471>>>81   byte&0x06          4              \b Y'CbCr 4:2:2 video
472>>>81   byte&0x06          6              \b Y'CbCr 4:4:4 video
473>>4      belong&0xFFFFFF00  0x78043800     \b, HD-TV 1920P
474>>>7     byte&0xF0          0x10           \b, 16:9
475>>4      belong&0xFFFFFF00  0x50002D00     \b, SD-TV 1280I
476>>>7     byte&0xF0          0x10           \b, 16:9
477>>4      belong&0xFFFFFF00  0x30024000     \b, PAL Capture
478>>>7     byte&0xF0          0x10           \b, 4:3
479>>4      beshort&0xFFF0     0x2C00         \b, 4CIF
480>>>5     beshort&0x0FFF     0x01E0         \b NTSC
481>>>5     beshort&0x0FFF     0x0240         \b PAL
482>>>7     byte&0xF0          0x20           \b, 4:3
483>>>7     byte&0xF0          0x30           \b, 16:9
484>>>7     byte&0xF0          0x40           \b, 11:5
485>>>7     byte&0xF0          0x80           \b, PAL 4:3
486>>>7     byte&0xF0          0xC0           \b, NTSC 4:3
487>>4      belong&0xFFFFFF00  0x2801E000     \b, LD-TV 640P
488>>>7     byte&0xF0          0x10           \b, 4:3
489>>4      belong&0xFFFFFF00  0x1400F000     \b, 320x240
490>>>7     byte&0xF0          0x10           \b, 4:3
491>>4      belong&0xFFFFFF00  0x0F00A000     \b, 240x160
492>>>7     byte&0xF0          0x10           \b, 4:3
493>>4      belong&0xFFFFFF00  0x0A007800     \b, 160x120
494>>>7     byte&0xF0          0x10           \b, 4:3
495>>4      beshort&0xFFF0     0x1600         \b, CIF
496>>>5     beshort&0x0FFF     0x00F0         \b NTSC
497>>>5     beshort&0x0FFF     0x0120         \b PAL
498>>>7     byte&0xF0          0x20           \b, 4:3
499>>>7     byte&0xF0          0x30           \b, 16:9
500>>>7     byte&0xF0          0x40           \b, 11:5
501>>>7     byte&0xF0          0x80           \b, PAL 4:3
502>>>7     byte&0xF0          0xC0           \b, NTSC 4:3
503>>>5     beshort&0x0FFF     0x0240         \b PAL 625
504>>>>7    byte&0xF0          0x20           \b, 4:3
505>>>>7    byte&0xF0          0x30           \b, 16:9
506>>>>7    byte&0xF0          0x40           \b, 11:5
507>>4      beshort&0xFFF0     0x2D00         \b, CCIR/ITU
508>>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
509>>>5     beshort&0x0FFF     0x0240         \b PAL 625
510>>>7     byte&0xF0          0x20           \b, 4:3
511>>>7     byte&0xF0          0x30           \b, 16:9
512>>>7     byte&0xF0          0x40           \b, 11:5
513>>4      beshort&0xFFF0     0x1E00         \b, SVCD
514>>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
515>>>5     beshort&0x0FFF     0x0240         \b PAL 625
516>>>7     byte&0xF0          0x20           \b, 4:3
517>>>7     byte&0xF0          0x30           \b, 16:9
518>>>7     byte&0xF0          0x40           \b, 11:5
519>>7      byte&0x0F          1              \b, 23.976 fps
520>>7      byte&0x0F          2              \b, 24 fps
521>>7      byte&0x0F          3              \b, 25 fps
522>>7      byte&0x0F          4              \b, 29.97 fps
523>>7      byte&0x0F          5              \b, 30 fps
524>>7      byte&0x0F          6              \b, 50 fps
525>>7      byte&0x0F          7              \b, 59.94 fps
526>>7      byte&0x0F          8              \b, 60 fps
527>>11     byte               &0x04          \b, Constrained
528
529# MPEG ADTS Audio (*.mpx/mxa/aac)
530# from dreesen@math.fu-berlin.de
531# modified to fully support MPEG ADTS
532
533# MP3, M1A
534# modified by Joerg Jenderek
535# GRR the original test are too common for many DOS files
536# so don't accept as MP3 until we've tested the rate
537# But also beat GEMDOS fonts
5380       beshort&0xFFFE  0xFFFA
539# rates
540>2	byte&0xF0	!0
541>>2	byte&0xF0	!0xF0		MPEG ADTS, layer III, v1
542!:strength +20
543!:mime	audio/mpeg
544>2	byte&0xF0	0x10		\b, 32 kbps
545>2	byte&0xF0	0x20		\b, 40 kbps
546>2	byte&0xF0	0x30		\b, 48 kbps
547>2	byte&0xF0	0x40		\b, 56 kbps
548>2	byte&0xF0	0x50		\b, 64 kbps
549>2	byte&0xF0	0x60		\b, 80 kbps
550>2	byte&0xF0	0x70		\b, 96 kbps
551>2	byte&0xF0	0x80		\b, 112 kbps
552>2	byte&0xF0	0x90		\b, 128 kbps
553>2	byte&0xF0	0xA0		\b, 160 kbps
554>2	byte&0xF0	0xB0		\b, 192 kbps
555>2	byte&0xF0	0xC0		\b, 224 kbps
556>2	byte&0xF0	0xD0		\b, 256 kbps
557>2	byte&0xF0	0xE0		\b, 320 kbps
558# timing
559>2	byte&0x0C	0x00		\b, 44.1 kHz
560>2	byte&0x0C	0x04		\b, 48 kHz
561>2	byte&0x0C	0x08		\b, 32 kHz
562# channels/options
563>3	byte&0xC0	0x00		\b, Stereo
564>3	byte&0xC0	0x40		\b, JntStereo
565>3	byte&0xC0	0x80		\b, 2x Monaural
566>3	byte&0xC0	0xC0		\b, Monaural
567#>1	byte		^0x01		\b, Data Verify
568#>2	byte		&0x02		\b, Packet Pad
569#>2	byte		&0x01		\b, Custom Flag
570#>3	byte		&0x08		\b, Copyrighted
571#>3	byte		&0x04		\b, Original Source
572#>3	byte&0x03	1		\b, NR: 50/15 ms
573#>3	byte&0x03	3		\b, NR: CCIT J.17
574
575# MP2, M1A
5760       beshort&0xFFFE  0xFFFC         MPEG ADTS, layer II, v1
577!:mime	audio/mpeg
578# rates
579>2      byte&0xF0       0x10           \b,  32 kbps
580>2      byte&0xF0       0x20           \b,  48 kbps
581>2      byte&0xF0       0x30           \b,  56 kbps
582>2      byte&0xF0       0x40           \b,  64 kbps
583>2      byte&0xF0       0x50           \b,  80 kbps
584>2      byte&0xF0       0x60           \b,  96 kbps
585>2      byte&0xF0       0x70           \b, 112 kbps
586>2      byte&0xF0       0x80           \b, 128 kbps
587>2      byte&0xF0       0x90           \b, 160 kbps
588>2      byte&0xF0       0xA0           \b, 192 kbps
589>2      byte&0xF0       0xB0           \b, 224 kbps
590>2      byte&0xF0       0xC0           \b, 256 kbps
591>2      byte&0xF0       0xD0           \b, 320 kbps
592>2      byte&0xF0       0xE0           \b, 384 kbps
593# timing
594>2      byte&0x0C       0x00           \b, 44.1 kHz
595>2      byte&0x0C       0x04           \b, 48 kHz
596>2      byte&0x0C       0x08           \b, 32 kHz
597# channels/options
598>3      byte&0xC0       0x00           \b, Stereo
599>3      byte&0xC0       0x40           \b, JntStereo
600>3      byte&0xC0       0x80           \b, 2x Monaural
601>3      byte&0xC0       0xC0           \b, Monaural
602#>1     byte            ^0x01          \b, Data Verify
603#>2     byte            &0x02          \b, Packet Pad
604#>2     byte            &0x01          \b, Custom Flag
605#>3     byte            &0x08          \b, Copyrighted
606#>3     byte            &0x04          \b, Original Source
607#>3     byte&0x03       1              \b, NR: 50/15 ms
608#>3     byte&0x03       3              \b, NR: CCIT J.17
609
610# MPA, M1A
611# updated by Joerg Jenderek
612# GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
613# GRR this test is still too general as it catches a BOM of UTF-16 files (0xFFFE)
614# FIXME: Almost all little endian UTF-16 text with BOM are clobbered by these entries
615#0	beshort&0xFFFE		0xFFFE
616#>2	ubyte&0xF0	>0x0F
617#>>2	ubyte&0xF0	<0xE1		MPEG ADTS, layer I, v1
618## rate
619#>>>2      byte&0xF0       0x10           \b,  32 kbps
620#>>>2      byte&0xF0       0x20           \b,  64 kbps
621#>>>2      byte&0xF0       0x30           \b,  96 kbps
622#>>>2      byte&0xF0       0x40           \b, 128 kbps
623#>>>2      byte&0xF0       0x50           \b, 160 kbps
624#>>>2      byte&0xF0       0x60           \b, 192 kbps
625#>>>2      byte&0xF0       0x70           \b, 224 kbps
626#>>>2      byte&0xF0       0x80           \b, 256 kbps
627#>>>2      byte&0xF0       0x90           \b, 288 kbps
628#>>>2      byte&0xF0       0xA0           \b, 320 kbps
629#>>>2      byte&0xF0       0xB0           \b, 352 kbps
630#>>>2      byte&0xF0       0xC0           \b, 384 kbps
631#>>>2      byte&0xF0       0xD0           \b, 416 kbps
632#>>>2      byte&0xF0       0xE0           \b, 448 kbps
633## timing
634#>>>2      byte&0x0C       0x00           \b, 44.1 kHz
635#>>>2      byte&0x0C       0x04           \b, 48 kHz
636#>>>2      byte&0x0C       0x08           \b, 32 kHz
637## channels/options
638#>>>3      byte&0xC0       0x00           \b, Stereo
639#>>>3      byte&0xC0       0x40           \b, JntStereo
640#>>>3      byte&0xC0       0x80           \b, 2x Monaural
641#>>>3      byte&0xC0       0xC0           \b, Monaural
642##>1     byte            ^0x01          \b, Data Verify
643##>2     byte            &0x02          \b, Packet Pad
644##>2     byte            &0x01          \b, Custom Flag
645##>3     byte            &0x08          \b, Copyrighted
646##>3     byte            &0x04          \b, Original Source
647##>3     byte&0x03       1              \b, NR: 50/15 ms
648##>3     byte&0x03       3              \b, NR: CCIT J.17
649
650# MP3, M2A
6510       beshort&0xFFFE  0xFFF2         MPEG ADTS, layer III, v2
652!:mime	audio/mpeg
653# rate
654>2      byte&0xF0       0x10           \b,   8 kbps
655>2      byte&0xF0       0x20           \b,  16 kbps
656>2      byte&0xF0       0x30           \b,  24 kbps
657>2      byte&0xF0       0x40           \b,  32 kbps
658>2      byte&0xF0       0x50           \b,  40 kbps
659>2      byte&0xF0       0x60           \b,  48 kbps
660>2      byte&0xF0       0x70           \b,  56 kbps
661>2      byte&0xF0       0x80           \b,  64 kbps
662>2      byte&0xF0       0x90           \b,  80 kbps
663>2      byte&0xF0       0xA0           \b,  96 kbps
664>2      byte&0xF0       0xB0           \b, 112 kbps
665>2      byte&0xF0       0xC0           \b, 128 kbps
666>2      byte&0xF0       0xD0           \b, 144 kbps
667>2      byte&0xF0       0xE0           \b, 160 kbps
668# timing
669>2      byte&0x0C       0x00           \b, 22.05 kHz
670>2      byte&0x0C       0x04           \b, 24 kHz
671>2      byte&0x0C       0x08           \b, 16 kHz
672# channels/options
673>3      byte&0xC0       0x00           \b, Stereo
674>3      byte&0xC0       0x40           \b, JntStereo
675>3      byte&0xC0       0x80           \b, 2x Monaural
676>3      byte&0xC0       0xC0           \b, Monaural
677#>1     byte            ^0x01          \b, Data Verify
678#>2     byte            &0x02          \b, Packet Pad
679#>2     byte            &0x01          \b, Custom Flag
680#>3     byte            &0x08          \b, Copyrighted
681#>3     byte            &0x04          \b, Original Source
682#>3     byte&0x03       1              \b, NR: 50/15 ms
683#>3     byte&0x03       3              \b, NR: CCIT J.17
684
685# MP2, M2A
6860       beshort&0xFFFE  0xFFF4         MPEG ADTS, layer II, v2
687!:mime	audio/mpeg
688# rate
689>2      byte&0xF0       0x10           \b,   8 kbps
690>2      byte&0xF0       0x20           \b,  16 kbps
691>2      byte&0xF0       0x30           \b,  24 kbps
692>2      byte&0xF0       0x40           \b,  32 kbps
693>2      byte&0xF0       0x50           \b,  40 kbps
694>2      byte&0xF0       0x60           \b,  48 kbps
695>2      byte&0xF0       0x70           \b,  56 kbps
696>2      byte&0xF0       0x80           \b,  64 kbps
697>2      byte&0xF0       0x90           \b,  80 kbps
698>2      byte&0xF0       0xA0           \b,  96 kbps
699>2      byte&0xF0       0xB0           \b, 112 kbps
700>2      byte&0xF0       0xC0           \b, 128 kbps
701>2      byte&0xF0       0xD0           \b, 144 kbps
702>2      byte&0xF0       0xE0           \b, 160 kbps
703# timing
704>2      byte&0x0C       0x00           \b, 22.05 kHz
705>2      byte&0x0C       0x04           \b, 24 kHz
706>2      byte&0x0C       0x08           \b, 16 kHz
707# channels/options
708>3      byte&0xC0       0x00           \b, Stereo
709>3      byte&0xC0       0x40           \b, JntStereo
710>3      byte&0xC0       0x80           \b, 2x Monaural
711>3      byte&0xC0       0xC0           \b, Monaural
712#>1     byte            ^0x01          \b, Data Verify
713#>2     byte            &0x02          \b, Packet Pad
714#>2     byte            &0x01          \b, Custom Flag
715#>3     byte            &0x08          \b, Copyrighted
716#>3     byte            &0x04          \b, Original Source
717#>3     byte&0x03       1              \b, NR: 50/15 ms
718#>3     byte&0x03       3              \b, NR: CCIT J.17
719
720# MPA, M2A
7210       beshort&0xFFFE  0xFFF6         MPEG ADTS, layer I, v2
722!:mime	audio/mpeg
723# rate
724>2      byte&0xF0       0x10           \b,  32 kbps
725>2      byte&0xF0       0x20           \b,  48 kbps
726>2      byte&0xF0       0x30           \b,  56 kbps
727>2      byte&0xF0       0x40           \b,  64 kbps
728>2      byte&0xF0       0x50           \b,  80 kbps
729>2      byte&0xF0       0x60           \b,  96 kbps
730>2      byte&0xF0       0x70           \b, 112 kbps
731>2      byte&0xF0       0x80           \b, 128 kbps
732>2      byte&0xF0       0x90           \b, 144 kbps
733>2      byte&0xF0       0xA0           \b, 160 kbps
734>2      byte&0xF0       0xB0           \b, 176 kbps
735>2      byte&0xF0       0xC0           \b, 192 kbps
736>2      byte&0xF0       0xD0           \b, 224 kbps
737>2      byte&0xF0       0xE0           \b, 256 kbps
738# timing
739>2      byte&0x0C       0x00           \b, 22.05 kHz
740>2      byte&0x0C       0x04           \b, 24 kHz
741>2      byte&0x0C       0x08           \b, 16 kHz
742# channels/options
743>3      byte&0xC0       0x00           \b, Stereo
744>3      byte&0xC0       0x40           \b, JntStereo
745>3      byte&0xC0       0x80           \b, 2x Monaural
746>3      byte&0xC0       0xC0           \b, Monaural
747#>1     byte            ^0x01          \b, Data Verify
748#>2     byte            &0x02          \b, Packet Pad
749#>2     byte            &0x01          \b, Custom Flag
750#>3     byte            &0x08          \b, Copyrighted
751#>3     byte            &0x04          \b, Original Source
752#>3     byte&0x03       1              \b, NR: 50/15 ms
753#>3     byte&0x03       3              \b, NR: CCIT J.17
754
755# MP3, M25A
7560       beshort&0xFFFE  0xFFE2         MPEG ADTS, layer III,  v2.5
757!:mime	audio/mpeg
758# rate
759>2      byte&0xF0       0x10           \b,   8 kbps
760>2      byte&0xF0       0x20           \b,  16 kbps
761>2      byte&0xF0       0x30           \b,  24 kbps
762>2      byte&0xF0       0x40           \b,  32 kbps
763>2      byte&0xF0       0x50           \b,  40 kbps
764>2      byte&0xF0       0x60           \b,  48 kbps
765>2      byte&0xF0       0x70           \b,  56 kbps
766>2      byte&0xF0       0x80           \b,  64 kbps
767>2      byte&0xF0       0x90           \b,  80 kbps
768>2      byte&0xF0       0xA0           \b,  96 kbps
769>2      byte&0xF0       0xB0           \b, 112 kbps
770>2      byte&0xF0       0xC0           \b, 128 kbps
771>2      byte&0xF0       0xD0           \b, 144 kbps
772>2      byte&0xF0       0xE0           \b, 160 kbps
773# timing
774>2      byte&0x0C       0x00           \b, 11.025 kHz
775>2      byte&0x0C       0x04           \b, 12 kHz
776>2      byte&0x0C       0x08           \b, 8 kHz
777# channels/options
778>3      byte&0xC0       0x00           \b, Stereo
779>3      byte&0xC0       0x40           \b, JntStereo
780>3      byte&0xC0       0x80           \b, 2x Monaural
781>3      byte&0xC0       0xC0           \b, Monaural
782#>1     byte            ^0x01          \b, Data Verify
783#>2     byte            &0x02          \b, Packet Pad
784#>2     byte            &0x01          \b, Custom Flag
785#>3     byte            &0x08          \b, Copyrighted
786#>3     byte            &0x04          \b, Original Source
787#>3     byte&0x03       1              \b, NR: 50/15 ms
788#>3     byte&0x03       3              \b, NR: CCIT J.17
789
790# AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
791
792# Stored AAC streams (instead of the MP4 format)
7930       string          ADIF           MPEG ADIF, AAC
794!:mime	audio/x-hx-aac-adif
795>4      byte            &0x80
796>>13    byte            &0x10          \b, VBR
797>>13    byte            ^0x10          \b, CBR
798>>16    byte&0x1E       0x02           \b, single stream
799>>16    byte&0x1E       0x04           \b, 2 streams
800>>16    byte&0x1E       0x06           \b, 3 streams
801>>16    byte            &0x08          \b, 4 or more streams
802>>16    byte            &0x10          \b, 8 or more streams
803>>4    byte            &0x80          \b, Copyrighted
804>>13   byte            &0x40          \b, Original Source
805>>13   byte            &0x20          \b, Home Flag
806>4      byte            ^0x80
807>>4     byte            &0x10          \b, VBR
808>>4     byte            ^0x10          \b, CBR
809>>7     byte&0x1E       0x02           \b, single stream
810>>7     byte&0x1E       0x04           \b, 2 streams
811>>7     byte&0x1E       0x06           \b, 3 streams
812>>7     byte            &0x08          \b, 4 or more streams
813>>7     byte            &0x10          \b, 8 or more streams
814>>4    byte            &0x40          \b, Original Stream(s)
815>>4    byte            &0x20          \b, Home Source
816
817# Live or stored single AAC stream (used with MPEG-2 systems)
8180       beshort&0xFFF6  0xFFF0         MPEG ADTS, AAC
819!:mime	audio/x-hx-aac-adts
820>1      byte            &0x08          \b, v2
821>1      byte            ^0x08          \b, v4
822# profile
823>>2     byte            &0xC0          \b LTP
824>2      byte&0xc0       0x00           \b Main
825>2      byte&0xc0       0x40           \b LC
826>2      byte&0xc0       0x80           \b SSR
827# timing
828>2      byte&0x3c       0x00           \b, 96 kHz
829>2      byte&0x3c       0x04           \b, 88.2 kHz
830>2      byte&0x3c       0x08           \b, 64 kHz
831>2      byte&0x3c       0x0c           \b, 48 kHz
832>2      byte&0x3c       0x10           \b, 44.1 kHz
833>2      byte&0x3c       0x14           \b, 32 kHz
834>2      byte&0x3c       0x18           \b, 24 kHz
835>2      byte&0x3c       0x1c           \b, 22.05 kHz
836>2      byte&0x3c       0x20           \b, 16 kHz
837>2      byte&0x3c       0x24           \b, 12 kHz
838>2      byte&0x3c       0x28           \b, 11.025 kHz
839>2      byte&0x3c       0x2c           \b, 8 kHz
840# channels
841>2      beshort&0x01c0  0x0040         \b, monaural
842>2      beshort&0x01c0  0x0080         \b, stereo
843>2      beshort&0x01c0  0x00c0         \b, stereo + center
844>2      beshort&0x01c0  0x0100         \b, stereo+center+LFE
845>2      beshort&0x01c0  0x0140         \b, surround
846>2      beshort&0x01c0  0x0180         \b, surround + LFE
847>2      beshort         &0x01C0        \b, surround + side
848#>1     byte            ^0x01           \b, Data Verify
849#>2     byte            &0x02           \b, Custom Flag
850#>3     byte            &0x20           \b, Original Stream
851#>3     byte            &0x10           \b, Home Source
852#>3     byte            &0x08           \b, Copyrighted
853
854# Live MPEG-4 audio streams (instead of RTP FlexMux)
8550       beshort&0xFFE0  0x56E0         MPEG-4 LOAS
856!:mime	audio/x-mp4a-latm
857#>1     beshort&0x1FFF  x              \b, %hu byte packet
858>3      byte&0xE0       0x40
859>>4     byte&0x3C       0x04           \b, single stream
860>>4     byte&0x3C       0x08           \b, 2 streams
861>>4     byte&0x3C       0x0C           \b, 3 streams
862>>4     byte            &0x08          \b, 4 or more streams
863>>4     byte            &0x20          \b, 8 or more streams
864>3      byte&0xC0       0
865>>4     byte&0x78       0x08           \b, single stream
866>>4     byte&0x78       0x10           \b, 2 streams
867>>4     byte&0x78       0x18           \b, 3 streams
868>>4     byte            &0x20          \b, 4 or more streams
869>>4     byte            &0x40          \b, 8 or more streams
870# This magic isn't strong enough (matches plausible ISO-8859-1 text)
871#0       beshort         0x4DE1         MPEG-4 LO-EP audio stream
872#!:mime	audio/x-mp4a-latm
873
874# Summary: FLI animation format
875# Created by: Daniel Quinlan <quinlan@yggdrasil.com>
876# Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
8774	leshort		0xAF11
878# standard FLI always has 320x200 resolution and 8 bit color
879>8	leshort		320
880>>10	leshort		200
881>>>12	leshort		8			FLI animation, 320x200x8
882!:mime	video/x-fli
883>>>>6	leshort		x			\b, %d frames
884# frame speed is multiple of 1/70s
885>>>>16	leshort		x			\b, %d/70s per frame
886
887# Summary: FLC animation format
888# Created by: Daniel Quinlan <quinlan@yggdrasil.com>
889# Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
8904	leshort		0xAF12
891# standard FLC always use 8 bit color
892>12	leshort		8			FLC animation
893!:mime	video/x-flc
894>>8	leshort		x			\b, %d
895>>10	leshort		x			\bx%dx8
896>>6	uleshort	x			\b, %d frames
897>>16	uleshort	x			\b, %dms per frame
898
899# DL animation format
900# XXX - collision with most `mips' magic
901#
902# I couldn't find a real magic number for these, however, this
903# -appears- to work.  Note that it might catch other files, too, so be
904# careful!
905#
906# Note that title and author appear in the two 20-byte chunks
907# at decimal offsets 2 and 22, respectively, but they are XOR'ed with
908# 255 (hex FF)!  The DL format is really bad.
909#
910#0	byte	1	DL version 1, medium format (160x100, 4 images/screen)
911#!:mime	video/x-unknown
912#>42	byte	x	- %d screens,
913#>43	byte	x	%d commands
914#0	byte	2	DL version 2
915#!:mime	video/x-unknown
916#>1	byte	1	- large format (320x200,1 image/screen),
917#>1	byte	2	- medium format (160x100,4 images/screen),
918#>1	byte	>2	- unknown format,
919#>42	byte	x	%d screens,
920#>43	byte	x	%d commands
921# Based on empirical evidence, DL version 3 have several nulls following the
922# \003.  Most of them start with non-null values at hex offset 0x34 or so.
923#0	string	\3\0\0\0\0\0\0\0\0\0\0\0	DL version 3
924
925# iso 13818 transport stream
926#
927# from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
928# syncbyte      8 bit	0x47
929# error_ind     1 bit	-
930# payload_start 1 bit	1
931# priority      1 bit	-
932# PID          13 bit	0x0000
933# scrambling    2 bit	-
934# adaptfld_ctrl 2 bit	1 or 3
935# conti_count   4 bit	-
9360	belong&0xFF5FFF10	0x47400010
937>188	byte			0x47		MPEG transport stream data
938!:mime  video/MP2T
939!:ext	ts
940
941# DIF digital video file format <mpruett@sgi.com>
9420	belong&0xffffff00	0x1f070000      DIF
943!:mime  video/x-dv
944>4	byte			&0x01		(DVCPRO) movie file
945>4	byte			^0x01		(DV) movie file
946>3	byte			&0x80		(PAL)
947>3	byte			^0x80		(NTSC)
948
949# MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
9500	string			\x8aMNG		MNG video data,
951!:mime	video/x-mng
952>4	belong			!0x0d0a1a0a	CORRUPTED,
953>4	belong			0x0d0a1a0a
954>>16    belong	x				%d x
955>>20    belong	x				%d
956
957# JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
9580	string			\x8bJNG		JNG video data,
959!:mime	video/x-jng
960>4	belong			!0x0d0a1a0a	CORRUPTED,
961>4	belong			0x0d0a1a0a
962>>16    belong	x				%d x
963>>20    belong	x				%d
964
965# Vivo video (Wolfram Kleff)
9663	string		\x0D\x0AVersion:Vivo	Vivo video data
967
968# ABC (alembic.io 3d models)
9690	string	0gawa		ABC 3d model
970
971#---------------------------------------------------------------------------
972# HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
973# From Mark Sheppard <msheppard@climax.co.uk>, 2002-10-03
974#
9750	string		HVQM4		%s
976>6	string		>\0		v%s
977>0	byte		x		GameCube movie,
978>0x34	ubeshort	x		%d x
979>0x36	ubeshort	x		%d,
980>0x26	ubeshort	x		%dus,
981>0x42	ubeshort	0		no audio
982>0x42	ubeshort	>0		%dHz audio
983
984# From: Stefan A. Haubenthal <polluks@sdf.lonestar.org>
985# Update: Joerg Jenderek
986# URL: https://en.wikipedia.org/wiki/VOB
9870	string		DVDVIDEO-VTS	Video title set,
988!:mime	video/x-ifo
989!:ext	ifo/bup
990>0x21	byte		x		v%x
9910	string		DVDVIDEO-VMG	Video manager,
992!:mime	video/x-ifo
993!:ext	ifo/bup
994>0x21	byte		x		v%x
995
996# From: Stefan A. Haubenthal <polluks@sdf.lonestar.org>
9970 string xMovieSetter MovieSetter movie
9980 string xSceneEditor MovieSetter movie
999
1000# From: Behan Webster <behanw@websterwood.com>
1001# NuppelVideo used by Mythtv (*.nuv)
1002# Note: there are two identical stanzas here differing only in the
1003# initial string matched. It used to be done with a regex, but we're
1004# trying to get rid of those.
10050	string		NuppelVideo	MythTV NuppelVideo
1006>12	string		x		v%s
1007>20	lelong		x		(%d
1008>24	lelong		x		\bx%d),
1009>36	string		P		\bprogressive,
1010>36	string		I		\binterlaced,
1011>40	ledouble	x		\baspect:%.2f,
1012>48	ledouble	x		\bfps:%.2f
10130	string		MythTV		MythTV NuppelVideo
1014>12	string		x		v%s
1015>20	lelong		x		(%d
1016>24	lelong		x		\bx%d),
1017>36	string		P		\bprogressive,
1018>36	string		I		\binterlaced,
1019>40	ledouble	x		\baspect:%.2f,
1020>48	ledouble	x		\bfps:%.2f
1021
1022#						MPEG file
1023# MPEG sequences
1024# FIXME: This section is from the old magic.mime file and needs
1025# integrating with the rest
1026#0       belong             0x000001BA
1027#>4      byte               &0x40
1028#!:mime	video/mp2p
1029#>4      byte               ^0x40
1030#!:mime	video/mpeg
1031#0       belong             0x000001BB
1032#!:mime	video/mpeg
1033#0       belong             0x000001B0
1034#!:mime	video/mp4v-es
1035#0       belong             0x000001B5
1036#!:mime	video/mp4v-es
1037#0       belong             0x000001B3
1038#!:mime	video/mpv
1039#0       belong&0xFF5FFF10  0x47400010
1040#!:mime	video/mp2t
1041#0       belong             0x00000001
1042#>4      byte&0x1F	   0x07
1043#!:mime	video/h264
1044
1045# Type: Bink Video
1046# Extension: .bik
1047# URL:  https://wiki.multimedia.cx/index.php?title=Bink_Container
1048# From: <hoehle@users.sourceforge.net>  2008-07-18
10490	name		bik
1050#>4	ulelong		x	size %d
1051>20	ulelong		x	\b, %d
1052>24	ulelong		x	\bx%d
1053>8	ulelong		x	\b, %d frames
1054>32	ulelong		x	at rate %d/
1055>28	ulelong		>1	\b%d
1056>40	ulelong		=0	\b, no audio
1057>40	ulelong		!0	\b, %d audio track
1058>>40	ulelong		!1	\bs
1059# follow properties of the first audio track only
1060>>48	uleshort	x	%dHz
1061>>51	byte&0x20	0	mono
1062>>51	byte&0x20	!0	stereo
1063#>>51	byte&0x10	0	FFT
1064#>>51	byte&0x10	!0	DCT
1065
10660	string		BIK
1067>3	regex		=[bdfghi]	Bink Video rev.%s
1068>>0	use		bik
1069
10700	string		KB2
1071>3	regex		=[adfghi]	Bink Video 2 rev.%s
1072>>0	use		bik
1073
1074# Type:	NUT Container
1075# URL:	https://wiki.multimedia.cx/index.php?title=NUT
1076# From:	Adam Buchbinder <adam.buchbinder@gmail.com>
10770	string	nut/multimedia\ container\0	NUT multimedia container
1078
1079# Type: Nullsoft Video (NSV)
1080# URL:  https://wiki.multimedia.cx/index.php?title=Nullsoft_Video
1081# From: Mike Melanson <mike@multimedia.cx>
10820	string	NSVf	Nullsoft Video
1083
1084# Type: REDCode Video
1085# URL:  https://www.red.com/ ; https://wiki.multimedia.cx/index.php?title=REDCode
1086# From: Mike Melanson <mike@multimedia.cx>
10874	string	RED1	REDCode Video
1088
1089# Type: MTV Multimedia File
1090# URL:  https://wiki.multimedia.cx/index.php?title=MTV
1091# From: Mike Melanson <mike@multimedia.cx>
10920	string	AMVS	MTV Multimedia File
1093
1094# Type: ARMovie
1095# URL:  https://wiki.multimedia.cx/index.php?title=ARMovie
1096# From: Mike Melanson <mike@multimedia.cx>
10970	string	ARMovie\012	ARMovie
1098
1099# Type: Interplay MVE Movie
1100# URL:  https://wiki.multimedia.cx/index.php?title=Interplay_MVE
1101# From: Mike Melanson <mike@multimedia.cx>
11020	string	Interplay\040MVE\040File\032	Interplay MVE Movie
1103
1104# Type: Windows Television DVR File
1105# URL:  https://wiki.multimedia.cx/index.php?title=WTV
1106# From: Mike Melanson <mike@mutlimedia.cx>
1107# This takes the form of a Windows-style GUID
11080	bequad	0xB7D800203749DA11
1109>8	bequad	0xA64E0007E95EAD8D	Windows Television DVR Media
1110
1111# Type: Sega FILM/CPK Multimedia
1112# URL:  https://wiki.multimedia.cx/index.php?title=Sega_FILM
1113# From: Mike Melanson <mike@multimedia.cx>
11140	string	FILM	Sega FILM/CPK Multimedia,
1115>32	belong	x	%d x
1116>28	belong	x	%d
1117
1118# Type: Nintendo THP Multimedia
1119# URL:  https://wiki.multimedia.cx/index.php?title=THP
1120# From: Mike Melanson <mike@multimedia.cx>
11210	string	THP\0	Nintendo THP Multimedia
1122
1123# Type: BBC Dirac Video
1124# URL:  https://wiki.multimedia.cx/index.php?title=Dirac
1125# From: Mike Melanson <mike@multimedia.cx>
11260	string	BBCD	BBC Dirac Video
1127
1128# Type: RAD Game Tools Smacker Multimedia
1129# URL:  https://wiki.multimedia.cx/index.php?title=Smacker
1130# From: Mike Melanson <mike@multimedia.cx>
11310	string	SMK	RAD Game Tools Smacker Multimedia
1132>3	byte	x	version %c,
1133>4	lelong	x	%d x
1134>8	lelong	x	%d,
1135>12	lelong	x	%d frames
1136
1137# Material Exchange Format
1138# More information:
1139# https://en.wikipedia.org/wiki/Material_Exchange_Format
1140# http://www.freemxf.org/
11410	string	\x06\x0e\x2b\x34\x02\x05\x01\x01\x0d\x01\x02\x01\x01\x02	Material exchange container format
1142!:ext	mxf
1143!:mime	application/mxf
1144
1145# Recognize LucasArts Smush video files (cf.
1146# https://wiki.multimedia.cx/index.php/Smush)
11470	string	ANIM
1148>8	string	AHDR	LucasArts Smush Animation Format (SAN) video
11490	string	SANM
1150>8	string	SHDR	LucasArts Smush v2 (SANM) video
1151
1152# Type: Scaleform video
1153# Extension: .usm
1154# URL:  https://wiki.multimedia.cx/index.php/USM
1155# From: David Korth <gerbilsoft@gerbilsoft.com>
11560	string	CRID
1157>32	string	@UTF	Scaleform video
1158
1159# http://www.jerrysguide.com/tips/demystify-tvs-file-format.html
11600	string	TVS\015\012
1161>&0	string	Version\040	TeamViewer Session File
1162>>&0	string	x		\b, version %s
1163
1164# SER file format - simple uncompressed video format for astronomical use
1165# Initially developed by Lucam Recorder,
1166# as of 2021 maintained by Heiko Wilkens, Grischa Hahn
1167# Typical extensions: .SER
1168# http://www.grischa-hahn.homepage.t-online.de/astro/ser/SER%20Doc%20V3b.pdf
11690	string	LUCAM-RECORDER	SER video sequence
1170!:ext	ser
1171>18	lelong	0	\b, bayer: mono
1172>18	lelong	8	\b, bayer: RGGB
1173>18	lelong	9	\b, bayer: GRBG
1174>18	lelong	10	\b, bayer: GBRG
1175>18	lelong	11	\b, bayer: BGGR
1176>18	lelong	16	\b, bayer: CYYM
1177>18	lelong	17	\b, bayer: YCMY
1178>18	lelong	18	\b, bayer: YMCY
1179>18	lelong	19	\b, bayer: MYYC
1180>18	lelong	100	\b, bayer: RGB
1181>18	lelong	101	\b, bayer: BGR
1182>22	lelong	0	\b, big-endian
1183>22	lelong	1	\b, little-endian
1184>26	lelong	x	\b, width: %d
1185>30	lelong	x	\b, height: %d
1186>34	lelong	x	\b, %d bit
1187>38	lelong	x	\b, frames: %d
1188