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