/
QuickTime.pm
9595 lines (9418 loc) · 404 KB
/
QuickTime.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#------------------------------------------------------------------------------
# File: QuickTime.pm
#
# Description: Read QuickTime and MP4 meta information
#
# Revisions: 10/04/2005 - P. Harvey Created
# 12/19/2005 - P. Harvey Added MP4 support
# 09/22/2006 - P. Harvey Added M4A support
# 07/27/2010 - P. Harvey Updated to 2010-05-03 QuickTime spec
#
# References:
#
# 1) http://developer.apple.com/mac/library/documentation/QuickTime/QTFF/QTFFChap1/qtff1.html
# 2) http://search.cpan.org/dist/MP4-Info-1.04/
# 3) http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt
# 4) http://wiki.multimedia.cx/index.php?title=Apple_QuickTime
# 5) ISO 14496-12 (http://read.pudn.com/downloads64/ebook/226547/ISO_base_media_file_format.pdf)
# 6) ISO 14496-16 (http://www.iec-normen.de/previewpdf/info_isoiec14496-16%7Bed2.0%7Den.pdf)
# 7) http://atomicparsley.sourceforge.net/mpeg-4files.html
# 8) http://wiki.multimedia.cx/index.php?title=QuickTime_container
# 9) http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart3.pdf (Oct 2008)
# 10) http://code.google.com/p/mp4v2/wiki/iTunesMetadata
# 11) http://www.canieti.com.mx/assets/files/1011/IEC_100_1384_DC.pdf
# 12) QuickTime file format specification 2010-05-03
# 13) http://www.adobe.com/devnet/flv/pdf/video_file_format_spec_v10.pdf
# 14) http://standards.iso.org/ittf/PubliclyAvailableStandards/c051533_ISO_IEC_14496-12_2008.zip
# 15) http://getid3.sourceforge.net/source/module.audio-video.quicktime.phps
# 16) http://qtra.apple.com/atoms.html
# 17) http://www.etsi.org/deliver/etsi_ts/126200_126299/126244/10.01.00_60/ts_126244v100100p.pdf
# 18) https://github.com/appsec-labs/iNalyzer/blob/master/scinfo.m
# 19) http://nah6.com/~itsme/cvs-xdadevtools/iphone/tools/decodesinf.pl
# 20) https://developer.apple.com/legacy/library/documentation/quicktime/reference/QT7-1_Update_Reference/QT7-1_Update_Reference.pdf
# 21) Francois Bonzon private communication
# 22) https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/Metadata/Metadata.html
# 23) http://atomicparsley.sourceforge.net/mpeg-4files.html
# 24) https://github.com/sergiomb2/libmp4v2/wiki/iTunesMetadata
# 25) https://cconcolato.github.io/mp4ra/atoms.html
# 26) https://github.com/SamsungVR/android_upload_sdk/blob/master/SDKLib/src/main/java/com/samsung/msca/samsungvr/sdk/UserVideo.java
# 27) https://exiftool.org/forum/index.php?topic=11517.0
#------------------------------------------------------------------------------
package Image::ExifTool::QuickTime;
use strict;
use vars qw($VERSION $AUTOLOAD %stringEncoding);
use Image::ExifTool qw(:DataAccess :Utils);
use Image::ExifTool::Exif;
use Image::ExifTool::GPS;
$VERSION = '2.62';
sub ProcessMOV($$;$);
sub ProcessKeys($$$);
sub ProcessMetaKeys($$$);
sub ProcessMetaData($$$);
sub ProcessEncodingParams($$$);
sub ProcessSampleDesc($$$);
sub ProcessHybrid($$$);
sub ProcessRights($$$);
# ++vvvvvvvvvvvv++ (in QuickTimeStream.pl)
sub Process_mebx($$$);
sub Process_3gf($$$);
sub Process_gps0($$$);
sub Process_gsen($$$);
sub ProcessRIFFTrailer($$$);
sub ProcessTTAD($$$);
sub ProcessNMEA($$$);
sub ProcessGPSLog($$$);
sub SaveMetaKeys($$$);
# ++^^^^^^^^^^^^++
sub ParseItemLocation($$);
sub ParseContentDescribes($$);
sub ParseItemInfoEntry($$);
sub ParseItemPropAssoc($$);
sub FixWrongFormat($);
sub GetMatrixStructure($$);
sub ConvertISO6709($);
sub ConvInvISO6709($);
sub ConvertChapterList($);
sub PrintChapter($);
sub PrintGPSCoordinates($);
sub PrintInvGPSCoordinates($);
sub UnpackLang($;$);
sub WriteKeys($$$);
sub WriteQuickTime($$$);
sub WriteMOV($$);
sub GetLangInfo($$);
sub CheckQTValue($$$);
# MIME types for all entries in the ftypLookup with file extensions
# (defaults to 'video/mp4' if not found in this lookup)
my %mimeLookup = (
'3G2' => 'video/3gpp2',
'3GP' => 'video/3gpp',
AAX => 'audio/vnd.audible.aax',
DVB => 'video/vnd.dvb.file',
F4A => 'audio/mp4',
F4B => 'audio/mp4',
JP2 => 'image/jp2',
JPM => 'image/jpm',
JPX => 'image/jpx',
M4A => 'audio/mp4',
M4B => 'audio/mp4',
M4P => 'audio/mp4',
M4V => 'video/x-m4v',
MOV => 'video/quicktime',
MQV => 'video/quicktime',
HEIC => 'image/heic',
HEVC => 'image/heic-sequence',
HEICS=> 'image/heic-sequence',
HEIF => 'image/heif',
HEIFS=> 'image/heif-sequence',
AVIF => 'image/avif', #PH (NC)
CRX => 'video/x-canon-crx', # (will get overridden)
);
# look up file type from ftyp atom type, with MIME type in comment if known
# (ref http://www.ftyps.com/)
my %ftypLookup = (
'3g2a' => '3GPP2 Media (.3G2) compliant with 3GPP2 C.S0050-0 V1.0', # video/3gpp2
'3g2b' => '3GPP2 Media (.3G2) compliant with 3GPP2 C.S0050-A V1.0.0', # video/3gpp2
'3g2c' => '3GPP2 Media (.3G2) compliant with 3GPP2 C.S0050-B v1.0', # video/3gpp2
'3ge6' => '3GPP (.3GP) Release 6 MBMS Extended Presentations', # video/3gpp
'3ge7' => '3GPP (.3GP) Release 7 MBMS Extended Presentations', # video/3gpp
'3gg6' => '3GPP Release 6 General Profile', # video/3gpp
'3gp1' => '3GPP Media (.3GP) Release 1 (probably non-existent)', # video/3gpp
'3gp2' => '3GPP Media (.3GP) Release 2 (probably non-existent)', # video/3gpp
'3gp3' => '3GPP Media (.3GP) Release 3 (probably non-existent)', # video/3gpp
'3gp4' => '3GPP Media (.3GP) Release 4', # video/3gpp
'3gp5' => '3GPP Media (.3GP) Release 5', # video/3gpp
'3gp6' => '3GPP Media (.3GP) Release 6 Basic Profile', # video/3gpp
'3gp6' => '3GPP Media (.3GP) Release 6 Progressive Download', # video/3gpp
'3gp6' => '3GPP Media (.3GP) Release 6 Streaming Servers', # video/3gpp
'3gs7' => '3GPP Media (.3GP) Release 7 Streaming Servers', # video/3gpp
'aax ' => 'Audible Enhanced Audiobook (.AAX)', #PH
'avc1' => 'MP4 Base w/ AVC ext [ISO 14496-12:2005]', # video/mp4
'CAEP' => 'Canon Digital Camera',
'caqv' => 'Casio Digital Camera',
'CDes' => 'Convergent Design',
'da0a' => 'DMB MAF w/ MPEG Layer II aud, MOT slides, DLS, JPG/PNG/MNG images',
'da0b' => 'DMB MAF, extending DA0A, with 3GPP timed text, DID, TVA, REL, IPMP',
'da1a' => 'DMB MAF audio with ER-BSAC audio, JPG/PNG/MNG images',
'da1b' => 'DMB MAF, extending da1a, with 3GPP timed text, DID, TVA, REL, IPMP',
'da2a' => 'DMB MAF aud w/ HE-AAC v2 aud, MOT slides, DLS, JPG/PNG/MNG images',
'da2b' => 'DMB MAF, extending da2a, with 3GPP timed text, DID, TVA, REL, IPMP',
'da3a' => 'DMB MAF aud with HE-AAC aud, JPG/PNG/MNG images',
'da3b' => 'DMB MAF, extending da3a w/ BIFS, 3GPP timed text, DID, TVA, REL, IPMP',
'dmb1' => 'DMB MAF supporting all the components defined in the specification',
'dmpf' => 'Digital Media Project', # various
'drc1' => 'Dirac (wavelet compression), encapsulated in ISO base media (MP4)',
'dv1a' => 'DMB MAF vid w/ AVC vid, ER-BSAC aud, BIFS, JPG/PNG/MNG images, TS',
'dv1b' => 'DMB MAF, extending dv1a, with 3GPP timed text, DID, TVA, REL, IPMP',
'dv2a' => 'DMB MAF vid w/ AVC vid, HE-AAC v2 aud, BIFS, JPG/PNG/MNG images, TS',
'dv2b' => 'DMB MAF, extending dv2a, with 3GPP timed text, DID, TVA, REL, IPMP',
'dv3a' => 'DMB MAF vid w/ AVC vid, HE-AAC aud, BIFS, JPG/PNG/MNG images, TS',
'dv3b' => 'DMB MAF, extending dv3a, with 3GPP timed text, DID, TVA, REL, IPMP',
'dvr1' => 'DVB (.DVB) over RTP', # video/vnd.dvb.file
'dvt1' => 'DVB (.DVB) over MPEG-2 Transport Stream', # video/vnd.dvb.file
'F4A ' => 'Audio for Adobe Flash Player 9+ (.F4A)', # audio/mp4
'F4B ' => 'Audio Book for Adobe Flash Player 9+ (.F4B)', # audio/mp4
'F4P ' => 'Protected Video for Adobe Flash Player 9+ (.F4P)', # video/mp4
'F4V ' => 'Video for Adobe Flash Player 9+ (.F4V)', # video/mp4
'isc2' => 'ISMACryp 2.0 Encrypted File', # ?/enc-isoff-generic
'iso2' => 'MP4 Base Media v2 [ISO 14496-12:2005]', # video/mp4 (or audio)
'iso3' => 'MP4 Base Media v3', # video/mp4 (or audio)
'iso4' => 'MP4 Base Media v4', # video/mp4 (or audio)
'iso5' => 'MP4 Base Media v5', # video/mp4 (or audio)
'iso6' => 'MP4 Base Media v6', # video/mp4 (or audio)
'iso7' => 'MP4 Base Media v7', # video/mp4 (or audio)
'iso8' => 'MP4 Base Media v8', # video/mp4 (or audio)
'iso9' => 'MP4 Base Media v9', # video/mp4 (or audio)
'isom' => 'MP4 Base Media v1 [IS0 14496-12:2003]', # video/mp4 (or audio)
'JP2 ' => 'JPEG 2000 Image (.JP2) [ISO 15444-1 ?]', # image/jp2
'JP20' => 'Unknown, from GPAC samples (prob non-existent)',
'jpm ' => 'JPEG 2000 Compound Image (.JPM) [ISO 15444-6]', # image/jpm
'jpx ' => 'JPEG 2000 with extensions (.JPX) [ISO 15444-2]', # image/jpx
'KDDI' => '3GPP2 EZmovie for KDDI 3G cellphones', # video/3gpp2
#LCAG => (found in CompatibleBrands of Leica MOV videos)
'M4A ' => 'Apple iTunes AAC-LC (.M4A) Audio', # audio/x-m4a
'M4B ' => 'Apple iTunes AAC-LC (.M4B) Audio Book', # audio/mp4
'M4P ' => 'Apple iTunes AAC-LC (.M4P) AES Protected Audio', # audio/mp4
'M4V ' => 'Apple iTunes Video (.M4V) Video', # video/x-m4v
'M4VH' => 'Apple TV (.M4V)', # video/x-m4v
'M4VP' => 'Apple iPhone (.M4V)', # video/x-m4v
'mj2s' => 'Motion JPEG 2000 [ISO 15444-3] Simple Profile', # video/mj2
'mjp2' => 'Motion JPEG 2000 [ISO 15444-3] General Profile', # video/mj2
'mmp4' => 'MPEG-4/3GPP Mobile Profile (.MP4/3GP) (for NTT)', # video/mp4
'mp21' => 'MPEG-21 [ISO/IEC 21000-9]', # various
'mp41' => 'MP4 v1 [ISO 14496-1:ch13]', # video/mp4
'mp42' => 'MP4 v2 [ISO 14496-14]', # video/mp4
'mp71' => 'MP4 w/ MPEG-7 Metadata [per ISO 14496-12]', # various
'MPPI' => 'Photo Player, MAF [ISO/IEC 23000-3]', # various
'mqt ' => 'Sony / Mobile QuickTime (.MQV) US Patent 7,477,830 (Sony Corp)', # video/quicktime
'MSNV' => 'MPEG-4 (.MP4) for SonyPSP', # audio/mp4
'NDAS' => 'MP4 v2 [ISO 14496-14] Nero Digital AAC Audio', # audio/mp4
'NDSC' => 'MPEG-4 (.MP4) Nero Cinema Profile', # video/mp4
'NDSH' => 'MPEG-4 (.MP4) Nero HDTV Profile', # video/mp4
'NDSM' => 'MPEG-4 (.MP4) Nero Mobile Profile', # video/mp4
'NDSP' => 'MPEG-4 (.MP4) Nero Portable Profile', # video/mp4
'NDSS' => 'MPEG-4 (.MP4) Nero Standard Profile', # video/mp4
'NDXC' => 'H.264/MPEG-4 AVC (.MP4) Nero Cinema Profile', # video/mp4
'NDXH' => 'H.264/MPEG-4 AVC (.MP4) Nero HDTV Profile', # video/mp4
'NDXM' => 'H.264/MPEG-4 AVC (.MP4) Nero Mobile Profile', # video/mp4
'NDXP' => 'H.264/MPEG-4 AVC (.MP4) Nero Portable Profile', # video/mp4
'NDXS' => 'H.264/MPEG-4 AVC (.MP4) Nero Standard Profile', # video/mp4
'odcf' => 'OMA DCF DRM Format 2.0 (OMA-TS-DRM-DCF-V2_0-20060303-A)', # various
'opf2' => 'OMA PDCF DRM Format 2.1 (OMA-TS-DRM-DCF-V2_1-20070724-C)',
'opx2' => 'OMA PDCF DRM + XBS extensions (OMA-TS-DRM_XBS-V1_0-20070529-C)',
'pana' => 'Panasonic Digital Camera',
'qt ' => 'Apple QuickTime (.MOV/QT)', # video/quicktime
'ROSS' => 'Ross Video',
'sdv ' => 'SD Memory Card Video', # various?
'ssc1' => 'Samsung stereoscopic, single stream',
'ssc2' => 'Samsung stereoscopic, dual stream',
'XAVC' => 'Sony XAVC', #PH
'heic' => 'High Efficiency Image Format HEVC still image (.HEIC)', # image/heic
'hevc' => 'High Efficiency Image Format HEVC sequence (.HEICS)', # image/heic-sequence
'mif1' => 'High Efficiency Image Format still image (.HEIF)', # image/heif
'msf1' => 'High Efficiency Image Format sequence (.HEIFS)', # image/heif-sequence
'heix' => 'High Efficiency Image Format still image (.HEIF)', # image/heif (ref PH, Canon 1DXmkIII)
'avif' => 'AV1 Image File Format (.AVIF)', # image/avif
'crx ' => 'Canon Raw (.CRX)', #PH (CR3 or CRM; use Canon CompressorVersion to decide)
);
# information for int32u date/time tags (time zero is Jan 1, 1904)
my %timeInfo = (
Notes => 'converted from UTC to local time if the QuickTimeUTC option is set',
Shift => 'Time',
Writable => 1,
Permanent => 1,
DelValue => 0,
# It is not uncommon for brain-dead software to use the wrong time zero,
# so assume a time zero of Jan 1, 1970 if the date is before this
# Note: This value will be in UTC if generated by a system that is aware of the time zone
RawConv => q{
my $offset = (66 * 365 + 17) * 24 * 3600;
return $val - $offset if $val >= $offset or $$self{OPTIONS}{QuickTimeUTC};
if ($val and not $$self{IsWriting}) {
$self->WarnOnce('Patched incorrect time zero for QuickTime date/time tag',1);
}
return $val;
},
RawConvInv => q{
if ($$self{FileType} eq 'CR3' and not $self->Options('QuickTimeUTC')) {
# convert to UTC
my $offset = (66 * 365 + 17) * 24 * 3600;
$val = ConvertUnixTime($val - $offset);
$val = GetUnixTime($val, 1) + $offset;
}
return $val;
},
# (all CR3 files store UTC times - PH)
ValueConv => 'ConvertUnixTime($val, $self->Options("QuickTimeUTC") || $$self{FileType} eq "CR3")',
ValueConvInv => q{
$val = GetUnixTime($val, $self->Options("QuickTimeUTC"));
return undef unless defined $val;
return $val + (66 * 365 + 17) * 24 * 3600;
},
PrintConv => '$self->ConvertDateTime($val)',
PrintConvInv => '$self->InverseDateTime($val)',
# (can't put Groups here because they aren't constant!)
);
# information for duration tags
my %durationInfo = (
ValueConv => '$$self{TimeScale} ? $val / $$self{TimeScale} : $val',
PrintConv => '$$self{TimeScale} ? ConvertDuration($val) : $val',
);
# handle unknown tags
my %unknownInfo = (
Unknown => 1,
ValueConv => '$val =~ /^([\x20-\x7e]*)\0*$/ ? $1 : \$val',
);
# multi-language text with 6-byte header
my %langText = ( IText => 6 );
# parsing for most of the 3gp udta language text boxes
my %langText3gp = (
Notes => 'used in 3gp videos',
Avoid => 1,
IText => 6,
);
# 4-character Vendor ID codes (ref PH)
my %vendorID = (
appl => 'Apple',
fe20 => 'Olympus (fe20)', # (FE200)
FFMP => 'FFmpeg',
'GIC '=> 'General Imaging Co.',
kdak => 'Kodak',
KMPI => 'Konica-Minolta',
leic => 'Leica',
mino => 'Minolta',
niko => 'Nikon',
NIKO => 'Nikon',
olym => 'Olympus',
pana => 'Panasonic',
pent => 'Pentax',
pr01 => 'Olympus (pr01)', # (FE100,FE110,FE115)
sany => 'Sanyo',
'SMI '=> 'Sorenson Media Inc.',
ZORA => 'Zoran Corporation',
'AR.D'=> 'Parrot AR.Drone',
' KD '=> 'Kodak', # (FZ201)
);
# QuickTime data atom encodings for string types (ref 12)
%stringEncoding = (
1 => 'UTF8',
2 => 'UTF16',
3 => 'ShiftJIS',
4 => 'UTF8',
5 => 'UTF16',
);
my %graphicsMode = (
# (ref http://homepage.mac.com/vanhoek/MovieGuts%20docs/64.html)
0x00 => 'srcCopy',
0x01 => 'srcOr',
0x02 => 'srcXor',
0x03 => 'srcBic',
0x04 => 'notSrcCopy',
0x05 => 'notSrcOr',
0x06 => 'notSrcXor',
0x07 => 'notSrcBic',
0x08 => 'patCopy',
0x09 => 'patOr',
0x0a => 'patXor',
0x0b => 'patBic',
0x0c => 'notPatCopy',
0x0d => 'notPatOr',
0x0e => 'notPatXor',
0x0f => 'notPatBic',
0x20 => 'blend',
0x21 => 'addPin',
0x22 => 'addOver',
0x23 => 'subPin',
0x24 => 'transparent',
0x25 => 'addMax',
0x26 => 'subOver',
0x27 => 'addMin',
0x31 => 'grayishTextOr',
0x32 => 'hilite',
0x40 => 'ditherCopy',
# the following ref ISO/IEC 15444-3
0x100 => 'Alpha',
0x101 => 'White Alpha',
0x102 => 'Pre-multiplied Black Alpha',
0x110 => 'Component Alpha',
);
my %channelLabel = (
0xFFFFFFFF => 'Unknown',
0 => 'Unused',
100 => 'UseCoordinates',
1 => 'Left',
2 => 'Right',
3 => 'Center',
4 => 'LFEScreen',
5 => 'LeftSurround',
6 => 'RightSurround',
7 => 'LeftCenter',
8 => 'RightCenter',
9 => 'CenterSurround',
10 => 'LeftSurroundDirect',
11 => 'RightSurroundDirect',
12 => 'TopCenterSurround',
13 => 'VerticalHeightLeft',
14 => 'VerticalHeightCenter',
15 => 'VerticalHeightRight',
16 => 'TopBackLeft',
17 => 'TopBackCenter',
18 => 'TopBackRight',
33 => 'RearSurroundLeft',
34 => 'RearSurroundRight',
35 => 'LeftWide',
36 => 'RightWide',
37 => 'LFE2',
38 => 'LeftTotal',
39 => 'RightTotal',
40 => 'HearingImpaired',
41 => 'Narration',
42 => 'Mono',
43 => 'DialogCentricMix',
44 => 'CenterSurroundDirect',
45 => 'Haptic',
200 => 'Ambisonic_W',
201 => 'Ambisonic_X',
202 => 'Ambisonic_Y',
203 => 'Ambisonic_Z',
204 => 'MS_Mid',
205 => 'MS_Side',
206 => 'XY_X',
207 => 'XY_Y',
301 => 'HeadphonesLeft',
302 => 'HeadphonesRight',
304 => 'ClickTrack',
305 => 'ForeignLanguage',
400 => 'Discrete',
0x10000 => 'Discrete_0',
0x10001 => 'Discrete_1',
0x10002 => 'Discrete_2',
0x10003 => 'Discrete_3',
0x10004 => 'Discrete_4',
0x10005 => 'Discrete_5',
0x10006 => 'Discrete_6',
0x10007 => 'Discrete_7',
0x10008 => 'Discrete_8',
0x10009 => 'Discrete_9',
0x1000a => 'Discrete_10',
0x1000b => 'Discrete_11',
0x1000c => 'Discrete_12',
0x1000d => 'Discrete_13',
0x1000e => 'Discrete_14',
0x1000f => 'Discrete_15',
0x1ffff => 'Discrete_65535',
);
# properties which don't get inherited from the parent
my %dontInherit = (
ispe => 1, # size of parent may be different
hvcC => 1, # (likely redundant)
);
# tags that may be duplicated and directories that may contain duplicate tags
# (used only to avoid warnings when Validate-ing)
my %dupTagOK = ( mdat => 1, trak => 1, free => 1, infe => 1, sgpd => 1, dimg => 1, CCDT => 1,
sbgp => 1, csgm => 1, uuid => 1, cdsc => 1, maxr => 1, '----' => 1 );
my %dupDirOK = ( ipco => 1, '----' => 1 );
# the usual atoms required to decode timed metadata with the ExtractEmbedded option
my %eeStd = ( stco => 'stbl', co64 => 'stbl', stsz => 'stbl', stz2 => 'stbl',
stsc => 'stbl', stts => 'stbl' );
# boxes and their containers for the various handler types that we want to save
# when the ExtractEmbedded is enabled (currently only the 'gps ' container name is
# used, but others have been checked against all available sample files and may be
# useful in the future if the names are used for different boxes on other locations)
my %eeBox = (
# (note: vide is only processed if specific atoms exist in the VideoSampleDesc)
vide => { %eeStd,
JPEG => 'stsd',
},
text => { %eeStd },
meta => { %eeStd },
sbtl => { %eeStd },
data => { %eeStd },
camm => { %eeStd }, # (Insta360)
ctbx => { %eeStd }, # (GM cars)
'' => { 'gps ' => 'moov', 'GPS ' => 'main' }, # (no handler -- in top level 'moov' box, and main)
);
# boxes to save when ExtractEmbedded is set to 2 or higher
my %eeBox2 = (
vide => { avcC => 'stsd' }, # (parses H264 video stream)
);
# QuickTime atoms
%Image::ExifTool::QuickTime::Main = (
PROCESS_PROC => \&ProcessMOV,
WRITE_PROC => \&WriteQuickTime, # (only needs to be defined for directories to process when writing)
GROUPS => { 2 => 'Video' },
meta => { # 'meta' is found here in my Sony ILCE-7S MP4 sample - PH
Name => 'Meta',
SubDirectory => {
TagTable => 'Image::ExifTool::QuickTime::Meta',
Start => 4, # skip 4-byte version number header
},
},
meco => { #ISO14496-12:2015
Name => 'OtherMeta',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::OtherMeta' },
},
free => [
{
Name => 'KodakFree',
# (found in Kodak M5370 MP4 videos)
Condition => '$$valPt =~ /^\0\0\0.Seri/s',
SubDirectory => { TagTable => 'Image::ExifTool::Kodak::Free' },
},{
Name => 'Pittasoft',
# (Pittasoft Blackview dashcam MP4 videos)
Condition => '$$valPt =~ /^\0\0..(cprt|sttm|ptnm|ptrh|thum|gps |3gf )/s',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::Pittasoft' },
},{
Unknown => 1,
Binary => 1,
},
# (also Samsung WB750 uncompressed thumbnail data starting with "SDIC\0")
],
# fre1 - 4 bytes: "june" (Kodak PixPro SP360)
frea => {
Name => 'Kodak_frea',
SubDirectory => { TagTable => 'Image::ExifTool::Kodak::frea' },
},
skip => [
{
Name => 'CanonSkip',
Condition => '$$valPt =~ /^\0.{3}(CNDB|CNCV|CNMN|CNFV|CNTH|CNDM)/s',
SubDirectory => { TagTable => 'Image::ExifTool::Canon::Skip' },
},
{
Name => 'PreviewImage', # (found in DuDuBell M1 dashcam MOV files)
Groups => { 2 => 'Preview' },
Condition => '$$valPt =~ /^.{12}\xff\xd8\xff/',
Binary => 1,
RawConv => q{
my $len = Get32u(\$val, 8);
return undef unless length($val) >= $len + 12;
return substr($val, 12, $len);
},
},
{ Name => 'Skip', Unknown => 1, Binary => 1 },
],
wide => { Unknown => 1, Binary => 1 },
ftyp => { #MP4
Name => 'FileType',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::FileType' },
},
pnot => {
Name => 'Preview',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::Preview' },
},
PICT => {
Name => 'PreviewPICT',
Groups => { 2 => 'Preview' },
Binary => 1,
},
pict => { #8
Name => 'PreviewPICT',
Groups => { 2 => 'Preview' },
Binary => 1,
},
# (note that moov is present for an HEIF sequence)
moov => {
Name => 'Movie',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::Movie' },
},
moof => {
Name => 'MovieFragment',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::MovieFragment' },
},
# mfra - movie fragment random access: contains tfra (track fragment random access), and
# mfro (movie fragment random access offset) (ref 5)
mdat => { Name => 'MediaData', Unknown => 1, Binary => 1 },
'mdat-size' => {
Name => 'MediaDataSize',
Notes => q{
not a real tag ID, this tag represents the size of the 'mdat' data in bytes
and is used in the AvgBitrate calculation
},
},
'mdat-offset' => 'MediaDataOffset',
junk => { Unknown => 1, Binary => 1 }, #8
uuid => [
{ #9 (MP4 files)
Name => 'XMP',
# *** this is where ExifTool writes XMP in MP4 videos (as per XMP spec) ***
Condition => '$$valPt=~/^\xbe\x7a\xcf\xcb\x97\xa9\x42\xe8\x9c\x71\x99\x94\x91\xe3\xaf\xac/',
WriteGroup => 'XMP', # (write main XMP tags here)
SubDirectory => {
TagTable => 'Image::ExifTool::XMP::Main',
Start => 16,
},
},
{ #11 (MP4 files)
Name => 'UUID-PROF',
Condition => '$$valPt=~/^PROF!\xd2\x4f\xce\xbb\x88\x69\x5c\xfa\xc9\xc7\x40/',
SubDirectory => {
TagTable => 'Image::ExifTool::QuickTime::Profile',
Start => 24, # uid(16) + version(1) + flags(3) + count(4)
},
},
{ #PH (Flip MP4 files)
Name => 'UUID-Flip',
Condition => '$$valPt=~/^\x4a\xb0\x3b\x0f\x61\x8d\x40\x75\x82\xb2\xd9\xfa\xce\xd3\x5f\xf5/',
SubDirectory => {
TagTable => 'Image::ExifTool::QuickTime::Flip',
Start => 16,
},
},
# "\x98\x7f\xa3\xdf\x2a\x85\x43\xc0\x8f\x8f\xd9\x7c\x47\x1e\x8e\xea" - unknown data in Flip videos
{ #PH (Canon CR3)
Name => 'UUID-Canon2',
WriteLast => 1, # MUST come after mdat or DPP will drop mdat when writing!
Condition => '$$valPt=~/^\x21\x0f\x16\x87\x91\x49\x11\xe4\x81\x11\x00\x24\x21\x31\xfc\xe4/',
SubDirectory => {
TagTable => 'Image::ExifTool::Canon::uuid2',
Start => 16,
},
},
{ # (ref https://github.com/JamesHeinrich/getID3/blob/master/getid3/module.audio-video.quicktime.php)
Name => 'SensorData', # sensor data for the 360Fly
Condition => '$$valPt=~/^\xef\xe1\x58\x9a\xbb\x77\x49\xef\x80\x95\x27\x75\x9e\xb1\xdc\x6f/ and $$self{OPTIONS}{ExtractEmbedded}',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::Tags360Fly' },
},
{
Name => 'SensorData',
Condition => '$$valPt=~/^\xef\xe1\x58\x9a\xbb\x77\x49\xef\x80\x95\x27\x75\x9e\xb1\xdc\x6f/',
Notes => 'raw 360Fly sensor data without ExtractEmbedded option',
RawConv => q{
$self->WarnOnce('Use the ExtractEmbedded option to decode timed SensorData',3);
return \$val;
},
},
{ #PH (Canon CR3)
Name => 'PreviewImage',
Condition => '$$valPt=~/^\xea\xf4\x2b\x5e\x1c\x98\x4b\x88\xb9\xfb\xb7\xdc\x40\x6e\x4d\x16/',
Groups => { 2 => 'Preview' },
# 0x00 - undef[16]: UUID
# 0x10 - int32u[2]: "0 1" (version and/or item count?)
# 0x18 - int32u: PRVW atom size
# 0x20 - int32u: 'PRVW'
# 0x30 - int32u: 0
# 0x34 - int16u: 1
# 0x36 - int16u: image width
# 0x38 - int16u: image height
# 0x3a - int16u: 1
# 0x3c - int32u: preview length
RawConv => '$val = substr($val, 0x30); $self->ValidateImage(\$val, $tag)',
},
{ #8
Name => 'UUID-Unknown',
%unknownInfo,
},
],
_htc => {
Name => 'HTCInfo',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::HTCInfo' },
},
udta => {
Name => 'UserData',
SubDirectory => { TagTable => 'Image::ExifTool::FLIR::UserData' },
},
thum => { #PH
Name => 'ThumbnailImage',
Groups => { 2 => 'Preview' },
Binary => 1,
},
'thm ' => { #PH (70mai A800)
Name => 'ThumbnailImage',
Groups => { 2 => 'Preview' },
Binary => 1,
},
ardt => { #PH
Name => 'ARDroneFile',
ValueConv => 'length($val) > 4 ? substr($val,4) : $val', # remove length
},
prrt => { #PH
Name => 'ARDroneTelemetry',
Notes => q{
telemetry information for each video frame: status1, status2, time, pitch,
roll, yaw, speed, altitude
},
ValueConv => q{
my $size = length $val;
return \$val if $size < 12 or not $$self{OPTIONS}{Binary};
my $len = Get16u(\$val, 2);
my $str = '';
SetByteOrder('II');
my $pos = 12;
while ($pos + $len <= $size) {
my $s1 = Get16u(\$val, $pos);
# s2: 7=take-off?, 3=moving, 4=hovering, 9=landing?, 2=landed
my $s2 = Get16u(\$val, $pos + 2);
$str .= "$s1 $s2";
my $num = int(($len-4)/4);
my ($i, $v);
for ($i=0; $i<$num; ++$i) {
my $pt = $pos + 4 + $i * 4;
if ($i > 0 && $i < 4) {
$v = GetFloat(\$val, $pt); # pitch/roll/yaw
} else {
$v = Get32u(\$val, $pt);
# convert time to sec, and speed(NC)/altitude to metres
$v /= 1000 if $i <= 5;
}
$str .= " $v";
}
$str .= "\n";
$pos += $len;
}
SetByteOrder('MM');
return \$str;
},
},
udat => { #PH (GPS NMEA-format log written by Datakam Player software)
Name => 'GPSLog',
Binary => 1, # (actually ASCII, but very lengthy)
Notes => 'parsed to extract GPS separately when ExtractEmbedded is used',
RawConv => q{
$val =~ s/\0+$//; # remove trailing nulls
if (length $val and $$self{OPTIONS}{ExtractEmbedded}) {
my $tagTbl = GetTagTable('Image::ExifTool::QuickTime::Stream');
Image::ExifTool::QuickTime::ProcessGPSLog($self, { DataPt => \$val }, $tagTbl);
}
return $val;
},
},
# meta - proprietary XML information written by some Flip cameras - PH
# beam - 16 bytes found in an iPhone video
IDIT => { #PH (written by DuDuBell M1, VSYS M6L dashcams)
Name => 'DateTimeOriginal',
Description => 'Date/Time Original',
Groups => { 2 => 'Time' },
Format => 'string', # (removes trailing "\0")
Shift => 'Time',
Writable => 1,
Permanent => 1,
DelValue => '0000-00-00T00:00:00+0000',
ValueConv => '$val=~tr/-/:/; $val',
ValueConvInv => '$val=~s/(\d+):(\d+):/$1-$2-/; $val',
PrintConv => '$self->ConvertDateTime($val)',
PrintConvInv => '$self->InverseDateTime($val,1)', # (add time zone if it didn't exist)
},
gps0 => { #PH (DuDuBell M1, VSYS M6L)
Name => 'GPSTrack',
SubDirectory => {
TagTable => 'Image::ExifTool::QuickTime::Stream',
ProcessProc => \&Process_gps0,
},
},
gsen => { #PH (DuDuBell M1, VSYS M6L)
Name => 'GSensor',
SubDirectory => {
TagTable => 'Image::ExifTool::QuickTime::Stream',
ProcessProc => \&Process_gsen,
},
},
# gpsa - seen hex "01 20 00 00" (DuDuBell M1, VSYS M6L)
# gsea - 20 bytes hex "05 00's..." (DuDuBell M1) "05 08 02 01 ..." (VSYS M6L)
'GPS ' => { # GPS data written by 70mai dashcam (parsed in QuickTimeStream.pl)
Name => 'GPSDataList2',
Unknown => 1,
Binary => 1,
},
);
# MPEG-4 'ftyp' atom
# (ref http://developer.apple.com/mac/library/documentation/QuickTime/QTFF/QTFFChap1/qtff1.html)
%Image::ExifTool::QuickTime::FileType = (
PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
GROUPS => { 2 => 'Video' },
FORMAT => 'int32u',
0 => {
Name => 'MajorBrand',
Format => 'undef[4]',
PrintConv => \%ftypLookup,
},
1 => {
Name => 'MinorVersion',
Format => 'undef[4]',
ValueConv => 'sprintf("%x.%x.%x", unpack("nCC", $val))',
},
2 => {
Name => 'CompatibleBrands',
Format => 'undef[$size-8]',
# ignore any entry with a null, and return others as a list
ValueConv => 'my @a=($val=~/.{4}/sg); @a=grep(!/\0/,@a); \@a',
},
);
# proprietary HTC atom (HTC One MP4 video)
%Image::ExifTool::QuickTime::HTCInfo = (
PROCESS_PROC => \&ProcessMOV,
GROUPS => { 2 => 'Video' },
NOTES => 'Tags written by some HTC camera phones.',
slmt => {
Name => 'Unknown_slmt',
Unknown => 1,
Format => 'int32u', # (observed values: 4)
},
);
# atoms used in QTIF files
%Image::ExifTool::QuickTime::ImageFile = (
PROCESS_PROC => \&ProcessMOV,
GROUPS => { 2 => 'Image' },
NOTES => 'Tags used in QTIF QuickTime Image Files.',
idsc => {
Name => 'ImageDescription',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::ImageDesc' },
},
idat => {
Name => 'ImageData',
Binary => 1,
},
iicc => {
Name => 'ICC_Profile',
SubDirectory => { TagTable => 'Image::ExifTool::ICC_Profile::Main' },
},
);
# image description data block
%Image::ExifTool::QuickTime::ImageDesc = (
PROCESS_PROC => \&ProcessHybrid,
VARS => { ID_LABEL => 'ID/Index' },
GROUPS => { 2 => 'Image' },
FORMAT => 'int16u',
2 => {
Name => 'CompressorID',
Format => 'string[4]',
# not very useful since this isn't a complete list and name is given below
# # ref http://developer.apple.com/mac/library/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html
# PrintConv => {
# cvid => 'Cinepak',
# jpeg => 'JPEG',
# 'smc '=> 'Graphics',
# 'rle '=> 'Animation',
# rpza => 'Apple Video',
# kpcd => 'Kodak Photo CD',
# 'png '=> 'Portable Network Graphics',
# mjpa => 'Motion-JPEG (format A)',
# mjpb => 'Motion-JPEG (format B)',
# SVQ1 => 'Sorenson video, version 1',
# SVQ3 => 'Sorenson video, version 3',
# mp4v => 'MPEG-4 video',
# 'dvc '=> 'NTSC DV-25 video',
# dvcp => 'PAL DV-25 video',
# 'gif '=> 'Compuserve Graphics Interchange Format',
# h263 => 'H.263 video',
# tiff => 'Tagged Image File Format',
# 'raw '=> 'Uncompressed RGB',
# '2vuY'=> "Uncompressed Y'CbCr, 3x8-bit 4:2:2 (2vuY)",
# 'yuv2'=> "Uncompressed Y'CbCr, 3x8-bit 4:2:2 (yuv2)",
# v308 => "Uncompressed Y'CbCr, 8-bit 4:4:4",
# v408 => "Uncompressed Y'CbCr, 8-bit 4:4:4:4",
# v216 => "Uncompressed Y'CbCr, 10, 12, 14, or 16-bit 4:2:2",
# v410 => "Uncompressed Y'CbCr, 10-bit 4:4:4",
# v210 => "Uncompressed Y'CbCr, 10-bit 4:2:2",
# hvc1 => 'HEVC', #PH
# },
},
10 => {
Name => 'VendorID',
Format => 'string[4]',
RawConv => 'length $val ? $val : undef',
PrintConv => \%vendorID,
SeparateTable => 'VendorID',
},
# 14 - ("Quality" in QuickTime docs) ??
16 => 'SourceImageWidth',
17 => 'SourceImageHeight',
18 => { Name => 'XResolution', Format => 'fixed32u' },
20 => { Name => 'YResolution', Format => 'fixed32u' },
# 24 => 'FrameCount', # always 1 (what good is this?)
25 => {
Name => 'CompressorName',
Format => 'string[32]',
# (sometimes this is a Pascal string, and sometimes it is a C string)
RawConv => q{
$val=substr($val,1,ord($1)) if $val=~/^([\0-\x1f])/ and ord($1)<length($val);
length $val ? $val : undef;
},
},
41 => 'BitDepth',
#
# Observed offsets for child atoms of various CompressorID types:
#
# CompressorID Offset Child atoms
# ----------- ------ ----------------
# avc1 86 avcC, btrt, colr, pasp, fiel, clap, svcC
# mp4v 86 esds, pasp
# s263 86 d263
#
btrt => {
Name => 'BitrateInfo',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::Bitrate' },
},
# Reference for fiel, colr, pasp, clap:
# https://developer.apple.com/library/mac/technotes/tn2162/_index.html#//apple_ref/doc/uid/DTS40013070-CH1-TNTAG9
fiel => {
Name => 'VideoFieldOrder',
ValueConv => 'join(" ", unpack("C*",$val))',
PrintConv => [{
1 => 'Progressive',
2 => '2:1 Interlaced',
}],
},
colr => {
Name => 'ColorRepresentation',
ValueConv => 'join(" ", substr($val,0,4), unpack("x4n*",$val))',
},
pasp => {
Name => 'PixelAspectRatio',
ValueConv => 'join(":", unpack("N*",$val))',
},
clap => {
Name => 'CleanAperture',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::CleanAperture' },
},
avcC => {
# (see http://thompsonng.blogspot.ca/2010/11/mp4-file-format-part-2.html)
Name => 'AVCConfiguration',
Unknown => 1,
Binary => 1,
},
JPEG => { # (found in CR3 images; used as a flag to identify JpgFromRaw 'vide' stream)
Name => 'JPEGInfo',
# (4 bytes all zero)
Unknown => 1,
Binary => 1,
},
# hvcC - HEVC configuration
# svcC - 7 bytes: 00 00 00 00 ff e0 00
# esds - elementary stream descriptor
# d263
gama => { Name => 'Gamma', Format => 'fixed32u' },
# mjqt - default quantization table for MJPEG
# mjht - default Huffman table for MJPEG
# csgm ? (seen in hevc video)
CMP1 => { # Canon CR3
Name => 'CMP1',
SubDirectory => { TagTable => 'Image::ExifTool::Canon::CMP1' },
},
CDI1 => { # Canon CR3
Name => 'CDI1',
SubDirectory => {
TagTable => 'Image::ExifTool::Canon::CDI1',
Start => 4,
},
},
# JPEG - 4 bytes all 0 (Canon CR3)
# free - (Canon CR3)
#
# spherical video v2 stuff (untested)
#
st3d => {
Name => 'Stereoscopic3D',
Format => 'int8u',
ValueConv => '$val =~ s/.* //; $val', # (remove leading version/flags bytes?)
PrintConv => {
0 => 'Monoscopic',
1 => 'Stereoscopic Top-Bottom',
2 => 'Stereoscopic Left-Right',
3 => 'Stereoscopic Stereo-Custom', # (provisional in spec as of 2017-10-10)
},
},
sv3d => {
Name => 'SphericalVideo',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::sv3d' },
},
);
# 'sv3d' atom information (ref https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md)
%Image::ExifTool::QuickTime::sv3d = (
PROCESS_PROC => \&ProcessMOV,
GROUPS => { 2 => 'Video' },
NOTES => q{
Tags defined by the Spherical Video V2 specification. See
L<https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md>
for the specification.
},
svhd => {
Name => 'MetadataSource',
Format => 'undef',
ValueConv => '$val=~tr/\0//d; $val', # (remove version/flags? and terminator?)
},
proj => {
Name => 'Projection',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::proj' },
},
);
# 'proj' atom information (ref https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md)
%Image::ExifTool::QuickTime::proj = (
PROCESS_PROC => \&ProcessMOV,
GROUPS => { 2 => 'Video' },
prhd => {
Name => 'ProjectionHeader',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::prhd' },
},
cbmp => {
Name => 'CubemapProj',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::cbmp' },
},
equi => {
Name => 'EquirectangularProj',
SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::equi' },
},
# mshp - MeshProjection (P.I.T.A. to decode, for not much reward, see ref)
);
# 'prhd' atom information (ref https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md)
%Image::ExifTool::QuickTime::prhd = (
PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
GROUPS => { 2 => 'Video' },
FORMAT => 'fixed32s',
# 0 - version (high 8 bits) / flags (low 24 bits)
1 => 'PoseYawDegrees',
2 => 'PosePitchDegrees',
3 => 'PoseRollDegrees',
);
# 'cbmp' atom information (ref https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md)
%Image::ExifTool::QuickTime::cbmp = (
PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
GROUPS => { 2 => 'Video' },
FORMAT => 'int32u',
# 0 - version (high 8 bits) / flags (low 24 bits)
1 => 'Layout',