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