Tag Parser 10.3.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 <cstdint>
7#include <string_view>
8
9namespace TagParser {
10
11class MediaFormat;
12
13namespace Mp4AtomIds {
14enum KnownValue : std::uint32_t {
15 Av1Configuration = 0x61763143,
16 AvcConfiguration = 0x61766343,
17 BitrateBox = 0x62747274,
18 CleanAperature = 0x636c6170,
19 ChunkOffset64 = 0x636f3634,
21 Data = 0x64617461,
22 DataInformation = 0x64696e66,
23 DataReference = 0x64726566,
24 Drms = 0x64726D73,
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,
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,
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
84namespace Mp4TagAtomIds {
85enum KnownValue : std::uint32_t {
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
126namespace Mp4TagExtendedMeanIds {
127extern std::string_view iTunes;
128}
129
130namespace Mp4TagExtendedNameIds {
131extern std::string_view cdec;
132extern std::string_view label;
133} // namespace Mp4TagExtendedNameIds
134
135namespace Mp4MediaTypeIds {
136enum KnownValue : std::uint32_t {
137 Sound = 0x736f756e,
138 Video = 0x76696465,
139 Hint = 0x68696e74,
140 Meta = 0x6d657461,
141};
142}
143
144namespace FourccIds {
145enum KnownValue : std::uint32_t {
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,
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 Flac = 0x664C6143,
273 FlashPixImage = 0x66706978,
275 FloatingPoint32Bit = 0x666C3332,
276 FloatingPoint64Bit = 0x666C3634,
277 GeneralConvolution = 0x67656E6B,
278 Gif = 0x67696620,
279 Glass = 0x676C6173,
280 GradientWipe = 0x6D617474,
281 Graphics = 0x736D6320,
282 H263Quicktime = 0x68323633,
283 H2633GPP = 0x73323633,
284 H264Decoder1 = 0x44415643,
285 H264Decoder2 = 0x48323634,
286 H264Decoder3 = 0x56535348,
287 H264Decoder4 = 0x58323634,
288 H264Decoder5 = 0x68323634,
289 H264Decoder6 = 0x78323634,
290 Hdv3 = 0x68647633,
291 Hevc1 = 0x68766331,
292 Hevc2 = 0x68657631,
293 HslBalance = 0x68736C62,
294 Ima4 = 0x696D6134,
295 Ima41 = 0x696D6134,
296 ImaadpcmAcm = 0x6D730011,
297 Implode = 0x6D706C6F,
298 Int16Be = 0x74776F73,
299 Int16Le = 0x736F7774,
300 Int24 = 0x696E3234,
301 Int32 = 0x696E3332,
302 Iris = 0x736D7032,
303 IvxDecoder1 = 0x33495632,
304 IvxDecoder2 = 0x33495644,
305 IvxDecoder3 = 0x33697632,
306 IvxDecoder4 = 0x33697664,
307 Jpeg = 0x6a706567,
308 Jpeg2000Decoder = 0x6D6A7032,
309 Law21 = 0x756C6177,
310 LensFlare = 0x6C656E73,
311 Lle = 0x726C6520,
312 Mac3 = 0x6D616333,
313 Mac6 = 0x6D616336,
314 Mace31 = 0x4D414333,
315 Mace61 = 0x4D414336,
316 MatrixWipe = 0x736D7034,
317 DolbyMpl = 0x6D6C7061,
318 MotionJpegA = 0x6D6A7061,
319 MotionJpegB = 0x6D6A7062,
320 Mp3 = 0x2e6d7033,
321 Mp3CbrOnly = 0x6D730055,
322 Mpeg = 0x4D504547,
323 Mpeg2Imx30 = 0x6D78336E,
324 Mpeg2Imx50 = 0x6D783570,
325 Mpeg4Audio = 0x6d703461,
326 Mpeg4Decoder1 = 0x464D5034,
327 Mpeg4Decoder2 = 0x53454447,
328 Mpeg4Decoder3 = 0x57563146,
329 Mpeg4Sample = 0x6d703473,
330 Mpeg4TimedText = 0x74783367,
331 Mpeg4Video = 0x6d703476,
332 MsMpeg4V1Decoder1 = 0x44495631,
333 MsMpeg4V1Decoder2 = 0x64697631,
334 MsMpeg4V1Decoder3 = 0x4D504734,
335 MsMpeg4V1Decoder4 = 0x6D706734,
336 MsMpeg4V1Decoder5 = 0x4D504731,
337 MsMpeg4V1Decoder6 = 0x6D706731,
338 MsMpeg4V2Decoder1 = 0x44495632,
339 MsMpeg4V2Decoder2 = 0x64697632,
340 MsMpeg4V2Decoder3 = 0x4D503432,
341 MsMpeg4V2Decoder4 = 0x6D703432,
342 MsMpeg4V3Decoder1 = 0x4D503433,
343 MsMpeg4V3Decoder2 = 0x6D703433,
344 NtscDv25Video = 0x64766320,
345 Oggs = 0x4F676753,
346 Opus = 0x4F707573,
347 PalDv25Video = 0x64766370,
348 PdfImage = 0x70646620,
349 Png = 0x706E6720,
350 Push = 0x70757368,
351 Qclp = 0x51636C70,
352 QdesignMusic1Decoder = 0x51444D43,
353 QdesignMusic2 = 0x51444D32,
354 Qdmc = 0x51444D43,
355 Qdrw = 0x71647277,
356 QtvrCubicCodec = 0x63757061,
357 QtvrCylindricalCodec = 0x6C747061,
358 QualcommPurevoice = 0x51636C70,
359 QualcommQcelp = 0x51636C71,
360 Radial = 0x736D7033,
361 Raw = 0x72617720,
362 RgbBalance = 0x72676262,
363 Ripple = 0x7269706C,
364 Rpza = 0x72707A61,
365 Rv20 = 0x52563230,
366 Rv30 = 0x52563330,
367 Rv40 = 0x52563430,
368 Sharpen = 0x73687270,
369 Slide = 0x736C6964,
370 Smc = 0x736D6320,
371 SorensonH263Decoder = 0x464C5631,
374 Sowt = 0x736F7774,
376 Svq1 = 0x73767131,
377 Svq3 = 0x73767133,
378 Tiff = 0x74696666,
379 TravelingMatte = 0x74726176,
382 Twos = 0x74776F73,
383 Ulaw = 0x756C6177,
384 Ulaw21 = 0x756C6177,
385 VcmImageCodec = 0x4D6A7067,
386 Vdva = 0x76647661,
387 Vp8 = 0x56503830,
388 Vp9 = 0x56503930,
389 Vp9_2 = 0x76703039,
390 WavPack = 0x5756504B,
391 WindowsMediaAudio = 0x6F776D61,
392 WindowsMediaAudio7 = 0x574D4131,
395 WindowsMediaVideoV17 = 0x574D5637,
396 WindowsMediaVideoV2 = 0x574D5632,
397 WindowsMediaVideoV8 = 0x574D5638,
398 Wipe = 0x736D7074,
399 WmvImageCodec1 = 0x4D347332,
400 WmvImageCodec2 = 0x4D703432,
401 WmvImageCodec3 = 0x4D703433,
402 WmvImageCodec4 = 0x4D703453,
403 WmvImageCodec5 = 0x574D5631,
404 WmvImageCodec6 = 0x574D5632,
405 WmvImageCodec7 = 0x574D5633,
406 XvidDecoder1 = 0x424C5A30,
407 XvidDecoder2 = 0x58564944,
408 XvidDecoder3 = 0x58564958,
409 XvidDecoder4 = 0x58766944,
410 XvidDecoder5 = 0x78766964,
416 Zoom = 0x7A6F6F6D,
417};
418
420
421} // namespace FourccIds
422
423namespace Mp4FormatExtensionIds {
424enum KnownValue : std::uint32_t {
426 = 0x67616D61,
427 FieldHandling = 0x6669656C,
429 DefaultHuffmanTable = 0x6D6A6874,
431 = 0x65736473,
434 = 0x61766343,
435 PixelAspectRatio = 0x70617370,
436 ColorParameters = 0x636F6C72,
437 CleanAperature = 0x636C6170,
438};
439}
440
441namespace Mpeg4ElementaryStreamObjectIds {
442enum KnownValue : std::uint8_t {
446 AfxStream = 0x05,
450 Mpeg4Visual = 0x20,
453 Als = 0x24,
454 Sa0c = 0x2B,
455 Aac = 0x40,
470 Evrc = 0xA0,
481 PrivateEvrc = 0xD1,
482 PrivateAc3 = 0xD3,
484 PrivateOgg = 0xDD,
488};
489
490TAG_PARSER_EXPORT MediaFormat streamObjectTypeFormat(std::uint8_t streamObjectTypeId);
491
492} // namespace Mpeg4ElementaryStreamObjectIds
493
494namespace Mpeg4ElementaryStreamTypeIds {
495enum KnownValue : std::uint8_t {
510
511TAG_PARSER_EXPORT std::string_view streamTypeName(std::uint8_t streamTypeId);
512
513} // namespace Mpeg4ElementaryStreamTypeIds
514
515namespace Mpeg4DescriptorIds {
516enum KnownValue : std::uint8_t {
558 UserPrivate = 0xC0
560}
561
562namespace Mpeg4AudioObjectIds {
563enum KnownValue : std::uint8_t {
564 Null = 0,
574 Ttsi = 12,
605 Usac
607
608TAG_PARSER_EXPORT MediaFormat idToMediaFormat(std::uint8_t mpeg4AudioObjectId, bool sbrPresent = false, bool psPresent = false);
609
610} // namespace Mpeg4AudioObjectIds
611
612extern std::uint32_t mpeg4SamplingFrequencyTable[13];
613
614namespace Mpeg4ChannelConfigs {
615enum Mpeg4ChannelConfig : std::uint8_t {
625
626TAG_PARSER_EXPORT std::string_view channelConfigString(std::uint8_t config);
627TAG_PARSER_EXPORT std::uint8_t channelCount(std::uint8_t config);
628
629} // namespace Mpeg4ChannelConfigs
630
631namespace Mpeg4VideoCodes {
632enum KnownValue : std::uint8_t {
641 VopStart = 0xB6,
651 StuffingStart = 0xC3
653}
654
655namespace Mpeg2VideoCodes {
656enum KnownValue : std::uint8_t { Pic = 0x00, Seq = 0xB3, Ext = 0xB5, Gop = 0xB8 };
657}
658
662enum class Mp4TagMediaType : std::uint8_t {
663 Movie = 0,
664 Music = 1,
665 Audiobook = 2,
666 MusicVideo = 6,
667 Movie2 = 9,
668 TvShow = 10,
669 Booklet = 11,
670 Ringtone = 14
671};
672
676enum class Mp4TagContentRating : std::uint8_t {
677 None = 0,
678 Clean = 2,
679 Explicit = 4
680};
681
685enum class AccountType : std::uint8_t { Itunes = 0, Aol = 1, Undefined = 255 };
686
690enum class CountryCode {
691 Usa = 143441,
692 Fra = 143442,
693 Deu = 143443,
694 Gbr = 143444,
695 Aut = 143445,
696 Bel = 143446,
697 Fin = 143447,
698 Grc = 143448,
699 Irl = 143449,
700 Ita = 143450,
701 Lux = 143451,
702 Nld = 143452,
703 Prt = 143453,
704 Esp = 143454,
705 Can = 143455,
706 Swe = 143456,
707 Nor = 143457,
708 Dnk = 143458,
709 Che = 143459,
710 Aus = 143460,
711 Nzl = 143461,
712 Jpn = 143462,
713 Undefined = 0
714};
715
716} // namespace TagParser
717
718#endif // TAG_PARSER_MP4IDS_H
The MediaFormat class specifies the format of media data.
Definition: mediaformat.h:246
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
@ Yuv422HardwareAccelerationCodecYuvs5
Definition: mp4ids.h:415
@ WindowsMediaAudio9Professional
Definition: mp4ids.h:393
@ Yuv422HardwareAccelerationCodecYuvs1
Definition: mp4ids.h:411
@ Yuv422HardwareAccelerationCodecYuvs3
Definition: mp4ids.h:413
@ WindowsMediaAudio9Standard
Definition: mp4ids.h:394
@ Yuv422HardwareAccelerationCodecYuvs4
Definition: mp4ids.h:414
@ Yuv422HardwareAccelerationCodecYuvs2
Definition: mp4ids.h:412
TAG_PARSER_EXPORT MediaFormat fourccToMediaFormat(std::uint32_t fourccId)
Definition: mp4ids.cpp:47
@ ProgressiveDownloadInformation
Definition: mp4ids.h:52
@ IndependentAndDisposableSamples
Definition: mp4ids.h:54
TAG_PARSER_EXPORT MediaFormat idToMediaFormat(std::uint8_t mpeg4AudioObjectId, bool sbrPresent=false, bool psPresent=false)
Definition: mp4ids.cpp:367
TAG_PARSER_EXPORT std::string_view channelConfigString(std::uint8_t config)
Returns the string representation for the specified MPEG-4 channel config.
Definition: mp4ids.cpp:433
@ FrontCenterFrontLeftFrontRightBackLeftBackRightLFEChannel
Definition: mp4ids.h:622
@ FrontCenterFrontLeftFrontRightSideLeftSideRightBackLeftBackRightLFEChannel
Definition: mp4ids.h:623
@ FrontCenterFrontLeftFrontRightBackLeftBackRight
Definition: mp4ids.h:621
TAG_PARSER_EXPORT std::uint8_t channelCount(std::uint8_t config)
Returns the channel count for the specified MPEG-4 channel config.
Definition: mp4ids.cpp:460
TAG_PARSER_EXPORT MediaFormat streamObjectTypeFormat(std::uint8_t streamObjectTypeId)
Returns the TagParser::MediaFormat denoted by the specified MPEG-4 stream ID.
Definition: mp4ids.cpp:215
TAG_PARSER_EXPORT std::string_view streamTypeName(std::uint8_t streamTypeId)
Returns the name of the stream type denoted by the specified MPEG-4 stream type ID.
Definition: mp4ids.cpp:325
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:10
AccountType
Specifies the account type.
Definition: mp4ids.h:685
Mp4TagContentRating
Specifies the tag content rating.
Definition: mp4ids.h:676
CountryCode
Specifies the country.
Definition: mp4ids.h:690
Mp4TagMediaType
Specifies the tag type.
Definition: mp4ids.h:662
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
Definition: mediaformat.h:14
std::uint32_t mpeg4SamplingFrequencyTable[13]
Definition: mp4ids.cpp:423
The Av1Configuration struct provides a parser for AV1 configuration found in ISOBMFF files.
The AvcConfiguration struct provides a parser for AVC configuration.