Debian Codegraph @

src/com/drew/metadata/mp4/Mp4Dictionary.java

raw symbols SCIP
1 /*
2 * Copyright 2002-2019 Drew Noakes and contributors
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * More information about this project is available at:
17 *
18 * https://drewnoakes.com/code/exif/
19 * https://github.com/drewnoakes/metadata-extractor
20 */
21 package com.drew.metadata.mp4;
22
23 import com.drew.metadata.mp4.media.Mp4SoundDirectory;
24 import com.drew.metadata.mp4.media.Mp4VideoDirectory;
25
26 import java.util.HashMap;
27
28 public class Mp4Dictionary
29 {
30 private static HashMap<Integer, HashMap<String, String>> _dictionary = new HashMap<Integer, HashMap<String, String>>();
31
32 private static HashMap<String, String> _majorBrands = new HashMap<String, String>();
33
34 private static HashMap<String, String> _videoCompressionTypes = new HashMap<String, String>();
35
36 private static HashMap<String, String> _soundAudioFormats = new HashMap<String, String>();
37
38 private static HashMap<String, String> _vendorIds = new HashMap<String, String>();
39
40 static {
41 _dictionary.put(Mp4Directory.TAG_MAJOR_BRAND, _majorBrands);
42 _dictionary.put(Mp4VideoDirectory.TAG_COMPRESSION_TYPE, _videoCompressionTypes);
43 _dictionary.put(Mp4SoundDirectory.TAG_AUDIO_FORMAT, _soundAudioFormats);
44 _dictionary.put(Mp4VideoDirectory.TAG_VENDOR, _vendorIds);
45
46 // Video Compression Types
47 _videoCompressionTypes.put("3IVX", "3ivx MPEG-4");
48 _videoCompressionTypes.put("3IV1", "3ivx MPEG-4 v1");
49 _videoCompressionTypes.put("3IV2", "3ivx MPEG-4 v2");
50 _videoCompressionTypes.put("avr ", "AVR-JPEG");
51 _videoCompressionTypes.put("base", "Base");
52 _videoCompressionTypes.put("WRLE", "BMP");
53 _videoCompressionTypes.put("cvid", "Cinepak");
54 _videoCompressionTypes.put("clou", "Cloud");
55 _videoCompressionTypes.put("cmyk", "CMYK");
56 _videoCompressionTypes.put("yuv2", "ComponentVideo");
57 _videoCompressionTypes.put("yuvu", "ComponentVideoSigned");
58 _videoCompressionTypes.put("yuvs", "ComponentVideoUnsigned");
59 _videoCompressionTypes.put("dvc ", "DVC-NTSC");
60 _videoCompressionTypes.put("dvcp", "DVC-PAL");
61 _videoCompressionTypes.put("dvpn", "DVCPro-NTSC");
62 _videoCompressionTypes.put("dvpp", "DVCPro-PAL");
63 _videoCompressionTypes.put("fire", "Fire");
64 _videoCompressionTypes.put("flic", "FLC");
65 _videoCompressionTypes.put("b48r", "48RGB");
66 _videoCompressionTypes.put("gif ", "GIF");
67 _videoCompressionTypes.put("smc ", "Graphics");
68 _videoCompressionTypes.put("h261", "Apple H261");
69 _videoCompressionTypes.put("h263", "Apple VC H.263");
70 _videoCompressionTypes.put("IV41", "Indeo4");
71 _videoCompressionTypes.put("jpeg", "JPEG");
72 _videoCompressionTypes.put("PNTG", "MacPaint");
73 _videoCompressionTypes.put("msvc", "Microsoft Video1");
74 _videoCompressionTypes.put("mjpa", "Apple Motion JPEG-A");
75 _videoCompressionTypes.put("mjpb", "Apple Motion JPEG-B");
76 _videoCompressionTypes.put("myuv", "MPEG YUV420");
77 _videoCompressionTypes.put("dmb1", "OpenDML JPEG");
78 _videoCompressionTypes.put("kpcd", "PhotoCD");
79 _videoCompressionTypes.put("8BPS", "Planar RGB");
80 _videoCompressionTypes.put("png ", "PNG");
81 _videoCompressionTypes.put("qdrw", "QuickDraw");
82 _videoCompressionTypes.put("qdgx", "QuickDrawGX");
83 _videoCompressionTypes.put("raw ", "RAW");
84 _videoCompressionTypes.put(".SGI", "SGI");
85 _videoCompressionTypes.put("b16g", "16Gray");
86 _videoCompressionTypes.put("b64a", "64ARGB");
87 _videoCompressionTypes.put("SVQ1", "Sorenson Video 1");
88 _videoCompressionTypes.put("SVQ3", "Sorenson Video 3");
89 _videoCompressionTypes.put("syv9", "Sorenson YUV9");
90 _videoCompressionTypes.put("tga ", "Targa");
91 _videoCompressionTypes.put("b32a", "32AlphaGray");
92 _videoCompressionTypes.put("tiff", "TIFF");
93 _videoCompressionTypes.put("path", "Vector");
94 _videoCompressionTypes.put("rpza", "Video (Road Pizza)");
95 _videoCompressionTypes.put("ripl", "WaterRipple");
96 _videoCompressionTypes.put("WRAW", "Windows RAW");
97 _videoCompressionTypes.put("y420", "YUV420");
98 _videoCompressionTypes.put("avc1", "H.264");
99 _videoCompressionTypes.put("mp4v", "MPEG-4");
100 _videoCompressionTypes.put("MP4V", "MPEG-4");
101 _videoCompressionTypes.put("dvhp", "DVCPRO HD 720p60");
102 _videoCompressionTypes.put("hdv2", "HDV 1080i60");
103 _videoCompressionTypes.put("dvc+", "DV/DVCPRO - NTSC");
104 _videoCompressionTypes.put("mx5p", "MPEG2 IMX 635/50 50mb/s");
105 _videoCompressionTypes.put("mx3n", "MPEG2 IMX 635/50 30mb/s");
106 _videoCompressionTypes.put("dv5p", "DVCPRO50");
107 _videoCompressionTypes.put("hdv3", "HDV Final Cut Pro");
108 _videoCompressionTypes.put("rle ", "Animation");
109 _videoCompressionTypes.put("rle ", "Animation");
110 _videoCompressionTypes.put("2vuY", "Uncompressed Y'CbCr, 8-bit-per-component 4:2:2");
111 _videoCompressionTypes.put("v308", "Uncompressed Y'CbCr, 8-bit-per-component 4:4:4");
112 _videoCompressionTypes.put("v408", "Uncompressed Y'CbCr, 8-bit-per-component 4:4:4:4");
113 _videoCompressionTypes.put("v216", "Uncompressed Y'CbCr, 10, 12, 14, or 16-bit-per-component 4:2:2");
114 _videoCompressionTypes.put("v410", "Uncompressed Y'CbCr, 10-bit-per-component 4:4:4");
115 _videoCompressionTypes.put("v210", "Uncompressed Y'CbCr, 10-bit-per-component 4:2:2");
116
117 // Sound Audio Formats
118 _soundAudioFormats.put("NONE", "");
119 _soundAudioFormats.put("raw ", "Uncompressed in offset-binary format");
120 _soundAudioFormats.put("twos", "Uncompressed in two's-complement format");
121 _soundAudioFormats.put("sowt", "16-bit little-endian, twos-complement");
122 _soundAudioFormats.put("MAC3", "MACE 3:1");
123 _soundAudioFormats.put("MAC6", "MACE 6:1");
124 _soundAudioFormats.put("ima4", "IMA 4:1");
125 _soundAudioFormats.put("fl32", "32-bit floating point");
126 _soundAudioFormats.put("fl64", "64-bit floating point");
127 _soundAudioFormats.put("in24", "24-bit integer");
128 _soundAudioFormats.put("in32", "32-bit integer");
129 _soundAudioFormats.put("ulaw", "uLaw 2:1");
130 _soundAudioFormats.put("alaw", "uLaw 2:1");
131 _soundAudioFormats.put(new String(new byte[]{0x6D, 0x73, 0x00, 0x02}), "Microsoft ADPCM-ACM code 2");
132 _soundAudioFormats.put(new String(new byte[]{0x6D, 0x73, 0x00, 0x11}), "DVI/Intel IMAADPCM-ACM code 17");
133 _soundAudioFormats.put("dvca", "DV Audio");
134 _soundAudioFormats.put("QDMC", "QDesign music");
135 _soundAudioFormats.put("QDM2", "QDesign music version 2");
136 _soundAudioFormats.put("Qclp", "QUALCOMM PureVoice");
137 _soundAudioFormats.put(new String(new byte[]{0x6D, 0x73, 0x00, 0x55}), "MPEG-1 layer 3, CBR only (pre-QT4.1)");
138 _soundAudioFormats.put(".mp3", "MPEG-1 layer 3, CBR & VBR (QT4.1 and later)");
139 _soundAudioFormats.put("mp4a", "MPEG-4, Advanced Audio Coding (AAC)");
140 _soundAudioFormats.put("ac-3", "Digital Audio Compression Standard (AC-3, Enhanced AC-3)");
141 _soundAudioFormats.put("aac ", "ISO/IEC 144963-3 AAC");
142 _soundAudioFormats.put("agsm", "Apple GSM 10:1");
143 _soundAudioFormats.put("alac", "Apple Lossless Audio Codec");
144 _soundAudioFormats.put("conv", "Sample Format");
145 _soundAudioFormats.put("dvi ", "DV 4:1");
146 _soundAudioFormats.put("eqal", "Frequency Equalizer");
147 _soundAudioFormats.put("lpc ", "LPC 23:1");
148 _soundAudioFormats.put("mixb", "8-bit Mixer");
149 _soundAudioFormats.put("mixw", "16-bit Mixer");
150 _soundAudioFormats.put(new String(new byte[] {0x4d, 0x53, 0x00, 0x02}), "Microsoft ADPCM");
151 _soundAudioFormats.put(new String(new byte[] {0x4d, 0x53, 0x00, 0x11}), "DV IMA");
152 _soundAudioFormats.put(new String(new byte[] {0x4d, 0x53, 0x00, 0x55}), "MPEG3");
153 _soundAudioFormats.put("ratb", "8-bit Rate");
154 _soundAudioFormats.put("ratw", "16-bit Rate");
155 _soundAudioFormats.put("sour", "Sound Source");
156 _soundAudioFormats.put("str1", "Iomega MPEG layer II");
157 _soundAudioFormats.put("str2", "Iomega MPEG *layer II");
158 _soundAudioFormats.put("str3", "Iomega MPEG **layer II");
159 _soundAudioFormats.put("str4", "Iomega MPEG ***layer II");
160 _soundAudioFormats.put("lpcm", "Linear Pulse Code Modulation");
161
162 // Major Brands
163 _majorBrands.put("3g2a", "3GPP2 Media (.3G2) compliant with 3GPP2 C.S0050-0 V1.0");
164 _majorBrands.put("3g2b", "3GPP2 Media (.3G2) compliant with 3GPP2 C.S0050-A V1.0.0");
165 _majorBrands.put("3g2c", "3GPP2 Media (.3G2) compliant with 3GPP2 C.S0050-B v1.0");
166 _majorBrands.put("3ge6", "3GPP (.3GP) Release 6 MBMS Extended Presentations");
167 _majorBrands.put("3ge7", "3GPP (.3GP) Release 7 MBMS Extended Presentations");
168 _majorBrands.put("3gg6", "3GPP Release 6 General Profile");
169 _majorBrands.put("3gp1", "3GPP Media (.3GP) Release 1 (probably non-existent)");
170 _majorBrands.put("3gp2", "3GPP Media (.3GP) Release 2 (probably non-existent)");
171 _majorBrands.put("3gp3", "3GPP Media (.3GP) Release 3 (probably non-existent)");
172 _majorBrands.put("3gp4", "3GPP Media (.3GP) Release 4");
173 _majorBrands.put("3gp5", "3GPP Media (.3GP) Release 5");
174 _majorBrands.put("3gp6", "3GPP Media (.3GP) Release 6 Basic Profile");
175 _majorBrands.put("3gp6", "3GPP Media (.3GP) Release 6 Progressive Download");
176 _majorBrands.put("3gp6", "3GPP Media (.3GP) Release 6 Streaming Servers");
177 _majorBrands.put("3gs7", "3GPP Media (.3GP) Release 7 Streaming Servers");
178 _majorBrands.put("avc1", "MP4 Base w/ AVC ext [ISO 14496-12:2005]");
179 _majorBrands.put("CAEP", "Canon Digital Camera");
180 _majorBrands.put("caqv", "Casio Digital Camera");
181 _majorBrands.put("CDes", "Convergent Design");
182 _majorBrands.put("da0a", "DMB MAF w/ MPEG Layer II aud, MOT slides, DLS, JPG/PNG/MNG images");
183 _majorBrands.put("da0b", "DMB MAF, extending DA0A, with 3GPP timed text, DID, TVA, REL, IPMP");
184 _majorBrands.put("da1a", "DMB MAF audio with ER-BSAC audio, JPG/PNG/MNG images");
185 _majorBrands.put("da1b", "DMB MAF, extending da1a, with 3GPP timed text, DID, TVA, REL, IPMP");
186 _majorBrands.put("da2a", "DMB MAF aud w/ HE-AAC v2 aud, MOT slides, DLS, JPG/PNG/MNG images");
187 _majorBrands.put("da2b", "DMB MAF, extending da2a, with 3GPP timed text, DID, TVA, REL, IPMP");
188 _majorBrands.put("da3a", "DMB MAF aud with HE-AAC aud, JPG/PNG/MNG images");
189 _majorBrands.put("da3b", "DMB MAF, extending da3a w/ BIFS, 3GPP timed text, DID, TVA, REL, IPMP");
190 _majorBrands.put("dmb1", "DMB MAF supporting all the components defined in the specification");
191 _majorBrands.put("dmpf", "Digital Media Project");
192 _majorBrands.put("drc1", "Dirac (wavelet compression), encapsulated in ISO base media (MP4)");
193 _majorBrands.put("dv1a", "DMB MAF vid w/ AVC vid, ER-BSAC aud, BIFS, JPG/PNG/MNG images, TS");
194 _majorBrands.put("dv1b", "DMB MAF, extending dv1a, with 3GPP timed text, DID, TVA, REL, IPMP");
195 _majorBrands.put("dv2a", "DMB MAF vid w/ AVC vid, HE-AAC v2 aud, BIFS, JPG/PNG/MNG images, TS");
196 _majorBrands.put("dv2b", "DMB MAF, extending dv2a, with 3GPP timed text, DID, TVA, REL, IPMP");
197 _majorBrands.put("dv3a", "DMB MAF vid w/ AVC vid, HE-AAC aud, BIFS, JPG/PNG/MNG images, TS");
198 _majorBrands.put("dv3b", "DMB MAF, extending dv3a, with 3GPP timed text, DID, TVA, REL, IPMP");
199 _majorBrands.put("dvr1", "DVB (.DVB) over RTP");
200 _majorBrands.put("dvt1", "DVB (.DVB) over MPEG-2 Transport Stream");
201 _majorBrands.put("F4V ", "Video for Adobe Flash Player 9+ (.F4V)");
202 _majorBrands.put("F4P ", "Protected Video for Adobe Flash Player 9+ (.F4P)");
203 _majorBrands.put("F4A ", "Audio for Adobe Flash Player 9+ (.F4A)");
204 _majorBrands.put("F4B ", "Audio Book for Adobe Flash Player 9+ (.F4B)");
205 _majorBrands.put("isc2", "ISMACryp 2.0 Encrypted File");
206 _majorBrands.put("iso2", "MP4 Base Media v2 [ISO 14496-12:2005]");
207 _majorBrands.put("isom", "MP4  Base Media v1 [IS0 14496-12:2003]");
208 _majorBrands.put("JP2 ", "JPEG 2000 Image (.JP2) [ISO 15444-1 ?]");
209 _majorBrands.put("JP20", "Unknown, from GPAC samples (prob non-existent)");
210 _majorBrands.put("jpm ", "JPEG 2000 Compound Image (.JPM) [ISO 15444-6]");
211 _majorBrands.put("jpx ", "JPEG 2000 w/ extensions (.JPX) [ISO 15444-2]");
212 _majorBrands.put("KDDI", "3GPP2 EZmovie for KDDI 3G cellphones");
213 _majorBrands.put("M4A ", "Apple iTunes AAC-LC (.M4A) Audio");
214 _majorBrands.put("M4B ", "Apple iTunes AAC-LC (.M4B) Audio Book");
215 _majorBrands.put("M4P ", "Apple iTunes AAC-LC (.M4P) AES Protected Audio");
216 _majorBrands.put("M4V ", "Apple iTunes Video (.M4V) Video");
217 _majorBrands.put("M4VH", "Apple TV (.M4V)");
218 _majorBrands.put("M4VP", "Apple iPhone (.M4V)");
219 _majorBrands.put("mj2s", "Motion JPEG 2000 [ISO 15444-3] Simple Profile");
220 _majorBrands.put("mjp2", "Motion JPEG 2000 [ISO 15444-3] General Profile");
221 _majorBrands.put("mmp4", "MPEG-4/3GPP Mobile Profile (.MP4 / .3GP) (for NTT)");
222 _majorBrands.put("mp21", "MPEG-21 [ISO/IEC 21000-9]");
223 _majorBrands.put("mp41", "MP4 v1 [ISO 14496-1:ch13]");
224 _majorBrands.put("mp42", "MP4 v2 [ISO 14496-14]");
225 _majorBrands.put("mp71", "MP4 w/ MPEG-7 Metadata [per ISO 14496-12]");
226 _majorBrands.put("MPPI", "Photo Player, MAF [ISO/IEC 23000-3]");
227 _majorBrands.put("mqt ", "Sony / Mobile QuickTime (.MQV)  US Patent 7,477,830 (Sony Corp)");
228 _majorBrands.put("MSNV", "MPEG-4 (.MP4) for SonyPSP");
229 _majorBrands.put("NDAS", "MP4 v2 [ISO 14496-14] Nero Digital AAC Audio");
230 _majorBrands.put("NDSC", "MPEG-4 (.MP4) Nero Cinema Profile");
231 _majorBrands.put("NDSH", "MPEG-4 (.MP4) Nero HDTV Profile");
232 _majorBrands.put("NDSM", "MPEG-4 (.MP4) Nero Mobile Profile");
233 _majorBrands.put("NDSP", "MPEG-4 (.MP4) Nero Portable Profile");
234 _majorBrands.put("NDSS", "MPEG-4 (.MP4) Nero Standard Profile");
235 _majorBrands.put("NDXC", "H.264/MPEG-4 AVC (.MP4) Nero Cinema Profile");
236 _majorBrands.put("NDXH", "H.264/MPEG-4 AVC (.MP4) Nero HDTV Profile");
237 _majorBrands.put("NDXM", "H.264/MPEG-4 AVC (.MP4) Nero Mobile Profile");
238 _majorBrands.put("NDXP", "H.264/MPEG-4 AVC (.MP4) Nero Portable Profile");
239 _majorBrands.put("NDXS", "H.264/MPEG-4 AVC (.MP4) Nero Standard Profile");
240 _majorBrands.put("odcf", "OMA DCF DRM Format 2.0 (OMA-TS-DRM-DCF-V2_0-20060303-A)");
241 _majorBrands.put("opf2", "OMA PDCF DRM Format 2.1 (OMA-TS-DRM-DCF-V2_1-20070724-C)");
242 _majorBrands.put("opx2", "OMA PDCF DRM + XBS extensions (OMA-TS-DRM_XBS-V1_0-20070529-C)");
243 _majorBrands.put("pana", "Panasonic Digital Camera");
244 _majorBrands.put("qt ", "Apple QuickTime (.MOV/QT)");
245 _majorBrands.put("ROSS", "Ross Video");
246 _majorBrands.put("sdv ", "SD Memory Card Video");
247 _majorBrands.put("ssc1", "Samsung stereoscopic, single stream (patent pending, see notes)");
248 _majorBrands.put("ssc2", "Samsung stereoscopic, dual stream (patent pending, see notes)");
249
250 // Vendor ID's https://sno.phy.queensu.ca/~phil/exiftool/TagNames/QuickTime.html#Meta
251 _vendorIds.put(" KD ", "Kodak");
252 _vendorIds.put("AR.D", "Parrot AR.Drone");
253 _vendorIds.put("FFMP", "FFmpeg");
254 _vendorIds.put("GIC ", "General Imaging Co.");
255 _vendorIds.put("KMPI", "Konica-Minolta");
256 _vendorIds.put("NIKO", "Nikon");
257 _vendorIds.put("SMI ", "Sorenson Media Inc.");
258 _vendorIds.put("ZORA", "Zoran Corporation");
259 _vendorIds.put("appl", "Apple");
260 _vendorIds.put("fe20", "Olympus (fe20)");
261 _vendorIds.put("kdak", "Kodak");
262 _vendorIds.put("leic", "Leica");
263 _vendorIds.put("mino", "Minolta");
264 _vendorIds.put("niko", "Nikon");
265 _vendorIds.put("olym", "Olympus");
266 _vendorIds.put("pana", "Panasonic");
267 _vendorIds.put("pent", "Pentax");
268 _vendorIds.put("pr01", "Olympus (pr01)");
269 _vendorIds.put("sany", "Sanyo");
270
271 }
272
273 public static String lookup(int scope, String lookup)
274 {
275 if (_dictionary.containsKey(scope) && _dictionary.get(scope).containsKey(lookup)) {
276 return _dictionary.get(scope).get(lookup);
277 } else {
278 return "Unknown";
279 }
280 }
281
282 public static void setLookup(int scope, String lookup, Mp4Directory directory)
283 {
284 String results = lookup(scope, lookup);
285 directory.setString(scope, results);
286 }
287 }