Tag Parser  8.0.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
mp4ids.h
Go to the documentation of this file.
1 #ifndef TAG_PARSER_MP4IDS_H
2 #define TAG_PARSER_MP4IDS_H
3 
4 #include "../global.h"
5 
6 #include <c++utilities/conversion/types.h>
7 
8 namespace TagParser {
9 
10 class MediaFormat;
11 
12 namespace Mp4AtomIds {
13 enum KnownValue : uint32 {
14  Av1Configuration = 0x61763143,
15  AvcConfiguration = 0x61766343,
16  BitrateBox = 0x62747274,
17  CleanAperature = 0x636c6170,
18  ChunkOffset64 = 0x636f3634,
20  Data = 0x64617461,
21  DataInformation = 0x64696e66,
22  DataReference = 0x64726566,
23  Drms = 0x64726D73,
24  Edts = 0x65647473,
25  Edit = 0x656C7374,
26  Free = 0x66726565,
27  FileType = 0x66747970,
28  HandlerReference = 0x68646c72,
29  HintMediaHeader = 0x686D6864,
30  ItunesList = 0x696c7374,
31  MediaData = 0x6d646174,
32  MediaHeader = 0x6d646864,
33  Media = 0x6d646961,
34  Mean = 0x6D65616E,
35  MovieExtendsHeader = 0x6D656864,
36  Meta = 0x6d657461,
37  MovieFragmentHeader = 0x6D666864,
39  MediaInformation = 0x6d696e66,
40  MovieFragment = 0x6d6f6f66,
41  Movie = 0x6d6f6f76,
42  MovieExtends = 0x6D766578,
43  MovieHeader = 0x6D766864,
44  Name = 0x6E616D65,
45  NullMediaHeaderBox = 0x6E6D6864,
46  PaddingBits = 0x70616462,
47  PixalAspectRatio = 0x70617370,
49  SampleToGroup = 0x73626770,
51  SampleGroupDescription = 0x73677064,
52  Skip = 0x736b6970,
53  SoundMediaHeader = 0x736D6864,
54  SampleTable = 0x7374626c,
55  ChunkOffset = 0x7374636f,
56  DegradationPriority = 0x73746470,
57  SampleToChunk = 0x73747363,
58  SampleDescription = 0x73747364,
59  ShadowSyncSample = 0x73747368,
60  SyncSample = 0x73747373,
61  SampleSize = 0x7374737A,
62  DecodingTimeToSample = 0x73747473,
63  CompactSampleSize = 0x73747a32,
64  SubSampleInformation = 0x73756273,
65  TrackFragmentHeader = 0x74666864,
66  TrackHeader = 0x746b6864,
67  TrackFragment = 0x74726166,
68  Track = 0x7472616b,
69  TrackReference = 0x74726566,
70  TrackExtends = 0x74726578,
71  TrackFragmentRun = 0x7472756E,
72  UserData = 0x75647461,
73  DataEntryUrl = 0x75726C20,
74  DataEntryUrn = 0x75726E20,
75  VideoMediaHeader = 0x766D6864,
76  Wide = 0x77696465
77 };
78 }
79 
80 namespace Mp4TagAtomIds {
81 enum KnownValue : uint32 {
82  Album = 0xA9616c62,
83  AlbumArtist = 0x61415254,
84  Artist = 0xA9415254,
85  Bpm = 0x746d706f,
86  Category = 0x63617467,
87  Comment = 0xA9636d74,
88  Composer = 0xA9777274,
89  Copyright = 0x63707274,
90  Cover = 0x636f7672,
91  Description = 0x64657363,
92  DiskPosition = 0x6469736b,
93  Encoder = 0xA9746f6f,
94  EpisodeGlobalUniqueId = 0x65676964,
95  Extended = 0x2d2d2d2d,
96  GaplessPlayback = 0x70676170,
97  Genre = 0xA967656e,
98  Grouping = 0xA9677270,
99  Keywords = 0x6b657977,
100  Lyricist = 0xA9737766,
101  Lyrics = 0xA96c7972,
102  MediaType = 0x7374696B,
103  Performers = 0xA9707266,
104  Podcast = 0x70637374,
105  PodcastUrl = 0x7075726c,
106  PreDefinedGenre = 0x676e7265,
107  Producer = 0xA9707264,
108  PurchaseDate = 0x70757264,
109  Rating = 0x72746e67,
110  RecordLabel = 0xA96c6162,
111  Title = 0xA96e616d,
112  TrackPosition = 0x74726b6e,
113  TvEpisode = 0x74766573,
114  TvEpisodeName = 0x7476656e,
115  TvNetworkName = 0x74766e6e,
116  TvSeason = 0x7476736e,
117  TvShowName = 0x74767368,
118  Year = 0xA9646179
119 };
120 }
121 
122 namespace Mp4TagExtendedMeanIds {
123 extern const char *iTunes;
124 }
125 
126 namespace Mp4TagExtendedNameIds {
127 extern const char *cdec;
128 extern const char *label;
129 } // namespace Mp4TagExtendedNameIds
130 
131 namespace Mp4MediaTypeIds {
132 enum KnownValue : uint32 {
133  Sound = 0x736f756e,
134  Video = 0x76696465,
135  Hint = 0x68696e74,
136  Meta = 0x6d657461
137 };
138 }
139 
140 namespace FourccIds {
141 enum KnownValue : uint32 {
142  Ac3 = 0x61632d33,
143  Ac4 = 0x61632d34,
144  AdpcmAcm = 0x6D730002,
145  Agsm = 0x6167736D,
146  Alac = 0x616C6163,
147  Alaw = 0x616C6177,
148  Alaw21 = 0x616C6177,
149  AlphaCompositor = 0x626C6E64,
150  AlphaGain = 0x6761696E,
151  Amr = 0x73617762,
152  AmrNarrowband = 0x73616D72,
153  Animation = 0x726C6520,
154  Appl1 = 0x6476690,
155  Appl2 = 0x6C70630,
156  Apple16BitGray = 0x62313667,
158  Apple48BitRgb = 0x62343872,
159  Apple64BitArgb1 = 0x62363461,
160  Apple64BitArgb2 = 0x62617365,
161  Apple64BitArgb3 = 0x626C6974,
162  AppleAnimation = 0x726C6520,
163  AppleAvrJpeg = 0x61767220,
164  AppleBmp = 0x57524C45,
165  AppleCinepak = 0x63766964,
166  AppleCmyk = 0x636D796B,
168  AppleCurve = 0x70617468,
169  AppleDvc = 0x64766320,
170  AppleDvcpro = 0x64767070,
171  AppleDvcpro501 = 0x6476356E,
172  AppleDvcpro502 = 0x64763570,
173  AppleDvcpro50Ntsc = 0x6476356E,
174  AppleDvcpro50Pal = 0x64763570,
175  AppleDvcproPal = 0x64767070,
176  AppleDvDvcproNtsc = 0x6476630,
177  AppleDvp = 0x64766370,
178  AppleDvPal = 0x64766370,
179  AppleFlc = 0x666C6963,
180  AppleGif = 0x67696620,
181  AppleGraphics = 0x736D630,
182  AppleGsm101 = 0x6167736D,
183  AppleH261 = 0x68323631,
185  AppleLossless = 0x616C6163,
186  AppleMacpaint = 0x504E5447,
187  AppleMicrosoftVideo1 = 0x6D737663,
188  AppleMotionJpegA = 0x6D6A7061,
189  AppleMotionJpegB = 0x6D6A7062,
190  AppleMpeg4Compressor = 0x6D703476,
192  AppleOpendmlJpeg = 0x646D6231,
193  ApplePhotoCd = 0x6B706364,
194  ApplePhotoJpeg = 0x6A706567,
195  ApplePixletVideo = 0x70786C74,
196  ApplePlanarRgb = 0x38425053,
197  ApplePng = 0x706E670,
198  AppleQuickdraw = 0x71647277,
199  AppleR408 = 0x72343038,
200  AppleScalingCodec = 0x7363616C,
201  AppleSgi = 0x2E534749,
203  AppleTextAtsuiCodec = 0x74657874,
204  AppleTga = 0x7467610,
205  AppleTiff = 0x74696666,
206  AppleV408 = 0x76343038,
207  AppleVcH263 = 0x68323633,
208  AppleVideo = 0x72707A61,
209  AppleYuv420Codec1 = 0x6A343230,
210  AppleYuv420Codec2 = 0x6D797576,
211  AppleYuv420Codec3 = 0x79343230,
212  AppleYuv422Codec2Vuy = 0x32767579,
213  AppleYuv422Codec4 = 0x79757678,
214  AppleYuv422CodecYuvs = 0x79757673,
215  AppleYuv422CodecYuvu = 0x79757675,
216  Avc0Media = 0x64726D69,
217  Avc1 = 0x61766331,
218  Avc2 = 0x61766332,
219  Avc3 = 0x61766333,
220  Avc4 = 0x61766334,
221  Av1_IVF = 0x41563031,
222  Av1_ISOBMFF = 0x61763031,
223  Blur = 0x626C7572,
224  Bps8 = 0x38627073,
225  BrightnessAndContrast = 0x6272636F,
226  ChannelCompositor = 0x6368616E,
227  ChromaKey = 0x636B6579,
228  Cinepak = 0x63766964,
229  Cloud = 0x636C6F75,
230  ColorStyle = 0x736F6C72,
231  Colorsync = 0x73796E63,
232  ColorTint = 0x74696E74,
233  CrossFade = 0x64736C76,
234  Cvid = 0x63766964,
235  Divx3Decoder1 = 0x41503431,
236  Divx3Decoder2 = 0x434F4C30,
237  Divx3Decoder3 = 0x434F4C31,
238  Divx3Decoder4 = 0x44495633,
239  Divx3Decoder5 = 0x44495634,
240  Divx3Decoder6 = 0x44495635,
241  Divx3Decoder7 = 0x44495636,
242  Divx3Decoder8 = 0x4D504733,
243  Divx3Decoder9 = 0x6D706733,
244  Divx3Decoder10 = 0x636F6C30,
245  Divx3Decoder11 = 0x636F6C31,
246  Divx3Decoder12 = 0x64697633,
247  Divx3Decoder13 = 0x64697634,
248  Divx3Decoder14 = 0x64697635,
249  Divx3Decoder15 = 0x64697636,
250  Divx4Decoder1 = 0x44495658,
251  Divx4Decoder2 = 0x64697678,
252  Divx5Decoder = 0x44583530,
253  Drms = 0x64726D73,
254  Drmi = 0x64726D69,
255  Dts = 0x6474736C,
256  DtsH = 0x64747368,
257  DtsE = 0x64747365,
258  Dvca = 0x64766361,
259  DvcPro501 = 0x64763570,
260  DvcPro502 = 0x6476356E,
261  DvcProPal = 0x64767070,
262  EAc3 = 0x65632D33,
263  EdgeDetection = 0x65646765,
264  Emboss = 0x656D6273,
265  Explode = 0x78706C6F,
266  FilmNoise = 0x666D6E73,
267  Fire = 0x66697265,
268  FlashPixImage = 0x66706978,
270  FloatingPoint32Bit = 0x666C3332,
271  FloatingPoint64Bit = 0x666C3634,
272  GeneralConvolution = 0x67656E6B,
273  Gif = 0x67696620,
274  Glass = 0x676C6173,
275  GradientWipe = 0x6D617474,
276  Graphics = 0x736D6320,
277  H263Quicktime = 0x68323633,
278  H2633GPP = 0x73323633,
279  H264Decoder1 = 0x44415643,
280  H264Decoder2 = 0x48323634,
281  H264Decoder3 = 0x56535348,
282  H264Decoder4 = 0x58323634,
283  H264Decoder5 = 0x68323634,
284  H264Decoder6 = 0x78323634,
285  Hdv3 = 0x68647633,
286  Hevc1 = 0x68766331,
287  Hevc2 = 0x68657631,
288  HslBalance = 0x68736C62,
289  Ima4 = 0x696D6134,
290  Ima41 = 0x696D6134,
291  ImaadpcmAcm = 0x6D730011,
292  Implode = 0x6D706C6F,
293  Int16Be = 0x74776F73,
294  Int16Le = 0x736F7774,
295  Int24 = 0x696E3234,
296  Int32 = 0x696E3332,
297  Iris = 0x736D7032,
298  IvxDecoder1 = 0x33495632,
299  IvxDecoder2 = 0x33495644,
300  IvxDecoder3 = 0x33697632,
301  IvxDecoder4 = 0x33697664,
302  Jpeg = 0x6a706567,
303  Jpeg2000Decoder = 0x6D6A7032,
304  Law21 = 0x756C6177,
305  LensFlare = 0x6C656E73,
306  Lle = 0x726C6520,
307  Mac3 = 0x6D616333,
308  Mac6 = 0x6D616336,
309  Mace31 = 0x4D414333,
310  Mace61 = 0x4D414336,
311  MatrixWipe = 0x736D7034,
312  DolbyMpl = 0x6D6C7061,
313  MotionJpegA = 0x6D6A7061,
314  MotionJpegB = 0x6D6A7062,
315  Mp3 = 0x2e6d7033,
316  Mp3CbrOnly = 0x6D730055,
317  Mpeg = 0x4D504547,
318  Mpeg2Imx30 = 0x6D78336E,
319  Mpeg2Imx50 = 0x6D783570,
320  Mpeg4Audio = 0x6d703461,
321  Mpeg4Decoder1 = 0x464D5034,
322  Mpeg4Decoder2 = 0x53454447,
323  Mpeg4Decoder3 = 0x57563146,
324  Mpeg4Sample = 0x6d703473,
325  Mpeg4TimedText = 0x74783367,
326  Mpeg4Video = 0x6d703476,
327  MsMpeg4V1Decoder1 = 0x44495631,
328  MsMpeg4V1Decoder2 = 0x64697631,
329  MsMpeg4V1Decoder3 = 0x4D504734,
330  MsMpeg4V1Decoder4 = 0x6D706734,
331  MsMpeg4V1Decoder5 = 0x4D504731,
332  MsMpeg4V1Decoder6 = 0x6D706731,
333  MsMpeg4V2Decoder1 = 0x44495632,
334  MsMpeg4V2Decoder2 = 0x64697632,
335  MsMpeg4V2Decoder3 = 0x4D503432,
336  MsMpeg4V2Decoder4 = 0x6D703432,
337  MsMpeg4V3Decoder1 = 0x4D503433,
338  MsMpeg4V3Decoder2 = 0x6D703433,
339  NtscDv25Video = 0x64766320,
340  Oggs = 0x4F676753,
341  PalDv25Video = 0x64766370,
342  PdfImage = 0x70646620,
343  Png = 0x706E6720,
344  Push = 0x70757368,
345  Qclp = 0x51636C70,
346  QdesignMusic1Decoder = 0x51444D43,
347  QdesignMusic2 = 0x51444D32,
348  Qdmc = 0x51444D43,
349  Qdrw = 0x71647277,
350  QtvrCubicCodec = 0x63757061,
351  QtvrCylindricalCodec = 0x6C747061,
352  QualcommPurevoice = 0x51636C70,
353  QualcommQcelp = 0x51636C71,
354  Radial = 0x736D7033,
355  Raw = 0x72617720,
356  RgbBalance = 0x72676262,
357  Ripple = 0x7269706C,
358  Rpza = 0x72707A61,
359  Rv20 = 0x52563230,
360  Rv30 = 0x52563330,
361  Rv40 = 0x52563430,
362  Sharpen = 0x73687270,
363  Slide = 0x736C6964,
364  Smc = 0x736D6320,
365  SorensonH263Decoder = 0x464C5631,
368  Sowt = 0x736F7774,
370  Svq1 = 0x73767131,
371  Svq3 = 0x73767133,
372  Tiff = 0x74696666,
373  TravelingMatte = 0x74726176,
374  TruemotionVp6Decoder1 = 0x56503632,
375  TruemotionVp6Decoder2 = 0x56503646,
376  Twos = 0x74776F73,
377  Ulaw = 0x756C6177,
378  Ulaw21 = 0x756C6177,
379  VcmImageCodec = 0x4D6A7067,
380  Vdva = 0x76647661,
381  Vp8 = 0x56503830,
382  Vp9 = 0x56503930,
383  WavPack = 0x5756504B,
384  WindowsMediaAudio = 0x6F776D61,
385  WindowsMediaAudio7 = 0x574D4131,
388  WindowsMediaVideoV17 = 0x574D5637,
389  WindowsMediaVideoV2 = 0x574D5632,
390  WindowsMediaVideoV8 = 0x574D5638,
391  Wipe = 0x736D7074,
392  WmvImageCodec1 = 0x4D347332,
393  WmvImageCodec2 = 0x4D703432,
394  WmvImageCodec3 = 0x4D703433,
395  WmvImageCodec4 = 0x4D703453,
396  WmvImageCodec5 = 0x574D5631,
397  WmvImageCodec6 = 0x574D5632,
398  WmvImageCodec7 = 0x574D5633,
399  XvidDecoder1 = 0x424C5A30,
400  XvidDecoder2 = 0x58564944,
401  XvidDecoder3 = 0x58564958,
402  XvidDecoder4 = 0x58766944,
403  XvidDecoder5 = 0x78766964,
409  Zoom = 0x7A6F6F6D
410 };
411 
413 
414 } // namespace FourccIds
415 
416 namespace Mp4FormatExtensionIds {
417 enum KnownValue : uint32 {
419  = 0x67616D61,
420  FieldHandling = 0x6669656C,
422  DefaultHuffmanTable = 0x6D6A6874,
425  AvcConfiguration = 0x61766343,
426  PixelAspectRatio = 0x70617370,
427  ColorParameters = 0x636F6C72,
428  CleanAperature = 0x636C6170
429 };
430 }
431 
432 namespace Mpeg4ElementaryStreamObjectIds {
433 enum KnownValue : byte {
437  AfxStream = 0x05,
441  Mpeg4Visual = 0x20,
442  Avc,
444  Als = 0x24,
445  Sa0c = 0x2B,
446  Aac = 0x40,
460  Png,
461  Evrc = 0xA0,
462  Smv,
464  Vc1,
466  Ac3,
468  Dts,
472  PrivateEvrc = 0xD1,
473  PrivateAc3 = 0xD3,
475  PrivateOgg = 0xDD,
477  PrivateQcelp = 0xE1
478 };
479 
480 TAG_PARSER_EXPORT MediaFormat streamObjectTypeFormat(byte streamObjectTypeId);
481 
482 } // namespace Mpeg4ElementaryStreamObjectIds
483 
484 namespace Mpeg4ElementaryStreamTypeIds {
485 enum KnownValue : byte {
499 };
500 
501 TAG_PARSER_EXPORT const char *streamTypeName(byte streamTypeId);
502 
503 } // namespace Mpeg4ElementaryStreamTypeIds
504 
505 namespace Mpeg4DescriptorIds {
506 enum KnownValue : byte {
507  ObjectDescr = 0x01,
548  UserPrivate = 0xC0
549 };
550 }
551 
552 namespace Mpeg4AudioObjectIds {
553 enum KnownValue : byte {
554  Null = 0,
559  Sbr,
564  Ttsi = 12,
570  ErAacLtp = 19,
580  Ps,
587  Als,
588  Sls,
596 };
597 
598 TAG_PARSER_EXPORT MediaFormat idToMediaFormat(byte mpeg4AudioObjectId, bool sbrPresent = false, bool psPresent = false);
599 
600 } // namespace Mpeg4AudioObjectIds
601 
602 extern uint32 mpeg4SamplingFrequencyTable[13];
603 
604 namespace Mpeg4ChannelConfigs {
605 enum Mpeg4ChannelConfig : byte {
614 };
615 
616 TAG_PARSER_EXPORT const char *channelConfigString(byte config);
617 TAG_PARSER_EXPORT byte channelCount(byte config);
618 
619 } // namespace Mpeg4ChannelConfigs
620 
621 namespace Mpeg4VideoCodes {
622 enum KnownValue : byte {
631  VopStart = 0xB6,
642 };
643 }
644 
645 namespace Mpeg2VideoCodes {
646 enum KnownValue : byte { Pic = 0x00, Seq = 0xB3, Ext = 0xB5, Gop = 0xB8 };
647 }
648 
652 enum class Mp4TagMediaType : byte {
653  Movie = 0,
654  Music = 1,
655  Audiobook = 2,
656  MusicVideo = 6,
657  Movie2 = 9,
658  TvShow = 10,
659  Booklet = 11,
660  Ringtone = 14
661 };
662 
666 enum class Mp4TagContentRating : byte {
667  None = 0,
668  Clean = 2,
669  Explicit = 4
670 };
671 
675 enum class AccountType : byte { Itunes = 0, Aol = 1, Undefined = 255 };
676 
680 enum class CountryCode {
681  Usa = 143441,
682  Fra = 143442,
683  Deu = 143443,
684  Gbr = 143444,
685  Aut = 143445,
686  Bel = 143446,
687  Fin = 143447,
688  Grc = 143448,
689  Irl = 143449,
690  Ita = 143450,
691  Lux = 143451,
692  Nld = 143452,
693  Prt = 143453,
694  Esp = 143454,
695  Can = 143455,
696  Swe = 143456,
697  Nor = 143457,
698  Dnk = 143458,
699  Che = 143459,
700  Aus = 143460,
701  Nzl = 143461,
702  Jpn = 143462,
703  Undefined = 0
704 };
705 
706 } // namespace TagParser
707 
708 #endif // TAG_PARSER_MP4IDS_H
TAG_PARSER_EXPORT byte channelCount(byte config)
Returns the channel count for the specified MPEG-4 channel config.
Definition: mp4ids.cpp:452
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
Definition: mediaformat.h:13
The MediaFormat class specifies the format of media data.
Definition: mediaformat.h:244
The Av1Configuration struct provides a parser for AV1 configuration found in ISOBMFF files...
Mp4TagMediaType
Specifies the tag type.
Definition: mp4ids.h:652
CountryCode
Specifies the country.
Definition: mp4ids.h:680
AccountType
Specifies the account type.
Definition: mp4ids.h:675
TAG_PARSER_EXPORT MediaFormat idToMediaFormat(byte mpeg4AudioObjectId, bool sbrPresent=false, bool psPresent=false)
Definition: mp4ids.cpp:359
The AvcConfiguration struct provides a parser for AVC configuration.
Mp4TagContentRating
Specifies the tag content rating.
Definition: mp4ids.h:666
TAG_PARSER_EXPORT const char * streamTypeName(byte streamTypeId)
Returns the name of the stream type denoted by the specified MPEG-4 stream type ID.
Definition: mp4ids.cpp:317
TAG_PARSER_EXPORT const char * channelConfigString(byte config)
Returns the string representation for the specified MPEG-4 channel config.
Definition: mp4ids.cpp:425
TAG_PARSER_EXPORT MediaFormat fourccToMediaFormat(uint32 fourccId)
Definition: mp4ids.cpp:46
TAG_PARSER_EXPORT MediaFormat streamObjectTypeFormat(byte streamObjectTypeId)
Returns the TagParser::MediaFormat denoted by the specified MPEG-4 stream ID.
Definition: mp4ids.cpp:209
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:9
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
uint32 mpeg4SamplingFrequencyTable[13]
Definition: mp4ids.cpp:415