Debian Codegraph @

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