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